Ajout de la page user fonctionnelle (ctrl, model associé etc) update des liens en display pour fonctionnement. Correction nom fichier project_display
This commit is contained in:
parent
48108f717f
commit
f4d5669e44
16 changed files with 471 additions and 364 deletions
|
|
@ -26,13 +26,24 @@
|
|||
|
||||
<small class="text-body-secondary d-block mb-1">
|
||||
<time>{$objProject->getCreation_date()}</time>
|
||||
– {$objProject->getCreatorname()}
|
||||
–
|
||||
<a href="index.php?ctrl=user&action=user&id={$objProject->getUser()}"
|
||||
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 →
|
||||
class="stretched-link small">
|
||||
Lire la suite →
|
||||
</a>
|
||||
{if $smarty.session.user.user_id == $objProject->getUser()}
|
||||
<a href="index.php?ctrl=project&action=display&id={$objProject->getId()}"
|
||||
class="stretched-link small">
|
||||
Editer
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
227
views/admin.tpl
227
views/admin.tpl
|
|
@ -2,164 +2,89 @@
|
|||
|
||||
{block name="content"}
|
||||
|
||||
<section class="sb-nav-fixed">
|
||||
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
|
||||
|
||||
<a class="navbar-brand ps-3" href="index.php?ctrl=project&action=home"><img src="assests/img/Logo-Wordmark.svg" alt="Logo du site" width="150px"></a>
|
||||
<button class="btn btn-link btn-sm order-1 order-lg-0 me-4 me-lg-0" id="sidebarToggle" href="#!"><i class="fas fa-bars"></i></button>
|
||||
<form class="d-none d-md-inline-block form-inline ms-auto me-0 me-md-3 my-2 my-md-0">
|
||||
<div class="input-group">
|
||||
<input class="form-control" type="text" placeholder="Recherche par pseudo..." aria-label="Recherche pseudo" aria-describedby="btnNavbarSearch" />
|
||||
<button class="btn btn-primary" id="btnNavbarSearch" type="button"><i class="fas fa-search"></i></button>
|
||||
<section>
|
||||
<div id="layoutSidenav_content">
|
||||
<div class="container-fluid px-4">
|
||||
<h1 class="mt-4">Dashboard</h1>
|
||||
<div class="container-fluid px-4">
|
||||
<!-- USER MODIF -->
|
||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
||||
<div class="container-fluid pt-2">
|
||||
<h2>Gestion de l'utilsateur</h2>
|
||||
<p>Changer le statut ou supprimer un utilisateur</p>
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
<img src="./assests/img/Logo-Wordmark.svg" alt="" width="100">
|
||||
</div>
|
||||
<form method="POST">
|
||||
<div class="col-6">
|
||||
<select class="form-select" aria-label="Default select example" name="user_id">
|
||||
<option value="0">Choisir un utilisateur</option>
|
||||
{foreach from=$arrUserToDisplay item=user}
|
||||
<option value="{$user->getId()}">{$user->getName()} {$user->getFirstname()}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<select class="form-select" aria-label="Default select example" name="new_status">
|
||||
<option value="0" selected>Modifier le statut de l'Utilisateur...</option>
|
||||
{foreach from=$arrAuthorisationToDisplay item=arrDetAuthorisation}
|
||||
<option value="{$arrDetAuthorisation->getId()}">{$arrDetAuthorisation->getName()}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Navbar - User-->
|
||||
<ul class="navbar-nav ms-auto ms-md-0 me-3 me-lg-4">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="fas fa-user fa-fw"></i></a>
|
||||
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||
<li><a class="dropdown-item" href="/option.php">Paramètre</a></li>
|
||||
<li><hr class="dropdown-divider" /></li>
|
||||
<li><a class="dropdown-item" href="/deconnexion.php">Déconnexion</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<!-- SideNav Infos -->
|
||||
<div id="layoutSidenav">
|
||||
<div id="layoutSidenav_nav">
|
||||
<nav class="sb-sidenav accordion sb-sidenav-dark" id="sidenavAccordion">
|
||||
<div class="sb-sidenav-menu">
|
||||
<div class="nav">
|
||||
<div class="sb-sidenav-menu-heading"></div>
|
||||
<a class="nav-link" href="index.html">
|
||||
<div class="sb-nav-link-icon"><i class="fas fa-tachometer-alt"></i></div>
|
||||
Rafraichir la page
|
||||
</a>
|
||||
<div class="sb-sidenav-menu-heading"></div>
|
||||
<div class="collapse" id="collapseLayouts" aria-labelledby="headingOne" data-bs-parent="#sidenavAccordion">
|
||||
</div>
|
||||
|
||||
<form action="post">
|
||||
<div class="container-fluid ps-2">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<label for="checkbox1">Par date</label>
|
||||
</div>
|
||||
<div class="col-6 text-center">
|
||||
<input type="checkbox" name="search_date" id="">
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label for="checkbox2">Par date de creation de compte</label>
|
||||
</div>
|
||||
<div class="col-6 text-center">
|
||||
<input type="checkbox" name="search_creationdate" id="">
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<label for="checkbox3">Recherche par date</label>
|
||||
</div>
|
||||
<div class="col-6 text-center">
|
||||
<input type="checkbox" name="search_date" id="">
|
||||
</div>
|
||||
<div class="col-12 text-center">
|
||||
<button type="submit" class="btn mt-3 bg-primary text-light">Recherche</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sb-sidenav-footer">
|
||||
<div class="small">Connecté avec le compte : {$smarty.session.user.user_name} {$smarty.session.user.user_firstname}</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div id="layoutSidenav_content">
|
||||
<main>
|
||||
<div class="container-fluid px-4">
|
||||
<h1 class="mt-4">Dashboard</h1>
|
||||
<div class="container-fluid px-4">
|
||||
<!-- USER MODIF -->
|
||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
||||
<div class="container-fluid pt-2">
|
||||
<h2>Gestion de l'utilsateur</h2>
|
||||
<p>Changer le statut ou supprimer un utilisateur</p>
|
||||
<div class="row">
|
||||
<!-- catégorie modif -->
|
||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
||||
<div class="container-fluid pt-2">
|
||||
<h2>Gestion des catégories</h2>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<form method="post">
|
||||
<p>Modifier une catégorie existante</p>
|
||||
<select class="form-select" aria-label="Default select example" name="id_to_edit">
|
||||
<option value="0">Choix de la catégorie</option>
|
||||
{foreach from=$arrCategoryToDisplay item=category}
|
||||
<option value="{$category->getId()}">{$category->getName()}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<br>
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" class="form-control" id="floatingInput" name="new_name">
|
||||
<label for="floatingInput">Nouveau nom de la catégorie</label>
|
||||
</div>
|
||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||
</form>
|
||||
<div>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="row">
|
||||
<!-- creation cat-->
|
||||
<div class="col-6">
|
||||
<form method="POST">
|
||||
<p>Créer une nouvelle catégorie</p>
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
||||
<label for="floatingInput">Nom de la nouvelle catégorie</label>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<img src="./assests/img/Logo-Wordmark.svg" alt="" width="100">
|
||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||
</div>
|
||||
<form method="POST">
|
||||
<div class="col-6">
|
||||
<select class="form-select" aria-label="Default select example" name="user_id">
|
||||
<option value="0">Choisir un utilisateur</option>
|
||||
{foreach from=$arrUserToDisplay item=user}
|
||||
<option value="{$user->getId()}">{$user->getName()} {$user->getFirstname()}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<select class="form-select" aria-label="Default select example" name="new_status">
|
||||
<option value="0" selected>Modifier le statut de l'Utilisateur...</option>
|
||||
{foreach from=$arrAuthorisationToDisplay item=arrDetAuthorisation}
|
||||
<option value="{$arrDetAuthorisation->getId()}">{$arrDetAuthorisation->getName()}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- catégorie modif -->
|
||||
<div class="p-3 mt-2 text-primary-emphasis bg-primary-subtle border border-primary-subtle rounded-3">
|
||||
<div class="container-fluid pt-2">
|
||||
<h2>Gestion des catégories</h2>
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<form method="post">
|
||||
<p>Modifier une catégorie existante</p>
|
||||
<select class="form-select" aria-label="Default select example" name="id_to_edit">
|
||||
<option value="0">Choix de la catégorie</option>
|
||||
{foreach from=$arrCategoryToDisplay item=category}
|
||||
<option value="{$category->getId()}">{$category->getName()}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<br>
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" class="form-control" id="floatingInput" name="new_name">
|
||||
<label for="floatingInput">Nouveau nom de la catégorie</label>
|
||||
</div>
|
||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||
</form>
|
||||
<div>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="row">
|
||||
<!-- creation cat-->
|
||||
<div class="col-6">
|
||||
<form method="POST">
|
||||
<p>Créer une nouvelle catégorie</p>
|
||||
<div class="form-floating mb-3">
|
||||
<input type="text" class="form-control" id="floatingInput" name="new_category">
|
||||
<label for="floatingInput">Nom de la nouvelle catégorie</label>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<button type="submit" class="btn bg-success text-light rounded-circle"> ✓</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="small">Connecté avec le compte : {$smarty.session.user.user_name} {$smarty.session.user.user_firstname}
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
|
|
@ -58,11 +58,11 @@
|
|||
<!-- 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;">
|
||||
|
||||
<a href="index.php?ctrl=user&action=user&id={$objProject->getUser()}" class="text-decoration-none text-dark">
|
||||
<img src=".{$objProject->getUser_image()}"
|
||||
class="rounded-circle mb-3 mx-auto"
|
||||
style="width:100px;height:100px;object-fit:cover;">
|
||||
</a>
|
||||
<h5>{$objProject->getCreatorName()}</h5>
|
||||
|
||||
<p class="text-muted small">
|
||||
43
views/user.tpl
Normal file
43
views/user.tpl
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{extends file="views/layout.tpl"}
|
||||
|
||||
{block name="content"}
|
||||
|
||||
<section class="user-profile mb-5">
|
||||
<div class="row">
|
||||
<div class="col-md-4 text-center">
|
||||
<img src="" alt="Avatar de {$user->getPseudo()}" class="img-fluid rounded-circle mb-3" style="max-width: 200px">
|
||||
</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>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2 class="mb-4 border-bottom pb-2">Les projets de {$user->getPseudo()}</h2>
|
||||
|
||||
<div class="row">
|
||||
{if count($arrProjectToDisplay) > 0}
|
||||
{foreach $arrProjectToDisplay as $objProject}
|
||||
<div class="col-md-4 mb-4">
|
||||
{include file="views/_partial/preview.tpl"}
|
||||
</div>
|
||||
{/foreach}
|
||||
{else}
|
||||
<p class="alert alert-info">Cet utilisateur n'a pas encore publié de projets.</p>
|
||||
{/if}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/block}
|
||||
Loading…
Add table
Add a link
Reference in a new issue