nineskeletor/templates/base.html.twig

194 lines
9.7 KiB
Twig

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8" />
<title>{% block title %}{{app.session.get("appname")}}{% endblock %}</title>
<link rel="shortcut icon" href="{{ appAlias }}uploads/logo/{{app.session.get("logolight")}}" />
{{ encore_entry_link_tags('app') }}
{{ encore_entry_script_tags('app') }}
{% block encoretags %}{% endblock encoretags %}
<script src="{{ asset('bundles/tetranzselect2entity/js/select2entity.js') }}"></script>
{{ include('Include/style.css.twig') }}
{% block localstyle %}{% endblock %}
</head>
<body>
{% if (useheader is defined and useheader) or (usemenu is defined and usemenu) %}
<div class="header sticky-top">
{% if useheader is defined and useheader and (app.session.get("fgheader") or not app.user) %}
<div id="header" class="d-flex align-items-center" style="height:{{app.session.get("headerheight")}}px; background-image: linear-gradient(90deg,rgba(var(--colorbgbodydark-rgb),1),rgba(var(--colorbgbodydark-rgb),0.1)),url({{appAlias}}{{app.session.get("headerimage")}});background-size:cover">
<a href="{{ path('app_home')}}">
<img src="{{ appAlias }}uploads/logo/{{app.session.get("logodark")}}" style="height:{{app.session.get("headerheight")-20}}px;margin-left:10px; max-height:120px;">
</a>
<h1 class="flex-grow-1">
<a href="{{ path('app_home')}}">
{{app.session.get("appname")}}
</a>
<br>
<small>{{app.session.get("appsubname")}}</small>
</h1>
<div class="pe-3">
<nav class="nav">
{% if app.user %}
<a class="nav-link" href="{{path("app_user_user")}}" title="Mon Profil">
<img src="{{app.user.avatar|urlavatar}}" class="avatar" style="width:35px;height:35px;">
</a>
{% if is_granted('ROLE_ADMIN') %}
<a class="nav-link" href="{{path("app_admin_home")}}" title="Console d'Administration"><i class="fa fa-cog fa-2x"></i></a>
{% elseif is_granted('ROLE_MODO') %}
<a class="nav-link" href="{{path("app_modo_home")}}" title="Console d'Administration"><i class="fa fa-cog fa-2x"></i></a>
{% endif %}
{% if app.session.get("showannuaire") %}
<a class="nav-link" href="{{path("app_user_users")}}" title="Annuaire des Utilisateurs"><i class="fas fa-address-book fa-2x"></i></a>
{% endif %}
<a class="nav-link" href="{{path("app_user_group")}}" title="Gestion des Groupes de Travail"><i class="fas fa-users fa-2x"></i></a>
<a id="switchHeader" class="nav-link" onclick="switchHeader()" title="Cacher / Afficher Bannière"><i class="fa fa-chevron-up fa-2x"></i></a>
<a class="nav-link" href="{{path("app_logout")}}" title="Déconnexion"><i class="fa fa-sign-out-alt fa-2x"></i></a>
{% else %}
{% if appModeregistration!="none" and appModeregistration!="" and appMasteridentity=="SQL"%}
<a class="nav-link" href="{{ path('app_registration') }}" title="Inscription"><i class="fa fa-user-plus fa-2x fa-fw"></i></a>
{% endif %}
<a class="nav-link" href="{{path("app_login")}}" title="Connexion"><i class="fa fa-sign-in-alt fa-2x"></i></a>
{% endif %}
</nav>
{% if app.user %}
<div id="nameuser" style="text-align:right; margin-top:5px"><a href="{{ path('app_user_user') }}" title="Mon Profil">{{ app.user.firstname }} {{ app.user.lastname }}</a></div>
{% endif %}
</div>
</div>
{% endif %}
{% if (usemenu is defined and usemenu) or not app.session.get("fgheader") %}
{%set style="display:flex"%}
{% else %}
{%set style="display:none"%}
{% endif %}
<nav id="menu" class="navbar navbar-expand p-0" style="{{style}}">
<a class="nav-link navbar-logo" href="{{ path('app_home')}}" style="display:none">
<img src="{{ appAlias }}uploads/logo/{{app.session.get("logodark")}}">
</a>
<a class="nav-link " href="{{ path('app_home')}}">Accueil</a>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
</ul>
</div>
<ul id="menuuser" class="nav navbar-right pe-3">
{% block menuuser %}
{% endblock %}
</ul>
<ul id="menulink" class="nav navbar-right pe-3" style="display:none;">
{% if app.user %}
<a href="{{path("app_user_user")}}">
<img src="{{app.user.avatar|urlavatar}}" class="avatar" style="width:25px; height:25px; margin-top:-3px; margin-right:3px;">
</a>
{% if is_granted('ROLE_ADMIN') %}
<a href="{{path("app_admin_home")}}"><i class="fa fa-cog fa-fw"></i></a>
{% elseif is_granted('ROLE_MODO') %}
<a class="nav-link" href="{{path("app_modo_home")}}"><i class="fa fa-cog"></i></a>
{% endif %}
{% if app.session.get("showannuaire") %}
<a href="{{path("app_user_users")}}"><i class="fas fa-address-book fa-fw"></i></a>
{% endif %}
<a href="{{path("app_user_group")}}"><i class="fas fa-users fa-fw"></i></a>
<a id="switchHeader" class="btn-link" onclick="switchHeader()" title="Cacher / Afficher Bannière"><i class="fa fa-chevron-down fa-fw"></i></a>
<a href="{{path("app_logout")}}"><i class="fa fa-sign-out-alt fa-fw"></i></a>
{% else %}
<a href="{{path("app_login")}}"><i class="fa fa-sign-in-alt fa-fw"></i></a>
{% endif %}
</li>
</ul>
</nav>
</div>
{% endif %}
<main>
{% if usesidebar is defined and usesidebar %}
{% if is_granted('ROLE_ADMIN') %}
{{ include('Include/sidebaradmin.html.twig') }}
{% elseif is_granted('ROLE_MODO') %}
{{ include('Include/sidebarmodo.html.twig') }}
{% endif %}
{%endif%}
<div id="page" class="p-4">
{%if maxsize is defined %}<div style="max-width:{{maxsize}}px;margin:0 auto;">{%endif%}
{% block body %}{% endblock %}
{%if maxsize is defined %}</div>{%endif%}
</div>
</main>
<div id="mymodal" class="modal" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div id="mymodalheader" class="modal-header">
<h4 class="modal-title"></h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<iframe frameborder=0 width="100%" height="600px"></iframe>
</div>
</div>
</div>
</div>
<div id="mymodallarge" class="modal" tabindex="-1">
<div class="modal-dialog modal-xl">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title"></h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<iframe frameborder=0 width="100%" height="700px"></iframe>
</div>
</div>
</div>
</div>
<script>
function switchHeader() {
{% if app.user %}
$.ajax({
method: "POST",
url: "{{ path('app_user_preference') }}",
data: {
id:0,
key:'fgheader',
value: !($("#header").is(":visible"))
},
success: function() {
location.reload();
}
});
{% endif %}
}
</script>
{% block localscript %}{% endblock %}
</body>
</html>