nineskeletor/templates/Include/sidebaradmin.html.twig

156 lines
5.3 KiB
Twig
Raw Normal View History

2022-07-21 16:15:47 +02:00
{% set sidebar = [
{
'id': 'sidebar-config',
'icon': 'fa fa-gear',
'name' : 'CONFIGURATION',
'items' : [
{
icon: 'fa fa-table',
route: 'app_admin_config',
name: 'Général',
},
2022-07-25 17:16:08 +02:00
{
icon: 'fas fa-paint-brush',
route: 'app_admin_theme',
name: 'Thème',
},
2022-07-21 16:15:47 +02:00
]
},
{
'id': 'sidebar-organisation',
'icon': 'fa fa-sitemap',
'name' : 'ORGANISATION',
'items' : [
{
icon: 'fa fa-building',
route: 'app_admin_niveau01',
name: appNiveau01labels,
2022-07-21 16:15:47 +02:00
},
{
icon: 'fa fa-sitemap',
route: 'app_admin_niveau02',
name: appNiveau02labels,
},
{
icon: 'fas fa-store-alt',
route: 'app_admin_niveau03',
name: appNiveau03labels,
},
{
icon: 'fas fa-monument',
route: 'app_admin_niveau04',
name: appNiveau04labels,
2022-07-21 16:15:47 +02:00
},
{
icon: 'fa fa-users',
route: 'app_admin_group',
name: 'Groupes',
},
{
icon: 'fa fa-child',
route: 'app_admin_user',
name: 'Utilisateurs',
},
{
icon: 'fa fa-edit',
route: 'app_admin_registration',
name: 'Inscriptions',
},
{
icon: 'fa fa-tasks',
route: 'app_admin_whitelist',
name: 'Listes Blanche',
},
]
},
2023-01-10 11:13:28 +01:00
{
'id': 'sidebar-portal',
'icon': 'fa fa-door-closed',
'name' : 'PORTAIL',
'items' : [
{
2023-01-12 16:14:31 +01:00
icon: 'fa fa-copy fa-fw',
2023-01-23 09:46:34 +01:00
route: 'app_admin_page_template',
2023-01-12 16:14:31 +01:00
name: 'Modèles de Page',
},
2023-01-23 09:46:34 +01:00
{
icon: 'fa fa-file fa-fw',
route: 'app_admin_page_portal',
name: 'Pages',
},
2023-01-10 11:13:28 +01:00
{
icon: 'fa fa-desktop',
route: 'app_admin_item',
name: 'Items',
2023-01-12 16:14:31 +01:00
},
{
icon: 'fa fa-bell',
route: 'app_admin_alert',
name: 'Annonces',
2023-01-10 11:13:28 +01:00
},
{
icon: 'fa fa-bug',
route: 'app_admin_icon',
name: 'Icônes',
},
]
},
2022-07-21 16:15:47 +02:00
{
'id': 'sidebar-cron',
'icon': 'fa fa-wrench',
'name' : 'OUTILS',
'items' : [
{
icon: 'fa fa-cogs',
route: 'app_admin_cron',
name: 'Cron Jobs',
},
{
icon: 'fas fa-star-of-life',
route: 'app_rest',
name: 'API',
},
]
},
]
%}
<div id="sidebar" class="d-flex flex-column">
<ul class="nav nav-pills flex-column mb-auto">
{% for section in sidebar %}
{% set sectionactive=false %}
{% for item in section.items %}
{% if item.route in app.request.get('_route') %}
{% set sectionactive=true %}
{% endif %}
{% endfor %}
<div class="nav-link-section">
<a class="nav-link nav-link-title" onClick="$('#sidebar .nav-link-items').hide();$(this).next().toggle();">
<i class="{{section.icon}}"></i>
<span>{{section.name}}</span>
</a>
<div class="nav-link-items" style="{% if sectionactive %}display:block{%else%}display:none{%endif%}">
{% for item in section.items %}
{% set toshow=true %}
{% if item.route=="app_admin_registration" and (appMasteridentity!="SQL" or appModeregistration is empty) %} {% set toshow=false %} {% endif %}
{% if item.route=="app_admin_whitelist" and (appMasteridentity!="SQL" or appModeregistration is empty) %} {% set toshow=false %} {% endif %}
{% if item.route=="app_admin_niveau02" and not appNiveau02use %} {% set toshow=false %} {% endif %}
{% if item.route=="app_admin_niveau03" and not appNiveau03use %} {% set toshow=false %} {% endif %}
{% if item.route=="app_admin_niveau04" and not appNiveau04use %} {% set toshow=false %} {% endif %}
{% if item.route=="app_admin_group" and not appGroupuse %} {% set toshow=false %} {% endif %}
2022-07-21 16:15:47 +02:00
{%if toshow %}
<a class="nav-link nav-link-item {% if item.route in app.request.get('_route') %}active{%endif%}" href="{{path(item.route)}}" title="{{item.name}}">
<i class="{{item.icon}} fa-fw"></i>
<span>{{item.name}}</span>
</a>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
</ul>
</div>