Merge branch 'laura' of https://github.com/Yasder5/projet_php into laura
This commit is contained in:
commit
c0dd044c57
123 changed files with 2357 additions and 13471 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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 *}
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
</li>
|
||||
{if isset($smarty.session.user)}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="?ctrl=project&action=project">Ajouter un projet</a>
|
||||
<a class="nav-link" href="?ctrl=project&action=addedit_project">Ajouter un projet</a>
|
||||
</li>
|
||||
{if $smarty.session.user.authorisation_name == "Administrateur"}
|
||||
<li class="nav-item">
|
||||
|
|
@ -84,4 +84,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
{include file="views/_partial/messages.tpl"}
|
||||
{include file="views/_partial/messages.tpl"}
|
||||
|
|
|
|||
|
|
@ -1,70 +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 *}
|
||||
<a href="index.php?ctrl=user&action=user&id={$objProject->getUser_id()}"
|
||||
class="text-decoration-none" >
|
||||
<img src="{$objProject->getUser_image()|default:'default_avatar.jpg'}"
|
||||
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" 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>
|
||||
</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
|
||||
and $objProject->getStatus() eq "en_attente"}
|
||||
<div class="border rounded text-center">
|
||||
<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>
|
||||
<a class="btn btn-sm m-1 btn-danger" href="?ctrl=project&action=delete&id={$objProject->getId()}" name="toDelete" onclick="return confirm('Attention ! Êtes-vous sûr de vouloir supprimer ce projet ? Cette action est irréversible.');">
|
||||
Supprimer l'utilisateur>Supprimer</a>
|
||||
</div>
|
||||
{elseif $projectStatus eq "refusé"}
|
||||
<p class="text-danger fw-bold">Portfolio refusé</p>
|
||||
{/if}
|
||||
</article>
|
||||
|
|
|
|||
62
views/addedit_project.tpl
Normal file
62
views/addedit_project.tpl
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{extends file="views/layout.tpl"}
|
||||
|
||||
{block name="content"}
|
||||
<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="title" class="form-control {if (isset($arrError['title'])) } is-invalid {/if} " value="{if $objProject}{$objProject->getTitle()}{/if}" required>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description (courte)</label>
|
||||
<textarea name="description" class="form-control {if (isset($arrError['descProject'])) } is-invalid {/if} " rows="2">{if $objProject}{$objProject->getDescription()}{/if}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Texte complet du Portfolio</label>
|
||||
<textarea name="content" class="form-control {if (isset($arrError['content'])) } is-invalid {/if}" rows="5">{if $objProject}{$objProject->getContent()}{/if}</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 $objProject->getCategory() == 0}selected{/if}>Toutes les catégories</option>
|
||||
{foreach $arrCategory as $arrDetCategory}
|
||||
<option value="{$arrDetCategory['category_id']}"
|
||||
{if $objProject->getCategory() == $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="thumbnail" class="form-control" type="file">
|
||||
{if $objProject && $objProject->getId()}
|
||||
<label class="h5">Miniature actuelle :</label>
|
||||
<img src="uploads/projects/{$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>
|
||||
|
||||
<div class="mt-4">
|
||||
<button type="submit" class="btn btn-primary btn-md" name="sendProject">Envoyer</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}
|
||||
|
|
@ -1,28 +1,28 @@
|
|||
{extends file="views/layout.tpl"}
|
||||
|
||||
{block name="content"}
|
||||
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
||||
<h1 class="logo">Folliow</h1>
|
||||
<h2>Là où les talents rencontrent leur avenir</h2>
|
||||
<p class="col-6">Une plateforme de portfolio adapté à vos besoins et aux besoins des entreprises.
|
||||
Créer un portfolio réellement pertinent aux exigences du marché et rentrez
|
||||
directement en contact avec les entreprises.</p>
|
||||
</section>
|
||||
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
||||
<h1 class="logo">Folliow</h1>
|
||||
<h2>Là où les talents rencontrent leur avenir</h2>
|
||||
<p class="col-6">Une plateforme de portfolio adapté à vos besoins et aux besoins des entreprises.
|
||||
Créer un portfolio réellement pertinent aux exigences du marché et rentrez
|
||||
directement en contact avec les entreprises.</p>
|
||||
</section>
|
||||
|
||||
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
||||
<div class="mb-4">
|
||||
<form method="GET" action="index.php">
|
||||
<input type="hidden" name="ctrl" value="project">
|
||||
<input type="hidden" name="action" value="home">
|
||||
<button type="submit" name="filter_cat" value="1" class="btn btn-primary">Design</button>
|
||||
<button type="submit" name="filter_cat" value="2" class="btn btn-primary">Développement Web</button>
|
||||
<button type="submit" name="filter_old" value="true" class="btn btn-primary">Plus de 6 mois</button>
|
||||
<a href="index.php?ctrl=project&action=home" class="btn btn-primary">Tout</a>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
<section class="container mt-5 p-5 d-flex flex-column align-items-center text-center">
|
||||
<div class="mb-4">
|
||||
<form method="GET" action="index.php">
|
||||
<input type="hidden" name="ctrl" value="project">
|
||||
<input type="hidden" name="action" value="home">
|
||||
<button type="submit" name="filter_cat" value="1" class="btn btn-primary">Design</button>
|
||||
<button type="submit" name="filter_cat" value="2" class="btn btn-primary">Développement Web</button>
|
||||
<button type="submit" name="filter_old" value="true" class="btn btn-primary">Plus de 6 mois</button>
|
||||
<a href="index.php?ctrl=project&action=home" class="btn btn-primary">Tout</a>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="container" aria-label="Articles récents">
|
||||
<section class="container-fluid" aria-label="Articles récents">
|
||||
<h2 class="visually-hidden">Les 4 derniers articles</h2>
|
||||
<div class="row mb-2">
|
||||
|
||||
|
|
|
|||
|
|
@ -1,75 +0,0 @@
|
|||
{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}
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
</p>
|
||||
|
||||
<div class="mb-4 shadow-sm">
|
||||
<img src=".{$objProject->getThumbnail()}"
|
||||
<img src="{$objProject->getThumbnail()}"
|
||||
class="img-fluid rounded w-100">
|
||||
</div>
|
||||
|
||||
|
|
@ -67,13 +67,37 @@
|
|||
|
||||
<p class="text-muted small">
|
||||
Publié le {$objProject->getCreation_date()}
|
||||
|
||||
</p>
|
||||
|
||||
<button class="btn btn-primary">Contacter le talent</button>
|
||||
|
||||
</div>
|
||||
{*Controle de l'utilisateur ainsi que du status du projet + Suppression disponible pour l'utilisateur possédant le projet*}
|
||||
{if isset($smarty.session.user)}
|
||||
{if ($smarty.session.user.user_status == 2 || $smarty.session.user.user_id == $objProject->getUser_id())}
|
||||
<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 le projet</a>
|
||||
{/if}
|
||||
|
||||
|
||||
{if $smarty.session.user.user_id == $objProject->getUser_id()}
|
||||
<a class="btn btn-sm m-1 btn-warning" href="?ctrl=project&action=addedit_project&id={$objProject->getId()}" name="addedit">Modifier le projet</a>
|
||||
{/if}
|
||||
|
||||
{*Conditions permettant au Modérateur de modifier le status d'un projet*}
|
||||
{if $smarty.session.user.user_status == 2 && $objProject->getStatus() == "en_attente"}
|
||||
<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 == "refusé"}
|
||||
<p class="text-danger fw-bold">Portfolio refusé</p>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</main>
|
||||
{/block}
|
||||
|
|
@ -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()|default:'assests/img/default_avatar.jpg'}" 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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue