Débug, accès de la view addedit_project via le header et formulaire prêt à l'emplois

This commit is contained in:
GuillaumeH-Cci 2026-02-17 19:07:16 +01:00
parent c91eb6cf89
commit b6ca898069
46 changed files with 109 additions and 4896 deletions

View file

@ -1,27 +1,60 @@
{extends file="views/layout.tpl"}
{block name="content"}
<section>
<form method="post" enctype="multipart/form-data" >
<p>
<label>Titre:</label>
<input name="title" value="{$objArticle->getTitle()}"
class="form-control {if (isset($arrError['title'])) } is-invalid {/if} " type="text" >
</p>
<p>
<label>Contenu:</label>
<textarea name="content" class="form-control {if (isset($arrError['content'])) } is-invalid {/if} " >{$objArticle->getContent()}</textarea>
</p>
<p>
<label>Image:</label>
{if (!$objArticle->getId()|is_null)}
<img src="assests/images/{$objArticle->getImg()}">
{/if}
<input name="img" class="form-control {if (isset($arrError['img'])) } is-invalid {/if}" type="file">
</p>
<p>
<input class="form-control btn btn-primary" type="submit" >
</p>
</form>
</section>
<section class="container mt-4">
{if isset($smarty.session.user)}
<form class="m-2" method="post" enctype="multipart/form-data" onsubmit="return confirm('Êtes-vous certain de vouloir poster votre projet ?')">
<div class="mb-3">
<label class="form-label">Titre</label>
<input type="text" name="titleProject" class="form-control" required>
</div>
<div class="mb-3">
<label class="form-label">Description (courte)</label>
<textarea name="descProject" class="form-control" rows="2"></textarea>
</div>
<div class="mb-3">
<label class="form-label">Texte complet du Portfolio</label>
<textarea name="textProject" class="form-control" rows="5"></textarea>
</div>
<div class="col-6 mb-3">
<fieldset class="border p-2 rounded">
<legend class="form-label h6">Catégorie</legend>
<select class="form-select" id="category" name="category">
<option value="0" {if $intCategory == 0}selected{/if}>Toutes les catégories</option>
{foreach $arrCategory as $arrDetCategory}
<option value="{$arrDetCategory['category_id']}"
{if $intCategory == $arrDetCategory['category_id']}selected{/if}
>
{$arrDetCategory['category_name']}
</option>
{/foreach}
</select>
</fieldset>
</div>
<div class="mb-3">
<label class="h5">Miniature de votre projet</label>
<input name="imageThumbnail" class="form-control" type="file">
</div>
<div class="mb-3">
<label class="h5">Images de votre projet</label>
<input name="imageProject" class="form-control" type="file">
</div>
<div class="mt-4">
<button type="submit" class="btn btn-primary btn-md" name="sendProject">Envoyer</button>
{* <button type="submit" class="btn btn-outline-warning btn-md" name="toContinue">Sauvegarder en brouillon</button> *}
</div>
</form>
{else}
<div class="alert alert-danger mt-5">
<p class="mb-0">Vous devez vous connecter pour accéder à cette fonctionnalité</p>
</div>
{/if}
</section>
{/block}