Merge branch 'main' into besnik
This commit is contained in:
commit
0a09ed66fc
142 changed files with 12054 additions and 543 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{* IMAGE (partie supérieure - plus grande) *}
|
||||
<div class="ratio ratio-4x3">
|
||||
<img src=".{$objProject->getThumbnail()}"
|
||||
<img src="{$smarty.env.IMG_PROJECT_PATH}{$objProject->getThumbnail()}"
|
||||
class="w-100 h-100 object-fit-cover"
|
||||
alt=""
|
||||
loading="lazy">
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<div class="card-body p-3 bg-light">
|
||||
<div class="d-flex align-items-start gap-3">
|
||||
{* PHOTO DE PROFIL (cercle à gauche - plus grand) *}
|
||||
<img src="{$objProject->getUser_image()}"
|
||||
<img src="{$smarty.env.IMG_USER_PATH}{$objProject->getUser_image() ?? "images.jpg"}"
|
||||
class="rounded-circle flex-shrink-0 border border-2 border-white"
|
||||
style="width: 64px; height: 64px; object-fit: cover; margin-top: 8px;"
|
||||
alt="Photo de profil">
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<h3 class="h6 fw-bold mb-2 mt-1">{$objProject->getTitle()}</h3>
|
||||
<p class="small text-muted mb-1">
|
||||
<i class="bi bi-person"></i>
|
||||
<a href="index.php?ctrl=user&action=user&id={$objProject->getUser_id()}"
|
||||
<a href="index.php?ctrl=user&action=user&pseudo={$objProject->getCreatorname()}"
|
||||
class="text-decoration-none text-muted"
|
||||
style="position: relative; z-index: 2;">
|
||||
{$objProject->getCreatorname()}
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
{if isset($smarty.session.user)}
|
||||
{if $smarty.session.user.user_id == $objProject->getUser_id()}
|
||||
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
|
||||
<a href="index.php?ctrl=project&action=addedit_project&id={$objProject->getId()}"
|
||||
class="btn btn-sm btn-outline-secondary mt-2 w-100"
|
||||
style="position: relative; z-index: 2;">
|
||||
Editer
|
||||
|
|
@ -72,12 +72,12 @@
|
|||
name="toRefused">Refuser</a>
|
||||
<a class="btn btn-sm btn-danger flex-fill"
|
||||
href="?ctrl=project&action=delete&id={$objProject->getId()}"
|
||||
name="toDelete">Supprimer</a>
|
||||
name="toDelete" onclick="return confirm('Attention ! Êtes-vous sûr de vouloir supprimer ce projet ? Cette action est irréversible.');">Supprimer</a>
|
||||
</div>
|
||||
</div>
|
||||
{elseif $objProject->getStatus() == "refusé"}
|
||||
<div class="card-footer bg-white border-top-0 p-2">
|
||||
<p class="text-danger fw-bold text-center mb-0 small">Portfolio refusé</p>
|
||||
<p class="text-danger fw-bold text-center mb-0 small">Projet refusé</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -40,14 +40,56 @@
|
|||
<input name="thumbnail" class="form-control" type="file">
|
||||
{if $objProject && $objProject->getId()}
|
||||
<label class="h5">Miniature actuelle :</label>
|
||||
<img src="uploads/projects/{$objProject->getThumbnail()}" alt="Miniature">
|
||||
<img src="{$smarty.env.IMG_PROJECT_PATH}{$objProject->getThumbnail()}" alt="Miniature">
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="h5">Images de votre projet</label>
|
||||
<input name="imageProject" class="form-control" type="file" multiple>
|
||||
</div>
|
||||
<label class="form-label h5">Galerie de photos (Max 20)</label>
|
||||
{assign var="nbActuel" value=$arrImages|@count}
|
||||
{assign var="disponible" value=20 - $nbActuel}
|
||||
|
||||
{if $disponible > 0}
|
||||
<p class="small text-muted">Il vous reste <strong>{$disponible}</strong> emplacement(s) libre(s).</p>
|
||||
<input type="file" name="imageProject[]" multiple class="form-control" accept="image/*">
|
||||
{else}
|
||||
<div class="alert alert-warning p-2">
|
||||
<i class="fas fa-exclamation-triangle"></i> Quota de 20 photos atteint.
|
||||
</div>
|
||||
{* On désactive l'input si le quota est plein *}
|
||||
<input type="file" disabled class="form-control">
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{* Affichage de Images du projet (s'il y en a)*}
|
||||
<div class="row mt-4">
|
||||
<label class="h5">Galerie du projet</label>
|
||||
{foreach $arrImages as $image}
|
||||
<div class="col-md-3 mb-3 text-center">
|
||||
<div class="card shadow-sm h-100 border-{if $image.image_status == 'approuvé'}success{elseif $image.image_status == 'refusé'}danger{else}warning{/if}">
|
||||
<img src="{$smarty.env.IMG_PROJECT_PATH}{$image.image_name}"
|
||||
class="card-img-top img-thumbnail"
|
||||
alt="{$image.image_alt}"
|
||||
style="height: 150px; object-fit: cover;">
|
||||
|
||||
<div class="card-body p-2">
|
||||
<span class="badge {if $image.image_status == 'approuvé'}bg-success{elseif $image.image_status == 'refusé'}bg-danger{else}bg-warning text-dark{/if}">
|
||||
{*Permet de remplacer certains character par d'autre*}
|
||||
{$image.image_status|replace:'_':' '}
|
||||
</span>
|
||||
|
||||
<div class="mt-2 d-flex flex-column gap-1">
|
||||
<a href="index.php?ctrl=project&action=delete_image&id_img={$image.image_id}"
|
||||
class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('Supprimer définitivement cette image ?')">Supprimer</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{foreachelse}
|
||||
<p class="text-muted italic">Aucune photo dans la galerie pour le moment.</p>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<button type="submit" class="btn btn-primary btn-md" name="sendProject">Envoyer</button>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
<p>Bonjour,</p>
|
||||
|
||||
<p>
|
||||
Un projet a été partagé avec vous via la plateforme <strong>Folliow</strong>.
|
||||
</p>
|
||||
|
||||
<h3>{$projectTitle}</h3>
|
||||
|
||||
<p>
|
||||
{$projectDescription}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Vous pouvez consulter le projet en cliquant sur le lien ci-dessous :
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="{$projectUrl}">
|
||||
{$projectUrl}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Cordialement,<br>
|
||||
L’équipe Folliow
|
||||
</p>
|
||||
<p>Bonjour,</p>
|
||||
|
||||
<p>
|
||||
Un projet a été partagé avec vous via la plateforme <strong>Folliow</strong>.
|
||||
</p>
|
||||
|
||||
<h3>{$projectTitle}</h3>
|
||||
|
||||
<p>
|
||||
{$projectDescription}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Vous pouvez consulter le projet en cliquant sur le lien ci-dessous :
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<a href="{$projectUrl}">
|
||||
{$projectUrl}
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Cordialement,<br>
|
||||
L’équipe Folliow
|
||||
</p>
|
||||
|
|
|
|||
75
views/project.tpl
Normal file
75
views/project.tpl
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{extends file="views/layout.tpl"}
|
||||
|
||||
{block name="content"}
|
||||
<body>
|
||||
<section class="container mt-5 p-5 d-flex flex-column align-items-center">
|
||||
<div>
|
||||
<h2>Alimenter votre projet</h2>
|
||||
<form method="post">
|
||||
<button type="submit" class="btn btn-primary btn-lg" name="showForm">+</button>
|
||||
{if isset($smarty.post.toContinue)}
|
||||
<button type="submit" class="btn btn-warning btn-lg" name="showFormContinue">Reprendre</button>
|
||||
{/if}
|
||||
</form>
|
||||
|
||||
{* 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 ?')">
|
||||
<div>
|
||||
<label>Titre</label>
|
||||
<input type="text" name="titleProject">
|
||||
</div>
|
||||
<div>
|
||||
<label>Description</label>
|
||||
<input type="text" name="descProject">
|
||||
</div>
|
||||
<div>
|
||||
<label>Texte Portfolio</label>
|
||||
<input type="text" name="textProject">
|
||||
</div>
|
||||
<div>
|
||||
<h3>Image thumbnail</h3>
|
||||
<input name="imageThumbnail" class="form-control" type="file">
|
||||
</div>
|
||||
<div>
|
||||
<h3>Image du projet</h3>
|
||||
<input name="imageProject" class="form-control" type="file">
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<button type="submit" class="btn btn-primary btn-md" name="sendMessage">Envoyer</button>
|
||||
<button type="submit" class="btn btn-warning btn-md" name="toContinue">Remettre à plus tard</button>
|
||||
</div>
|
||||
</form>
|
||||
{else}
|
||||
<div class="border rounded mt-5">
|
||||
<p class="text-danger p-2">Vous devez vous connecter pour accéder à cette fonctionnalité</p>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<h3>Description</h3>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
||||
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Photos behind the scene</h3>
|
||||
<div class="row mb-2">
|
||||
<img>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h3>Other projects</h3>
|
||||
<div class="row mb-2">
|
||||
{foreach $arrProjectToDisplay as $objProject}
|
||||
{include file="../app/views/partials/preview.tpl"}
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<section>
|
||||
</body>
|
||||
{/block}
|
||||
|
|
@ -111,8 +111,9 @@
|
|||
<p class="text-danger fw-bold">Portfolio refusé</p>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
{/block}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
<section class="user-profile mb-5 mt-5/*vh /*">
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-center">
|
||||
<img src="{$user->getImage()}" alt="Avatar de {$user->getPseudo()}" class="rounded-circle flex-shrink-0 border border-2 border-white"
|
||||
<img src="{$smarty.env.IMG_USER_PATH}{$user->getImage() ?? "images.jpg"}" alt="Avatar de {$user->getPseudo()}" class="rounded-circle flex-shrink-0 border border-2 border-white"
|
||||
style="width: 256px; height: 256px; object-fit: cover; margin-top: 8px;"
|
||||
>
|
||||
</div>
|
||||
<div class="col-md-8 d-flex align-items-center">
|
||||
<div class="col-md-8 align-items-center p-0">
|
||||
<div>
|
||||
<h1>{$user->getPseudo()}</h1>
|
||||
<p class="text-muted">{$user->getMail()}</p>
|
||||
|
|
@ -23,7 +23,12 @@
|
|||
{/if}
|
||||
|
||||
<p class="mt-3">{$user->getDescription()}</p>
|
||||
{if $smarty.session.user.user_id == $user->getId()}
|
||||
<a class="btn btn-sm btn-primary flex-fill"
|
||||
href="?ctrl=user&action=edit">Edit account</a>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -31,13 +36,15 @@
|
|||
<section>
|
||||
<h2 class="mb-4 border-bottom pb-2">Les projets de {$user->getPseudo()}</h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="row m-0">
|
||||
{if count($arrProjectToDisplay) > 0}
|
||||
{foreach $arrProjectToDisplay as $objProject}
|
||||
{include file="views/_partial/preview.tpl"}
|
||||
{/foreach}
|
||||
{else}
|
||||
<p class="alert alert-info">Cet utilisateur n'a pas encore publié de projets.</p>
|
||||
<div class="col-12">
|
||||
<p class="col-12 alert alert-info">Cet utilisateur n'a pas encore publié de projets.</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
179
views/useredit.tpl
Normal file
179
views/useredit.tpl
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
{extends file="views/layout.tpl"}
|
||||
|
||||
{block name="content"}
|
||||
<!-- Page : Inscription -->
|
||||
|
||||
|
||||
<main class="container py-5">
|
||||
|
||||
<!-- Centrage horizontal du formulaire -->
|
||||
<div class="row justify-content-center position-relative">
|
||||
<div class="col-12 col-md-10 col-lg-6">
|
||||
|
||||
<!-- Carte contenant le formulaire d'inscription -->
|
||||
<div class="card shadow-sm border-0 rounded-4 p-4 p-lg-5">
|
||||
|
||||
<!-- Titre principal de la page -->
|
||||
<h1 class="h3 fw-bold mb-1">Edit du profile</h1>
|
||||
|
||||
{if (isset($arrError) && count($arrError) > 0) }
|
||||
<div class="alert alert-danger">
|
||||
{foreach $arrError as $strError}
|
||||
<p>{$strError}</p>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
<!-- Formulaire d'inscription -->
|
||||
<!-- Les données seront traitées côté serveur en PHP via la méthode POST -->
|
||||
<form method="POST" enctype="multipart/form-data">
|
||||
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label" for="user_firstname">
|
||||
Prénom
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_firstname"
|
||||
name="user_firstname"
|
||||
value="{$objUser->getFirstname()}"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<label class="form-label" for="user_name">
|
||||
Nom
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_name"
|
||||
name="user_name"
|
||||
value="{$objUser->getName()}"
|
||||
|
||||
>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_pseudo">
|
||||
Pseudo
|
||||
</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">@</span>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_pseudo"
|
||||
name="user_pseudo"
|
||||
value="{$objUser->getPseudo()}"
|
||||
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="image">
|
||||
Photo de profil
|
||||
</label>
|
||||
{if $objUser->getImage()}
|
||||
<div class="mb-2">
|
||||
<img src="{$smarty.env.IMG_USER_PATH}{$objUser->getImage()}" alt="image actuel" class="rounded-circle" width="80" height="80">
|
||||
</div>
|
||||
{/if}
|
||||
<input
|
||||
class="form-control"
|
||||
type="file"
|
||||
id="image"
|
||||
name="image"
|
||||
accept="image/jpeg, image/png, image/webp"
|
||||
>
|
||||
<div class="form-text">Formats acceptés : JPG, PNG, WEBP. Laisser vide pour ne pas changer.</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_mail">
|
||||
Adresse e-mail
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="email"
|
||||
id="user_mail"
|
||||
name="user_mail"
|
||||
value="{$objUser->getMail()}"
|
||||
|
||||
>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_phone">
|
||||
Téléphone
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_phone"
|
||||
name="user_phone"
|
||||
value="{$objUser->getPhone()}"
|
||||
>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_work">
|
||||
Profession
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_work"
|
||||
name="user_work"
|
||||
value="{$objUser->getWork()}"
|
||||
>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_location">
|
||||
Localisation
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
type="text"
|
||||
id="user_location"
|
||||
name="user_location"
|
||||
value="{$objUser->getLocation()}"
|
||||
>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12">
|
||||
<label class="form-label" for="user_description">
|
||||
Phrase d'accroche
|
||||
</label>
|
||||
<textarea
|
||||
class="form-control"
|
||||
id="user_description"
|
||||
name="user_description"
|
||||
rows="3"
|
||||
>
|
||||
{$objUser->getDescription()}
|
||||
</textarea>
|
||||
</div>
|
||||
<div class="col-12 d-grid mt-2">
|
||||
<button type="submit" class="btn btn-primary btn-lg rounded-3">
|
||||
Edit profile
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
{/block}
|
||||
Loading…
Add table
Add a link
Reference in a new issue