Skip to content
Snippets Groups Projects
Commit 54abf1c8 authored by Thibaut Vallee's avatar Thibaut Vallee
Browse files

hormanisation mise en page des libs Laminas/BS-5

parent 0a4bf596
Branches
Tags 5.0.0
No related merge requests found
Pipeline #15558 passed
...@@ -9,6 +9,6 @@ class IndexController extends AbstractActionController { ...@@ -9,6 +9,6 @@ class IndexController extends AbstractActionController {
public function indexAction() public function indexAction()
{ {
return new ViewModel(); return new ViewModel(['title' => 'Gestion des contenus']);
} }
} }
\ No newline at end of file
...@@ -28,6 +28,7 @@ class MacroController extends AbstractActionController { ...@@ -28,6 +28,7 @@ class MacroController extends AbstractActionController {
} }
return new ViewModel([ return new ViewModel([
'title' => 'Gestion des macros',
'macros' => $macros, 'macros' => $macros,
'variables' => $variables, 'variables' => $variables,
'variable' => $variable, 'variable' => $variable,
......
...@@ -15,6 +15,7 @@ class RenduController extends AbstractActionController { ...@@ -15,6 +15,7 @@ class RenduController extends AbstractActionController {
$rendus = $this->getRenduService()->getRendus(); $rendus = $this->getRenduService()->getRendus();
return new ViewModel([ return new ViewModel([
'title' => 'Gestions des rendus',
'rendus' => $rendus, 'rendus' => $rendus,
]); ]);
} }
......
...@@ -20,6 +20,7 @@ class TemplateController extends AbstractActionController { ...@@ -20,6 +20,7 @@ class TemplateController extends AbstractActionController {
$templates = $this->getTemplateService()->getTemplates(); $templates = $this->getTemplateService()->getTemplates();
return new ViewModel([ return new ViewModel([
'title' => 'Gestion des templates',
'templates' => $templates, 'templates' => $templates,
]); ]);
} }
......
...@@ -8,7 +8,7 @@ use UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges; ...@@ -8,7 +8,7 @@ use UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges;
* @see \UnicaenRenderer\Controller\IndexController::indexAction() * @see \UnicaenRenderer\Controller\IndexController::indexAction()
*/ */
$this->headTitle("Index des modules de gestion des contenus"); $this->headTitle($title);
$canRendu = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(DocumentcontenuPrivileges::DOCUMENTCONTENU_INDEX)); $canRendu = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(DocumentcontenuPrivileges::DOCUMENTCONTENU_INDEX));
$canMacro = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_INDEX)); $canMacro = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_INDEX));
...@@ -17,58 +17,73 @@ $canTemplate = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(Docume ...@@ -17,58 +17,73 @@ $canTemplate = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(Docume
?> ?>
<h1 class="page-header"> <h1 class="page-header">
Index du module de gestion des contenus <?= $title ?>
</h1> </h1>
<?php if ($canMacro) : ?>
<h2> Gestion des macros </h2>
<div class="row"> <div class="row row-cols-1 row-cols-md-3 g-4">
<div class="col-md-8"> <?php if ($canRendu) : ?>
<p> <div class="col">
Listing des macros et modification de celles-ci. <div class="card border-default h-100 m-1">
<div class="card-header bg-default">
<h2> Rendus </h2>
</div>
<div class="card-body">
<p class="card-text">
Ensemble de documents générés automatiquement par l'application
</p> </p>
</div> </div>
<div class="pull-right"> <div class="card-footer">
<a href="<?php echo $this->url('contenu/macro'); ?>" class="btn btn-primary action"> <a href="<?php echo $this->url('contenu/rendu'); ?>" class="btn btn-primary action">
<span class="icon index"></span> <span class="icon tag"></span>
Gestion des macros Gérer les rendus
</a> </a>
</div> </div>
</div> </div>
</div>
<?php endif; ?> <?php endif; ?>
<?php if ($canTemplate) : ?> <?php if ($canMacro) : ?>
<h2> Gestion des templates </h2> <div class="col">
<div class="card border-default h-100 m-1">
<div class="row"> <div class="card-header bg-default">
<div class="col-md-8"> <h2> Macros </h2>
<p> </div>
Listing des templates et modification de ceux-ci. <div class="card-body">
<p class="card-text">
Ensemble de mots-clés qui seront substituer dans le texte lors de la génération des rendus
</p> </p>
</div> </div>
<div class="pull-right"> <div class="card-footer">
<a href="<?php echo $this->url('contenu/template'); ?>" class="btn btn-primary action"> <a href="<?php echo $this->url('contenu/macro'); ?>" class="btn btn-primary action">
<span class="icon index"></span> <span class="icon tag"></span>
Gestion des templates Gérer les macros
</a> </a>
</div> </div>
</div> </div>
</div>
<?php endif; ?> <?php endif; ?>
<?php if ($canRendu) : ?> <?php if ($canTemplate) : ?>
<h2> Gestion des rendus </h2> <div class="col">
<div class="row">
<div class="col-md-8"> <div class="card border-default h-100 m-1">
<p> <div class="card-header bg-default">
Listing des rendus. <h2> Templates </h2>
</div>
<div class="card-body">
<p class="card-text">
Textes pré-formatés servant de modéle à la génération des documents
</p> </p>
</div> </div>
<div class="pull-right"> <div class="card-footer">
<a href="<?php echo $this->url('contenu/rendu'); ?>" class="btn btn-primary action"> <a href="<?php echo $this->url('contenu/template'); ?>" class="btn btn-primary action">
<span class="icon index"></span> <span class="icon tag"></span>
Gestion des rendus Gérer les templates
</a> </a>
</div> </div>
</div> </div>
</div>
<?php endif; ?> <?php endif; ?>
</div>
...@@ -8,42 +8,72 @@ ...@@ -8,42 +8,72 @@
*/ */
use UnicaenRenderer\Entity\Db\Macro; use UnicaenRenderer\Entity\Db\Macro;
use UnicaenRenderer\Provider\Privilege\DocumentcontenuPrivileges;
use UnicaenRenderer\Provider\Privilege\DocumentmacroPrivileges; use UnicaenRenderer\Provider\Privilege\DocumentmacroPrivileges;
use UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges;
$canRendu = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(DocumentcontenuPrivileges::DOCUMENTCONTENU_INDEX));
$canTemplate = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_INDEX));
$canAjouter = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_AJOUTER)); $canAjouter = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_AJOUTER));
$canModifier = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_MODIFIER)); $canModifier = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_MODIFIER));
$canHistoriser = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_HISTORISER)); $canHistoriser = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_HISTORISER));
$canSupprimer = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_SUPPRIMER)); $canSupprimer = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_SUPPRIMER));
$this->headTitle("Index des macros"); $this->headTitle($title);
?> ?>
<h1 class="page-header"> <h1 class="page-header">
Index des macros <?= $title ?>
</h1> </h1>
<div class="main">
<?php echo $this->partial('partial/filtre', ['variables' => $variables, 'params' => ['variable' => $variable]]); ?>
<div class="row mb-3">
<div class="col-md-12">
<?php if ($canRendu) : ?>
<a href="<?php echo $this->url('contenu/rendu'); ?>" class="btn btn-primary action">
<span class="icon tag"></span>
Gérer les rendus
</a>
<?php endif; ?>
<?php if ($canTemplate) : ?>
<a href="<?php echo $this->url('contenu/template'); ?>" class="btn btn-primary action">
<span class="icon tag"></span>
Gérer les templates
</a>
<?php endif; ?>
<?php if ($canAjouter) : ?> <?php if ($canAjouter) : ?>
<a href="<?php echo $this->url('contenu/macro/ajouter', [], [], true); ?>" class="btn btn-primary action ajax-modal" data-event="modification"> <a href="<?php echo $this->url('contenu/macro/ajouter', [], [], true); ?>"
class="btn btn-primary action ajax-modal" data-event="modification">
<span class="icon ajouter"></span> <span class="icon ajouter"></span>
Ajouter une macro Ajouter une macro
</a> </a>
<?php endif; ?> <?php endif; ?>
<a href="<?php echo $this->url('contenu/macro/generer-json', [], [], true); ?>" class="btn btn-primary action ajax-modal"> <a href="<?php echo $this->url('contenu/macro/generer-json', [], [], true); ?>"
class="btn btn-primary action ajax-modal">
<span class="icon code"></span> <span class="icon code"></span>
Générer le JSON des macros Générer le JSON des macros
</a> </a>
</div>
</div>
<?php echo $this->partial('partial/filtre', ['variables' => $variables, 'params' => ['variable' => $variable]]); ?>
<div class="card border-default mb-3">
<div class="card-header bg-default">
<h2>Liste des macros</h2>
</div>
<div class="card-body">
<table id='macro-liste' class="table table-condensed table-hover"> <table id='macro-liste' class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th> Code </th> <th class="col-md-2"> Code</th>
<th> Variable </th> <th class="col-md"> Variable</th>
<th> Méthode </th> <th class="col-md"> Méthode</th>
<th> Action </th> <th class="col-md-1 text-end"> Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -52,7 +82,8 @@ $this->headTitle("Index des macros"); ...@@ -52,7 +82,8 @@ $this->headTitle("Index des macros");
<td> <td>
<?php echo $macro->getCode(); ?> <?php echo $macro->getCode(); ?>
<?php if ($macro->getDescription() !== null) : ?> <?php if ($macro->getDescription() !== null) : ?>
<span class="icon information" data-toggle="tooltip" data-html="true" title="<?php echo $macro->getDescription(); ?>"></span> <span class="icon information" data-toggle="tooltip" data-html="true"
title="<?php echo $macro->getDescription(); ?>"></span>
<?php endif; ?> <?php endif; ?>
</td> </td>
<td> <td>
...@@ -61,7 +92,7 @@ $this->headTitle("Index des macros"); ...@@ -61,7 +92,7 @@ $this->headTitle("Index des macros");
<td> <td>
<?php echo $macro->getMethode(); ?> <?php echo $macro->getMethode(); ?>
</td> </td>
<td> <td class="text-end">
<?php if ($canModifier) : ?> <?php if ($canModifier) : ?>
<a href="<?php echo $this->url('contenu/macro/modifier', ['macro' => $macro->getId()], [], true); ?>" <a href="<?php echo $this->url('contenu/macro/modifier', ['macro' => $macro->getId()], [], true); ?>"
class="ajax-modal" data-event="modification" data-toggle="tooltip" data-html="true" class="ajax-modal" data-event="modification" data-toggle="tooltip" data-html="true"
...@@ -82,6 +113,8 @@ $this->headTitle("Index des macros"); ...@@ -82,6 +113,8 @@ $this->headTitle("Index des macros");
</tbody> </tbody>
</table> </table>
</div> </div>
</div>
<script> <script>
$(function () { $(function () {
......
...@@ -8,11 +8,12 @@ ...@@ -8,11 +8,12 @@
?> ?>
<div class="panel panel-default"> <div class="card border-default mb-3">
<div class="panel-heading"> <div class="card-header bg-default">
<h2>Filtrer les macros</h2> <h2>Filtrer les macros</h2>
</div> </div>
<div class="panel-body">
<div class="card-body">
<form method="get" id="filtre" action="<?php echo $this->url(); ?>"> <form method="get" id="filtre" action="<?php echo $this->url(); ?>">
<div class="row"> <div class="row">
<!-- Variable -------------------------------------------------------- --> <!-- Variable -------------------------------------------------------- -->
...@@ -49,7 +50,6 @@ ...@@ -49,7 +50,6 @@
</div> </div>
</div> </div>
<script> <script>
$(function () { $(function () {
if (jQuery().selectpicker) { if (jQuery().selectpicker) {
......
...@@ -2,36 +2,65 @@ ...@@ -2,36 +2,65 @@
use UnicaenRenderer\Entity\Db\Rendu; use UnicaenRenderer\Entity\Db\Rendu;
use UnicaenRenderer\Provider\Privilege\DocumentcontenuPrivileges; use UnicaenRenderer\Provider\Privilege\DocumentcontenuPrivileges;
use UnicaenRenderer\Provider\Privilege\DocumentmacroPrivileges;
use UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges;
/** /**
* @see \UnicaenRenderer\Controller\RenduController::indexAction() * @see \UnicaenRenderer\Controller\RenduController::indexAction()
* @var string $title
* @var Rendu[] $rendus * @var Rendu[] $rendus
*/ */
$this->headTitle("Index des contenus"); $this->headTitle($title);
$canMacro = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_INDEX));
$canTemplate = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_INDEX));
$canVoir = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(DocumentcontenuPrivileges::DOCUMENTCONTENU_AFFICHER)); $canVoir = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(DocumentcontenuPrivileges::DOCUMENTCONTENU_AFFICHER));
$canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(DocumentcontenuPrivileges::DOCUMENTCONTENU_SUPPRIMER)); $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(DocumentcontenuPrivileges::DOCUMENTCONTENU_SUPPRIMER));
?> ?>
<h1 class="page-header"> <h1 class="page-header">
Index des rendus <?= $title ?>
</h1> </h1>
<div class="row mb-3">
<div class="col-md-12">
<?php if($canMacro) :?>
<a href="<?php echo $this->url('contenu/macro'); ?>" class="btn btn-primary action">
<span class="icon tag"></span>
Gérer les macros
</a>
<?php endif; ?>
<?php if($canTemplate) :?>
<a href="<?php echo $this->url('contenu/template'); ?>" class="btn btn-primary action">
<span class="icon tag"></span>
Gérer les templates
</a>
<?php endif; ?>
</div>
</div>
<div class="card border-default mb-3">
<div class="card-header bg-default">
<h2>Liste des rendus</h2>
</div>
<div class="card-body">
<table id='rendu-liste' class="table table-condensed table-hover"> <table id='rendu-liste' class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th> Id</th> <th class="col-md-1"> Id</th>
<th> Template</th> <th class="col-md"> Template</th>
<th> Date de génération</th> <th class="col-md-3"> Date de génération</th>
<th> Sujet</th> <th class="col-md"> Sujet</th>
<th> Action</th> <th class="col-md-1 text-end"> Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($rendus as $rendu) : ?> <?php foreach ($rendus as $rendu) : ?>
<tr> <tr>
<td> <?php echo $rendu->getId(); ?> </td> <td> #<?php echo $rendu->getId(); ?> </td>
<td> <td>
<?php if ($rendu->getTemplate()) : ?> <?php if ($rendu->getTemplate()) : ?>
<?php echo $rendu->getTemplate()->getCode(); ?> <?php echo $rendu->getTemplate()->getCode(); ?>
...@@ -47,7 +76,7 @@ $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(Docume ...@@ -47,7 +76,7 @@ $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(Docume
?> ?>
</span> </span>
</td> </td>
<td> <td class="text-end">
<?php if ($canVoir) : ?> <?php if ($canVoir) : ?>
<?php /** @see \UnicaenRenderer\Controller\RenduController::afficherAction() */ ?> <?php /** @see \UnicaenRenderer\Controller\RenduController::afficherAction() */ ?>
<a href="<?php echo $this->url('contenu/rendu/afficher', ['rendu' => $rendu->getId()], [], true); ?>" <a href="<?php echo $this->url('contenu/rendu/afficher', ['rendu' => $rendu->getId()], [], true); ?>"
...@@ -69,6 +98,8 @@ $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(Docume ...@@ -69,6 +98,8 @@ $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(Docume
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div>
</div>
<script> <script>
$(function () { $(function () {
......
...@@ -6,20 +6,40 @@ ...@@ -6,20 +6,40 @@
*/ */
use UnicaenRenderer\Entity\Db\Template; use UnicaenRenderer\Entity\Db\Template;
use UnicaenRenderer\Provider\Privilege\DocumentcontenuPrivileges;
use UnicaenRenderer\Provider\Privilege\DocumentmacroPrivileges;
use UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges; use UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges;
$canRendu = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(DocumentcontenuPrivileges::DOCUMENTCONTENU_INDEX));
$canMacro = $this->isAllowed(DocumentmacroPrivileges::getResourceId(DocumentmacroPrivileges::DOCUMENTMACRO_INDEX));
$canAjouter = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_AJOUTER)); $canAjouter = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_AJOUTER));
$canAfficher = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_AFFICHER)); $canAfficher = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_AFFICHER));
$canModifier = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_MODIFIER)); $canModifier = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_MODIFIER));
$canDetruire = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_SUPPRIMER)); $canDetruire = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(DocumenttemplatePrivileges::DOCUMENTTEMPLATE_SUPPRIMER));
$this->headTitle("Index des templates"); $this->headTitle($title);
?> ?>
<h1 class="page-header"> <h1 class="page-header">
Index des templates <?= $title ?>
</h1> </h1>
<div class="row mb-3">
<div class="col-md-12">
<?php if ($canRendu) : ?>
<a href="<?php echo $this->url('contenu/rendu'); ?>" class="btn btn-primary action">
<span class="icon tag"></span>
Gérer les rendus
</a>
<?php endif; ?>
<?php if ($canMacro) : ?>
<a href="<?php echo $this->url('contenu/macro'); ?>" class="btn btn-primary action">
<span class="icon tag"></span>
Gérer les macros
</a>
<?php endif; ?>
<?php if ($canAjouter) : ?> <?php if ($canAjouter) : ?>
<?php /** @see \UnicaenRenderer\Controller\TemplateController::ajouterAction() */ ?> <?php /** @see \UnicaenRenderer\Controller\TemplateController::ajouterAction() */ ?>
<a href="<?php echo $this->url('contenu/template/ajouter', [], [], true); ?>" <a href="<?php echo $this->url('contenu/template/ajouter', [], [], true); ?>"
...@@ -28,13 +48,21 @@ $this->headTitle("Index des templates"); ...@@ -28,13 +48,21 @@ $this->headTitle("Index des templates");
Ajouter un template Ajouter un template
</a> </a>
<?php endif; ?> <?php endif; ?>
</div>
</div>
<div class="card border-default mb-3">
<div class="card-header bg-default">
<h2>Liste des templates</h2>
</div>
<div class="card-body">
<table id='template-liste' class="table table-condensed table-hover"> <table id='template-liste' class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th> Code</th> <th> Code</th>
<th> Type</th> <th> Type</th>
<th> Action</th> <th class="col-md-1 text-end"> Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
...@@ -43,18 +71,18 @@ $this->headTitle("Index des templates"); ...@@ -43,18 +71,18 @@ $this->headTitle("Index des templates");
<td> <td>
<?php echo $template->getCode(); ?> <?php echo $template->getCode(); ?>
<?php if ($template->getDescription() !== null) : ?> <?php if ($template->getDescription() !== null) : ?>
<span class="icon information" title="<?php echo $template->getDescription(); ?>" data-toggle="tooltip" data-html="true"></span> <span class="icon information" title="<?php echo $template->getDescription(); ?>"
data-toggle="tooltip" data-html="true"></span>
<?php endif; ?> <?php endif; ?>
</td> </td>
<td> <td>
<span class="icon <?php echo $template->getType(); ?>"></span> <span class="icon <?php echo $template->getType(); ?>"> <?= $template->getType() ?></span>
</td> </td>
<td> <td class="text-end">
<?php if ($canAfficher) : ?> <?php if ($canAfficher) : ?>
<?php /** @see \UnicaenRenderer\Controller\TemplateController::afficherAction() */ ?> <?php /** @see \UnicaenRenderer\Controller\TemplateController::afficherAction() */ ?>
<a href="<?php echo $this->url('contenu/template/afficher', ['template' => $template->getId()], [], true); ?>" <a href="<?php echo $this->url('contenu/template/afficher', ['template' => $template->getId()], [], true); ?>"
class="ajax-modal" class="ajax-modal">
>
<span class="icon voir"></span></a> <span class="icon voir"></span></a>
<?php endif; ?> <?php endif; ?>
<?php if ($canModifier) : ?> <?php if ($canModifier) : ?>
...@@ -76,6 +104,8 @@ $this->headTitle("Index des templates"); ...@@ -76,6 +104,8 @@ $this->headTitle("Index des templates");
<?php endforeach; ?> <?php endforeach; ?>
</tbody> </tbody>
</table> </table>
</div>
</div>
<script> <script>
$(function () { $(function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment