Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
renderer
Commits
54abf1c8
Commit
54abf1c8
authored
Mar 30, 2022
by
Thibaut Vallee
Browse files
hormanisation mise en page des libs Laminas/BS-5
parent
0a4bf596
Pipeline
#15558
passed with stage
in 20 seconds
Changes
9
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/UnicaenRenderer/Controller/IndexController.php
View file @
54abf1c8
...
...
@@ -9,6 +9,6 @@ class IndexController extends AbstractActionController {
public
function
indexAction
()
{
return
new
ViewModel
();
return
new
ViewModel
(
[
'title'
=>
'Gestion des contenus'
]
);
}
}
\ No newline at end of file
src/UnicaenRenderer/Controller/MacroController.php
View file @
54abf1c8
...
...
@@ -28,6 +28,7 @@ class MacroController extends AbstractActionController {
}
return
new
ViewModel
([
'title'
=>
'Gestion des macros'
,
'macros'
=>
$macros
,
'variables'
=>
$variables
,
'variable'
=>
$variable
,
...
...
src/UnicaenRenderer/Controller/RenduController.php
View file @
54abf1c8
...
...
@@ -15,6 +15,7 @@ class RenduController extends AbstractActionController {
$rendus
=
$this
->
getRenduService
()
->
getRendus
();
return
new
ViewModel
([
'title'
=>
'Gestions des rendus'
,
'rendus'
=>
$rendus
,
]);
}
...
...
src/UnicaenRenderer/Controller/TemplateController.php
View file @
54abf1c8
...
...
@@ -20,6 +20,7 @@ class TemplateController extends AbstractActionController {
$templates
=
$this
->
getTemplateService
()
->
getTemplates
();
return
new
ViewModel
([
'title'
=>
'Gestion des templates'
,
'templates'
=>
$templates
,
]);
}
...
...
view/unicaen-renderer/index/index.phtml
View file @
54abf1c8
...
...
@@ -8,7 +8,7 @@ use UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges;
* @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
));
$canMacro
=
$this
->
isAllowed
(
DocumentmacroPrivileges
::
getResourceId
(
DocumentmacroPrivileges
::
DOCUMENTMACRO_INDEX
));
...
...
@@ -17,58 +17,73 @@ $canTemplate = $this->isAllowed(DocumenttemplatePrivileges::getResourceId(Docume
?>
<h1
class=
"page-header"
>
Index du module de gestion des contenus
<?=
$title
?>
</h1>
<?php
if
(
$canMacro
)
:
?>
<h2>
Gestion des macros
</h2>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<p>
Listing des macros et modification de celles-ci.
</p>
<div
class=
"row row-cols-1 row-cols-md-3 g-4"
>
<?php
if
(
$canRendu
)
:
?>
<div
class=
"col"
>
<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>
</div>
<div
class=
"card-footer"
>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/rendu'
);
?>
"
class=
"btn btn-primary action"
>
<span
class=
"icon tag"
></span>
Gérer les rendus
</a>
</div>
</div>
</div>
<div
class=
"pull-right"
>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/macro'
);
?>
"
class=
"btn btn-primary action"
>
<span
class=
"icon index"
></span>
Gestion des macros
</a>
<?php
endif
;
?>
<?php
if
(
$canMacro
)
:
?>
<div
class=
"col"
>
<div
class=
"card border-default h-100 m-1"
>
<div
class=
"card-header bg-default"
>
<h2>
Macros
</h2>
</div>
<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>
</div>
<div
class=
"card-footer"
>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/macro'
);
?>
"
class=
"btn btn-primary action"
>
<span
class=
"icon tag"
></span>
Gérer les macros
</a>
</div>
</div>
</div>
</div>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
if
(
$canTemplate
)
:
?>
<h2>
Gestion des templates
</h2
>
<?php
if
(
$canTemplate
)
:
?>
<div
class=
"col"
>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<p>
Listing des templates et modification de ceux-ci.
</p>
</div>
<div
class=
"pull-right"
>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/template'
);
?>
"
class=
"btn btn-primary action"
>
<span
class=
"icon index"
></span>
Gestion des templates
</a>
<div
class=
"card border-default h-100 m-1"
>
<div
class=
"card-header bg-default"
>
<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>
</div>
<div
class=
"card-footer"
>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/template'
);
?>
"
class=
"btn btn-primary action"
>
<span
class=
"icon tag"
></span>
Gérer les templates
</a>
</div>
</div>
</div>
</div>
<?php
endif
;
?>
<?php
endif
;
?>
<?php
if
(
$canRendu
)
:
?>
<h2>
Gestion des rendus
</h2>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<p>
Listing des rendus.
</p>
</div>
<div
class=
"pull-right"
>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/rendu'
);
?>
"
class=
"btn btn-primary action"
>
<span
class=
"icon index"
></span>
Gestion des rendus
</a>
</div>
</div>
<?php
endif
;
?>
\ No newline at end of file
</div>
view/unicaen-renderer/macro/index.phtml
View file @
54abf1c8
...
...
@@ -8,51 +8,82 @@
*/
use
UnicaenRenderer\Entity\Db\Macro
;
use
UnicaenRenderer\Provider\Privilege\DocumentcontenuPrivileges
;
use
UnicaenRenderer\Provider\Privilege\DocumentmacroPrivileges
;
use
UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges
;
$canAjouter
=
$this
->
isAllowed
(
DocumentmacroPrivileges
::
getResourceId
(
DocumentmacroPrivileges
::
DOCUMENTMACRO_AJOUTER
));
$canModifier
=
$this
->
isAllowed
(
DocumentmacroPrivileges
::
getResourceId
(
DocumentmacroPrivileges
::
DOCUMENTMACRO_MODIFIER
));
$canRendu
=
$this
->
isAllowed
(
DocumentcontenuPrivileges
::
getResourceId
(
DocumentcontenuPrivileges
::
DOCUMENTCONTENU_INDEX
));
$canTemplate
=
$this
->
isAllowed
(
DocumenttemplatePrivileges
::
getResourceId
(
DocumenttemplatePrivileges
::
DOCUMENTTEMPLATE_INDEX
));
$canAjouter
=
$this
->
isAllowed
(
DocumentmacroPrivileges
::
getResourceId
(
DocumentmacroPrivileges
::
DOCUMENTMACRO_AJOUTER
));
$canModifier
=
$this
->
isAllowed
(
DocumentmacroPrivileges
::
getResourceId
(
DocumentmacroPrivileges
::
DOCUMENTMACRO_MODIFIER
));
$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"
>
Index des macros
<?=
$title
?>
</h1>
<div
class=
"main"
>
<?php
echo
$this
->
partial
(
'partial/filtre'
,
[
'variables'
=>
$variables
,
'params'
=>
[
'variable'
=>
$variable
]]);
?>
<?php
if
(
$canAjouter
)
:
?>
<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>
Ajouter une macro
</a>
<?php
endif
;
?>
<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
)
:
?>
<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>
Ajouter une macro
</a>
<?php
endif
;
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/macro/generer-json'
,
[],
[],
true
);
?>
"
class=
"btn btn-primary action ajax-modal"
>
<span
class=
"icon code"
></span>
Générer le JSON des macros
</a>
</div>
</div>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/macro/generer-json'
,
[],
[],
true
);
?>
"
class=
"btn btn-primary action ajax-modal"
>
<span
class=
"icon code"
></span>
Générer le JSON des macros
</a>
<?php
echo
$this
->
partial
(
'partial/filtre'
,
[
'variables'
=>
$variables
,
'params'
=>
[
'variable'
=>
$variable
]]);
?>
<table
id=
'macro-liste'
class=
"table table-condensed table-hover"
>
<thead>
<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"
>
<thead>
<tr>
<th>
Code
</th>
<th>
Variable
</th>
<th>
Méthode
</th>
<th>
Action
</th>
<th
class=
"col-md-2"
>
Code
</th>
<th
class=
"col-md"
>
Variable
</th>
<th
class=
"col-md"
>
Méthode
</th>
<th
class=
"col-md-1 text-end"
>
Action
</th>
</tr>
</thead>
<tbody>
<?php
foreach
(
$macros
as
$macro
)
:
?>
</thead>
<tbody>
<?php
foreach
(
$macros
as
$macro
)
:
?>
<tr>
<td>
<?php
echo
$macro
->
getCode
();
?>
<?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
;
?>
</td>
<td>
...
...
@@ -61,7 +92,7 @@ $this->headTitle("Index des macros");
<td>
<?php
echo
$macro
->
getMethode
();
?>
</td>
<td>
<td
class=
"text-end"
>
<?php
if
(
$canModifier
)
:
?>
<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"
...
...
@@ -79,18 +110,20 @@ $this->headTitle("Index des macros");
</td>
</tr>
<?php
endforeach
;
?>
</tbody>
</table>
</tbody>
</table>
</div>
</div>
<script>
$
(
function
()
{
$
(
function
()
{
$
(
"
body
"
).
on
(
"
modification
"
,
function
(
event
)
{
event
.
div
.
modal
(
'
hide
'
);
window
.
location
.
reload
();
});
if
(
jQuery
().
dataTable
)
{
if
(
jQuery
().
dataTable
)
{
$
(
'
#macro-liste
'
).
DataTable
({
"
lengthMenu
"
:
[[
10
,
25
,
50
,
100
,
-
1
],
[
10
,
25
,
50
,
100
,
"
Tous
"
]],
"
columnDefs
"
:
[
...
...
view/unicaen-renderer/macro/partial/filtre.phtml
View file @
54abf1c8
...
...
@@ -8,11 +8,12 @@
?>
<div
class=
"
panel panel
-default"
>
<div
class=
"
panel-heading
"
>
<div
class=
"
card border
-default
mb-3
"
>
<div
class=
"
card-header bg-default
"
>
<h2>
Filtrer les macros
</h2>
</div>
<div
class=
"panel-body"
>
<div
class=
"card-body"
>
<form
method=
"get"
id=
"filtre"
action=
"
<?php
echo
$this
->
url
();
?>
"
>
<div
class=
"row"
>
<!-- Variable -------------------------------------------------------- -->
...
...
@@ -49,7 +50,6 @@
</div>
</div>
<script>
$
(
function
()
{
if
(
jQuery
().
selectpicker
)
{
...
...
view/unicaen-renderer/rendu/index.phtml
View file @
54abf1c8
...
...
@@ -2,43 +2,72 @@
use
UnicaenRenderer\Entity\Db\Rendu
;
use
UnicaenRenderer\Provider\Privilege\DocumentcontenuPrivileges
;
use
UnicaenRenderer\Provider\Privilege\DocumentmacroPrivileges
;
use
UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges
;
/**
* @see \UnicaenRenderer\Controller\RenduController::indexAction()
* @var string $title
* @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
));
$canSupprimer
=
$this
->
isAllowed
(
DocumentcontenuPrivileges
::
getResourceId
(
DocumentcontenuPrivileges
::
DOCUMENTCONTENU_SUPPRIMER
));
?>
<h1
class=
"page-header"
>
Index des rendus
<?=
$title
?>
</h1>
<table
id=
'rendu-liste'
class=
"table table-condensed table-hover"
>
<thead>
<tr>
<th>
Id
</th>
<th>
Template
</th>
<th>
Date de génération
</th>
<th>
Sujet
</th>
<th>
Action
</th>
</tr>
</thead>
<tbody>
<?php
foreach
(
$rendus
as
$rendu
)
:
?>
<tr>
<td>
<?php
echo
$rendu
->
getId
();
?>
</td>
<td>
<?php
if
(
$rendu
->
getTemplate
())
:
?>
<?php
echo
$rendu
->
getTemplate
()
->
getCode
();
?>
<?php
endif
;
?>
</td>
<td>
<?php
echo
$rendu
->
getDate
()
->
format
(
'd/m/Y à H:i:s'
);
?>
</td>
<td>
<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"
>
<thead>
<tr>
<th
class=
"col-md-1"
>
Id
</th>
<th
class=
"col-md"
>
Template
</th>
<th
class=
"col-md-3"
>
Date de génération
</th>
<th
class=
"col-md"
>
Sujet
</th>
<th
class=
"col-md-1 text-end"
>
Action
</th>
</tr>
</thead>
<tbody>
<?php
foreach
(
$rendus
as
$rendu
)
:
?>
<tr>
<td>
#
<?php
echo
$rendu
->
getId
();
?>
</td>
<td>
<?php
if
(
$rendu
->
getTemplate
())
:
?>
<?php
echo
$rendu
->
getTemplate
()
->
getCode
();
?>
<?php
endif
;
?>
</td>
<td>
<?php
echo
$rendu
->
getDate
()
->
format
(
'd/m/Y à H:i:s'
);
?>
</td>
<td>
<span
title=
"
<?php
echo
$rendu
->
getSujet
();
?>
"
data-toggle=
"tooltip"
data-html=
"true"
>
<?php
$sujet
=
$rendu
->
getSujet
();
...
...
@@ -46,29 +75,31 @@ $canSupprimer = $this->isAllowed(DocumentcontenuPrivileges::getResourceId(Docume
echo
$sujet
;
?>
</span>
</td>
<td>
<?php
if
(
$canVoir
)
:
?>
<?php
/** @see \UnicaenRenderer\Controller\RenduController::afficherAction() */
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/rendu/afficher'
,
[
'rendu'
=>
$rendu
->
getId
()],
[],
true
);
?>
"
title=
"Afficher le rendu"
data-toggle=
"tooltip"
data-html=
"true"
class=
"ajax-modal"
>
<span
class=
"icon voir"
></span></a>
<?php
endif
;
?>
<?php
if
(
$canSupprimer
)
:
?>
<?php
/** @see \UnicaenRenderer\Controller\RenduController::supprimerAction() */
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/rendu/supprimer'
,
[
'rendu'
=>
$rendu
->
getId
()],
[],
true
);
?>
"
title=
"Supprimer le rendu"
data-toggle=
"tooltip"
data-html=
"true"
class=
"ajax-modal"
data-event=
"modification"
>
<span
class=
"icon detruire text-danger"
></span></a>
<?php
endif
;
?>
</td>
</tr>
<?php
endforeach
;
?>
</tbody>
</table>
</td>
<td
class=
"text-end"
>
<?php
if
(
$canVoir
)
:
?>
<?php
/** @see \UnicaenRenderer\Controller\RenduController::afficherAction() */
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/rendu/afficher'
,
[
'rendu'
=>
$rendu
->
getId
()],
[],
true
);
?>
"
title=
"Afficher le rendu"
data-toggle=
"tooltip"
data-html=
"true"
class=
"ajax-modal"
>
<span
class=
"icon voir"
></span></a>
<?php
endif
;
?>
<?php
if
(
$canSupprimer
)
:
?>
<?php
/** @see \UnicaenRenderer\Controller\RenduController::supprimerAction() */
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/rendu/supprimer'
,
[
'rendu'
=>
$rendu
->
getId
()],
[],
true
);
?>
"
title=
"Supprimer le rendu"
data-toggle=
"tooltip"
data-html=
"true"
class=
"ajax-modal"
data-event=
"modification"
>
<span
class=
"icon detruire text-danger"
></span></a>
<?php
endif
;
?>
</td>
</tr>
<?php
endforeach
;
?>
</tbody>
</table>
</div>
</div>
<script>
$
(
function
()
{
...
...
view/unicaen-renderer/template/index.phtml
View file @
54abf1c8
...
...
@@ -6,80 +6,110 @@
*/
use
UnicaenRenderer\Entity\Db\Template
;
use
UnicaenRenderer\Provider\Privilege\DocumentcontenuPrivileges
;
use
UnicaenRenderer\Provider\Privilege\DocumentmacroPrivileges
;
use
UnicaenRenderer\Provider\Privilege\DocumenttemplatePrivileges
;
$canAjouter
=
$this
->
isAllowed
(
DocumenttemplatePrivileges
::
getResourceId
(
DocumenttemplatePrivileges
::
DOCUMENTTEMPLATE_AJOUTER
));
$canAfficher
=
$this
->
isAllowed
(
DocumenttemplatePrivileges
::
getResourceId
(
DocumenttemplatePrivileges
::
DOCUMENTTEMPLATE_AFFICHER
));
$canModifier
=
$this
->
isAllowed
(
DocumenttemplatePrivileges
::
getResourceId
(
DocumenttemplatePrivileges
::
DOCUMENTTEMPLATE_MODIFIER
));
$canDetruire
=
$this
->
isAllowed
(
DocumenttemplatePrivileges
::
getResourceId
(
DocumenttemplatePrivileges
::
DOCUMENTTEMPLATE_SUPPRIMER
));
$canRendu
=
$this
->
isAllowed
(
DocumentcontenuPrivileges
::
getResourceId
(
DocumentcontenuPrivileges
::
DOCUMENTCONTENU_INDEX
));
$canMacro
=
$this
->
isAllowed
(
DocumentmacroPrivileges
::
getResourceId
(
DocumentmacroPrivileges
::
DOCUMENTMACRO_INDEX
));
$this
->
headTitle
(
"Index des templates"
);
$canAjouter
=
$this
->
isAllowed
(
DocumenttemplatePrivileges
::
getResourceId
(
DocumenttemplatePrivileges
::
DOCUMENTTEMPLATE_AJOUTER
));
$canAfficher
=
$this
->
isAllowed
(
DocumenttemplatePrivileges
::
getResourceId
(
DocumenttemplatePrivileges
::
DOCUMENTTEMPLATE_AFFICHER
));
$canModifier
=
$this
->
isAllowed
(
DocumenttemplatePrivileges
::
getResourceId
(
DocumenttemplatePrivileges
::
DOCUMENTTEMPLATE_MODIFIER
));
$canDetruire
=
$this
->
isAllowed
(
DocumenttemplatePrivileges
::
getResourceId
(
DocumenttemplatePrivileges
::
DOCUMENTTEMPLATE_SUPPRIMER
));
$this
->
headTitle
(
$title
);
?>
<h1
class=
"page-header"
>
Index des templates
<?=
$title
?>
</h1>
<?php
if
(
$canAjouter
)
:
?>
<?php
/** @see \UnicaenRenderer\Controller\TemplateController::ajouterAction() */
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/template/ajouter'
,
[],
[],
true
);
?>
"
class=
"btn btn-primary action ajax-modal"
data-event=
"modification"
>
<span
class=
"icon ajouter"
></span>
Ajouter un template
</a>
<?php
endif
;
?>
<table
id=
'template-liste'
class=
"table table-condensed table-hover"
>
<thead>
<tr>
<th>
Code
</th>
<th>
Type
</th>
<th>
Action
</th>
</tr>
</thead>
<tbody>
<?php
foreach
(
$templates
as
$template
)
:
?>
<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
/** @see \UnicaenRenderer\Controller\TemplateController::ajouterAction() */
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/template/ajouter'
,
[],
[],
true
);
?>
"
class=
"btn btn-primary action ajax-modal"
data-event=
"modification"
>
<span
class=
"icon ajouter"
></span>
Ajouter un template
</a>
<?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"
>
<thead>
<tr>
<td>
<?php
echo
$template
->
getCode
();
?>
<?php
if
(
$template
->
getDescription
()
!==
null
)
:
?>
<span
class=
"icon information"
title=
"
<?php
echo
$template
->
getDescription
();
?>
"
data-toggle=
"tooltip"
data-html=
"true"
></span>
<?php
endif
;
?>
</td>
<td>
<span
class=
"icon
<?php
echo
$template
->
getType
();
?>
"
></span>
</td>
<td>
<?php
if
(
$canAfficher
)
:
?>
<?php
/** @see \UnicaenRenderer\Controller\TemplateController::afficherAction() */
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/template/afficher'
,
[
'template'
=>
$template
->
getId
()],
[],
true
);
?>
"
class=
"ajax-modal"
>
<span
class=
"icon voir"
></span></a>
<?php
endif
;
?>
<?php
if
(
$canModifier
)
:
?>
<?php
/** @see \UnicaenRenderer\Controller\TemplateController::modifierAction() */
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/template/modifier'
,
[
'template'
=>
$template
->
getId
()],
[],
true
);
?>
"
class=
"ajax-modal"
data-event=
"modification"
>
<span
class=
"icon editer"
></span></a>
<?php
endif
;
?>
<?php
if
(
$canDetruire
)
:
?>
<?php
/** @see \UnicaenRenderer\Controller\TemplateController::detruireAction() */
?>
<a
href=
"
<?php
echo
$this
->
url
(
'contenu/template/detruire'
,
[
'template'
=>
$template
->
getId
()],
[],
true
);
?>
"
class=
"ajax-modal"
data-event=
"modification"
>
<span
class=
"icon detruire text-danger"
></span></a>