Merge branch 'main' into guillaume

This commit is contained in:
Yass 2026-02-20 16:56:22 +01:00 committed by GitHub
commit 9c19aa5525
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 598 additions and 121 deletions

View file

@ -1,5 +1,5 @@
<footer class="footer container-fluid d-flex justify-content-around">
<footer class="footer container-fluid d-flex justify-content-around mt-auto">
<div class="col-3">
<ul>
<li><a href="#">Découvrir</a>

View file

@ -9,7 +9,7 @@
<script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
<title>Folliow</title>
</head>
<body>
<body class="d-flex flex-column min-vh-100">
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container-fluid">
{* Logo *}
@ -75,7 +75,7 @@
<li class="nav-item">
<a class="nav-link" href="index.php?ctrl=user&action=logout" title="Se déconnecter" aria-label="Se déconnecter">
Logout
Se déconnecter
</a>
</li>
</ul>
@ -84,5 +84,4 @@
</div>
</div>
</nav>
</body>
</html>
{include file="views/_partial/messages.tpl"}

View file

@ -0,0 +1,14 @@
{if ($success_message != '')}
<div class="alert alert-success">
<p>{$success_message}</p>
</div>
{/if}
{if (isset($arrError) && count($arrError) > 0) }
<div class="alert alert-danger">
{foreach $arrError as $strError}
<p>{$strError}</p>
{/foreach}
</div>
{/if}

View file

