Débug, accès de la view addedit_project via le header et formulaire prêt à l'emplois
This commit is contained in:
parent
c91eb6cf89
commit
b6ca898069
46 changed files with 109 additions and 4896 deletions
|
|
@ -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}
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
{* Affichage d'un formulaire en cas d'appuie sur le bouton "+" *}
|
||||
{if isset($smarty.post.showForm) || isset($smarty.post.showFormContinue)}
|
||||
{if isset($smarty.session.user)}
|
||||
<form class="m-2" method="post" enctype="multipart/form-data" onsubmit="return confirm('Voulez-vous vraiment envoyer le formulaire ?')">
|
||||
<form class="m-2" method="post" enctype="multipart/form-data" onsubmit="return confirm('Êtes-vous certain de vouloir poster votre projet ? (Vous pourrez toujours le modifier plus tard)')">
|
||||
<div>
|
||||
<label>Titre</label>
|
||||
<input type="text" name="titleProject">
|
||||
|
|
|
|||
|
|
@ -1,79 +0,0 @@
|
|||
{extends file="views/layout.tpl"}
|
||||
|
||||
{block name="content"}
|
||||
<main class="container mt-5 py-5">
|
||||
|
||||
<!-- Message après l'envoi d'email -->
|
||||
{if isset($smarty.get.mail) && $smarty.get.mail === 'ok'}
|
||||
<div class="alert alert-success">Email envoyé avec succès.</div>
|
||||
{elseif isset($smarty.get.mail) && $smarty.get.mail === 'fail'}
|
||||
<div class="alert alert-danger">Erreur lors de l'envoi de l'email.</div>
|
||||
{/if}
|
||||
|
||||
<div class="row g-4">
|
||||
|
||||
<!-- Contenu principal du projet -->
|
||||
<div class="col-lg-8">
|
||||
|
||||
<h1 class="fw-bold">{$objProject->getTitle()}</h1>
|
||||
|
||||
<p class="text-muted">
|
||||
{$arrProject.category_name ?? 'Général'}
|
||||
</p>
|
||||
|
||||
<div class="mb-4 shadow-sm">
|
||||
<img src=".{$objProject->getThumbnail()}"
|
||||
class="img-fluid rounded w-100">
|
||||
</div>
|
||||
|
||||
<div class="bg-light p-4 rounded mb-4">
|
||||
<h4 class="border-bottom pb-2">Description</h4>
|
||||
<p class="lead">{$objProject->getDescription()}</p>
|
||||
|
||||
<div class="mt-4">
|
||||
{$objProject->getContent()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Formulaire qui envoie la demande au contrôleur (sendEmail) -->
|
||||
<div class="card shadow-sm p-4 mb-5">
|
||||
<form method="post" action="index.php?ctrl=project&action=sendEmail">
|
||||
|
||||
<input type="hidden" name="project_id"
|
||||
value="{$objProject->getId()}">
|
||||
|
||||
<input type="email" name="to_email"
|
||||
class="form-control mb-3"
|
||||
placeholder="Adresse email" required>
|
||||
|
||||
<button type="submit" class="btn btn-primary w-100">
|
||||
Envoyer par email
|
||||
</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Sidebar : informations du créateur -->
|
||||
<div class="col-lg-4">
|
||||
<div class="card text-center shadow-sm p-4">
|
||||
|
||||
<img src=".{$objProject->getUser_image()}"
|
||||
class="rounded-circle mb-3 mx-auto"
|
||||
style="width:100px;height:100px;object-fit:cover;">
|
||||
|
||||
<h5>{$objProject->getCreatorName()}</h5>
|
||||
|
||||
<p class="text-muted small">
|
||||
Publié le {$objProject->getCreation_date()}
|
||||
</p>
|
||||
|
||||
<button class="btn btn-primary">Contacter le talent</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
{/block}
|
||||
Loading…
Add table
Add a link
Reference in a new issue