This commit is contained in:
62
templates/Documentcategory/edit.html.twig
Executable file
62
templates/Documentcategory/edit.html.twig
Executable file
@ -0,0 +1,62 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ form_start(form) }}
|
||||
<h1 class="page-header">
|
||||
{% if mode=="update" %}
|
||||
Modification Catégorie de Document = {{documentcategory.label}}
|
||||
{% elseif mode=="submit" %}
|
||||
Création Catégorie de Document
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
{{ form_widget(form.submit) }}
|
||||
<a class="btn btn-secondary" href={{ path('app_admin_documentcategory') }}>Annuler</a>
|
||||
{% if mode=="update" %}
|
||||
<a class="btn btn-danger float-end" href={{ path('app_admin_documentcategory_delete',{id:documentcategory.id}) }} data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?">Supprimer</a>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('error') %}
|
||||
<div class='alert alert-danger' style='margin: 5px 0px'>
|
||||
<strong>Erreur</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('error') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app.session.flashbag.has('notice') %}
|
||||
<div class='alert alert-info' style='margin: 5px 0px'>
|
||||
<strong>Information</strong><br>
|
||||
{% for flashMessage in app.session.flashbag.get('notice') %}
|
||||
{{ flashMessage }}<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-pencil-alt fa-fw"></i> Informations
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ form_row(form.label) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if auditUse and mode=="update" and (access=="admin" or access=="modo" or access=="audit") %}
|
||||
<div class="float-end" style="width:700px;max-width:100%">
|
||||
{{ render(path("app_"~access~"_audit_renderid",{entityname:"Documentcategory",entityid:documentcategory.id})) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
$('document').ready(function(){
|
||||
$("#documentcategory_label").focus();
|
||||
});
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
81
templates/Documentcategory/list.html.twig
Executable file
81
templates/Documentcategory/list.html.twig
Executable file
@ -0,0 +1,81 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block localstyle %}
|
||||
<style>
|
||||
.list-sort {
|
||||
padding:10px;
|
||||
background-color: var(--bs-card-cap-bg);
|
||||
border: var(--bs-card-border-width) solid var(--bs-card-border-color);
|
||||
border-radius: var(--bs-card-inner-border-radius);
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1 class="page-header">Gestion des Catégories de Document </h1>
|
||||
|
||||
|
||||
<a class="btn btn-success" href="{{ path('app_'~access~'_documentcategory_submit') }}">Ajouter</a>
|
||||
{% if auditUse and (access=="admin" or access=="audit") %}
|
||||
<a class="btn btn-secondary float-end" href="{{ path('app_'~access~'_audit_render',{entityname:'Documentcategory'}) }}"><i class="fas fa-eye fa-fw"></i> Audit</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div class="card mt-4">
|
||||
<div class="card-header">
|
||||
<i class="fa fa-table fa-fw"></i> Liste des Catégories de Document
|
||||
</div>
|
||||
|
||||
{% set childs=[] %}
|
||||
<div class="card-body">
|
||||
<ul class="list-sort">
|
||||
{% for documentcategory in documentcategorys %}
|
||||
{{ render(path("app_"~access~"_documentcategory_render",{id:documentcategory.id})) }}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block localscript %}
|
||||
<script>
|
||||
|
||||
function updateItems() {
|
||||
roworder=0;
|
||||
$('.itemcat').each(function(i) {
|
||||
// Order
|
||||
roworder++;
|
||||
|
||||
// On récupère id et order
|
||||
var id = $(this).data('id');
|
||||
|
||||
// On récupère le parent
|
||||
var parent=$(this).parents('.itemcat').data('id');
|
||||
//if(id==parent) parent=null;
|
||||
|
||||
console.log({id: id, parent:parent, roworder: roworder});
|
||||
|
||||
// Mise à jour en base de l'order
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_'~access~'_documentcategory_order') }}",
|
||||
data: {
|
||||
id:id,
|
||||
parent:parent,
|
||||
roworder:roworder
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$( ".list-sort" ).sortable({
|
||||
connectWith: ".list-sort",
|
||||
items: ".itemcat",
|
||||
placeholder: "item placeholder",
|
||||
stop: updateItems
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
10
templates/Documentcategory/render.html.twig
Normal file
10
templates/Documentcategory/render.html.twig
Normal file
@ -0,0 +1,10 @@
|
||||
<div class="itemcat list-group-item mb-3" data-id="{{ documentcategory.id }}" >
|
||||
<a href="{{ path('app_'~access~'_documentcategory_update',{id:documentcategory.id})}}">{{ documentcategory.label }}</a>
|
||||
<ul class="p-3 list-sort">
|
||||
{% if not documentcategory.childs is empty %}
|
||||
{% for documentcategory in documentcategory.childs %}
|
||||
{{ render(path("app_"~access~"_documentcategory_render",{id:documentcategory.id,access:access})) }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
@ -5,13 +5,13 @@
|
||||
'name' : 'CONFIGURATION',
|
||||
'items' : [
|
||||
{
|
||||
icon: 'fa fa-table',
|
||||
icon: 'fa fa-table fa-fw',
|
||||
route: 'app_admin_config',
|
||||
name: 'Général',
|
||||
},
|
||||
|
||||
{
|
||||
icon: 'fas fa-paint-brush',
|
||||
icon: 'fas fa-paint-brush fa-fw',
|
||||
route: 'app_admin_theme',
|
||||
name: 'Thème',
|
||||
},
|
||||
@ -19,46 +19,46 @@
|
||||
},
|
||||
{
|
||||
'id': 'sidebar-organisation',
|
||||
'icon': 'fa fa-sitemap',
|
||||
'icon': 'fa fa-sitemap fa-fw',
|
||||
'name' : 'ORGANISATION',
|
||||
'items' : [
|
||||
{
|
||||
icon: 'fa fa-building',
|
||||
icon: 'fa fa-building fa-fw',
|
||||
route: 'app_admin_niveau01',
|
||||
name: appNiveau01labels,
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-sitemap',
|
||||
icon: 'fa fa-sitemap fa-fw',
|
||||
route: 'app_admin_niveau02',
|
||||
name: appNiveau02labels,
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-store-alt',
|
||||
icon: 'fas fa-store-alt fa-fw',
|
||||
route: 'app_admin_niveau03',
|
||||
name: appNiveau03labels,
|
||||
},
|
||||
{
|
||||
icon: 'fas fa-monument',
|
||||
icon: 'fas fa-monument fa-fw',
|
||||
route: 'app_admin_niveau04',
|
||||
name: appNiveau04labels,
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-users',
|
||||
icon: 'fa fa-users fa-fw',
|
||||
route: 'app_admin_group',
|
||||
name: 'Groupes',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-child',
|
||||
icon: 'fa fa-child fa-fw',
|
||||
route: 'app_admin_user',
|
||||
name: 'Utilisateurs',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-edit',
|
||||
icon: 'fa fa-edit fa-fw',
|
||||
route: 'app_admin_registration',
|
||||
name: 'Inscriptions',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-tasks',
|
||||
icon: 'fa fa-tasks fa-fw',
|
||||
route: 'app_admin_whitelist',
|
||||
name: 'Listes Blanche',
|
||||
},
|
||||
@ -80,35 +80,47 @@
|
||||
name: 'Pages',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-desktop',
|
||||
icon: 'fa fa-desktop fa-fw',
|
||||
route: 'app_admin_item',
|
||||
name: 'Items',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-bell',
|
||||
icon: 'fa fa-bell fa-fw',
|
||||
route: 'app_admin_alert',
|
||||
name: 'Annonces',
|
||||
},
|
||||
{
|
||||
icon: 'fa fa-bug',
|
||||
icon: 'fa fa-bug fa-fw',
|
||||
route: 'app_admin_icon',
|
||||
name: 'Icônes',
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
'id': 'sidebar-document',
|
||||
'icon': 'fa fa-file fa-fw',
|
||||
'name' : 'DOCUMENTS',
|
||||
'items' : [
|
||||
{
|
||||
icon: 'fa fa-cogs',
|
||||
route: 'app_admin_documentcategory',
|
||||
name: 'Catégories',
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
'id': 'sidebar-cron',
|
||||
'icon': 'fa fa-wrench',
|
||||
'name' : 'OUTILS',
|
||||
'items' : [
|
||||
{
|
||||
icon: 'fa fa-cogs',
|
||||
icon: 'fa fa-cogs fa-fw',
|
||||
route: 'app_admin_cron',
|
||||
name: 'Cron Jobs',
|
||||
},
|
||||
|
||||
{
|
||||
icon: 'fas fa-star-of-life',
|
||||
icon: 'fas fa-star-of-life fa-fw',
|
||||
route: 'app_rest',
|
||||
name: 'API',
|
||||
},
|
||||
|
Reference in New Issue
Block a user