@ -1,66 +1,84 @@
<article class="col-md-3 mb-5 {if isset($smarty.session.user) and $smarty.session.user.user_status == 2} pb-5 {/if}">
<div class="card h-100 shadow-sm article-card">
<article class="col-md-3 mb-5 {if isset($smarty.session.user) and $smarty.session.user.user_status == 2} pb-5 {/if}" style="border-radius: 100px ;">
<div class="card h-100 shadow article-card rounded-4" style="border-width: 2px; overflow: hidden;">
{* IMAGE (80%) *}
<div class="ratio ratio-16x9">
{* IMAGE (partie supérieure - plus grande) *}
<div class="ratio ratio-4x3">
<img src=".{$objProject->getThumbnail()}"
class="w-100 h-100 object-fit-cover"
alt=""
loading="lazy">
class="w-100 h-100 object-fit-cover"
alt=""
loading="lazy">
</div>
<div class="d-flex align-items-start gap-3">
{* PHOTO DE PROFIL *}
<img src="{$objProject->getUser_image()}"
class="rounded-circle flex-shrink-0 mt-2 ml-5"
style="width: 48px; height: 48px; object-fit: cover;"
alt="Photo de profil">
{* INFOS *}
<div class="flex-grow-1 card-body p-3">
<h3 class="h6 mb-1">{$objProject->getTitle()}</h3>
<small class="text-body-secondary d-block mb-1">
<time>{$objProject->getCreation_date()}</time>
<a href="index.php?ctrl=user&action=user&id={$objProject->getUser_id()}"
class="text-decoration-none"
style="position: relative; z-index: 2;">
{$objProject->getCreatorname()}
</a>
</small>
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
class="stretched-link small">
Lire la suite →
</a>
{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()}"
class="stretched-link small">
Editer
</a>
{/if}
{* CONTENU (photo profil + infos) *}
<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()}"
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">
{* INFOS À DROITE *}
<div class="flex-grow-1">
<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()}"
class="text-decoration-none text-muted"
style="position: relative; z-index: 2;">
{$objProject->getCreatorname()}
</a>
</p>
<p class="small text-muted mb-0">
<i class="bi bi-geo-alt"></i> Colmar
</p>
</div>
</div>
<div class="d-flex justify-content-between align-items-center mt-3">
<small class="text-muted">
<i class="bi bi-clock"></i> <time>{$objProject->getCreation_date()}</time>
</small>
{if $objProject->getStatus() != "refusé"}
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
class="btn btn-sm btn-primary">
Voir →
</a>
{/if}
</div>
</div>
</div>
{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()}"
class="btn btn-sm btn-outline-secondary mt-2 w-100"
style="position: relative; z-index: 2;">
Editer
</a>
{/if}
{/if}
</div>
{* BOUTONS EN BAS *}
{if isset($smarty.session.user)
and $smarty.session.user.user_status == 2
and $objProject->getStatus() == "en_attente"}
<div class="card-footer bg-white border-top-0 p-2">
<div class="d-flex gap-2">
<a class="btn btn-sm btn-success flex-fill"
href="?ctrl=project&action=accept&id={$objProject->getId()}"
name="toPublished">Accepter</a>
<a class="btn btn-sm btn-warning flex-fill"
href="?ctrl=project&action=refuse&id={$objProject->getId()}"
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>
</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>
</div>
{/if}
</div>
{*Controle de l'utilisateur ainsi que du status du projet*}
{if isset($smarty.session.user) and $smarty.session.user.user_status == 2}
<div class="border rounded text-center">
<a class="btn btn-sm m-1 btn-danger" href="?ctrl=project&action=delete&id={$objProject->getId()}" name="toDelete">Supprimer</a>
{/if}
{if isset($smarty.session.user) and $objProject->getStatus() eq "en_attente" and $smarty.session.user.user_status == 2}
<a class="btn btn-sm m-1 btn-success" href="?ctrl=project&action=accept&id={$objProject->getId()}" name="toPublished">Accepter</a>
<a class="btn btn-sm m-1 btn-warning" href="?ctrl=project&action=refuse&id={$objProject->getId()}" name="toRefused">Refuser</a>
</div>
{elseif $projectStatus eq "refusé"}
<p class="text-danger fw-bold">Portfolio refusé</p>
{/if}
</article>

View file

@ -33,7 +33,7 @@
</div>
<div class="col-2">
<button type="submit" name="action" value="update_status" class="btn bg-success text-light"> Valider</button>
<button type="submit" name="action" value="delete_user" class="btn bg-danger text-light">Supprimer l'utilisateur</button>
<button type="submit" name="action" value="delete_user" class="btn bg-danger text-light" onclick="return confirm('Attention ! Êtes-vous sûr de vouloir supprimer cet utilisateur ? Cette action est irréversible.');">Supprimer l'utilisateur</button>
</div>
</form>
</div>

View file

@ -22,12 +22,12 @@
</div>
</section>
<section class="container" aria-label="Articles récents">
<h2 class="visually-hidden">Les 4 derniers articles</h2>
<div class="row mb-2">
{foreach from=$arrProjectToDisplay item=objProject}
{include file="views/_partial/preview.tpl"}
{/foreach}
</section>
<section class="container-fluid" aria-label="Articles récents">
<h2 class="visually-hidden">Les 4 derniers articles</h2>
<div class="row mb-2">
{foreach from=$arrProjectToDisplay item=objProject}
{include file="views/_partial/preview.tpl"}
{/foreach}
</section>
{/block}

View file

@ -20,7 +20,7 @@
class="form-control"
id="keywords"
name="keywords"
placeholder="Ex: JavaScript, CSS..."
placeholder="Design, IA, back-end"
aria-describedby="keywords-help">
<small id="keywords-help" class="form-text text-muted">
Recherchez dans les titres et contenus
@ -44,7 +44,7 @@
<div class="col-6">
<fieldset>
<legend class="form-label">Type de recherche par date</legend>
<legend class="form-label">Recherche par date</legend>
<div class="form-check form-check-inline">
<input
class="form-check-input"
@ -76,7 +76,7 @@
<!-- AJOUT RECHERCHE PAR CATEGORIE -->
<div class="col-6">
<fieldset>
<legend class="form-label">Type de recherche par catégories</legend>
<legend class="form-label">Recherche par catégories</legend>
<div class="col-md-6">
<label for="author" class="form-label">Catégorie</label>
<select class="form-select" id="category" name="category">
@ -135,10 +135,10 @@
<i class="fas fa-search me-2" aria-hidden="true"></i>
Rechercher
</button>
<button type="reset" class="btn btn-secondary ms-2">
<a href="index.php?ctrl=project&action=search" class="btn btn-secondary ms-2">
<i class="fas fa-redo me-2" aria-hidden="true"></i>
Réinitialiser
</button>
</a>
</div>
</div>
</form>

View file

@ -2,24 +2,28 @@
{block name="content"}
<section class="user-profile mb-5">
<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="img-fluid rounded-circle mb-3" style="max-width: 200px">
<img src="{$user->getImage()}" 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">
<h1>{$user->getPseudo()}</h1>
<p class="text-muted">{$user->getMail()}</p>
{if $user->getWork()}
<p>{$user->getWork()}</p>
{/if}
{if $user->getLocation()}
<p>{$user->getLocation()}</p>
{/if}
<p class="mt-3">{$user->getDescription()}</p>
<div class="col-md-8 d-flex align-items-center">
<div>
<h1>{$user->getPseudo()}</h1>
<p class="text-muted">{$user->getMail()}</p>
{if $user->getWork()}
<p>{$user->getWork()}</p>
{/if}
{if $user->getLocation()}
<p>{$user->getLocation()}</p>
{/if}
<p class="mt-3">{$user->getDescription()}</p>
</div>
</div>
</div>
</section>