nineskeletor/templates/base.html.twig

407 lines
21 KiB
Twig
Executable File

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8" />
<title>{% block title %}{{app.session.get("appname")}}{% endblock %}</title>
<meta name="description" content="{{app.session.get("appdescription")|striptags|raw}}">
<link rel="shortcut icon" href="{{ path('app_minio_image',{file:"logo/"~app.session.get("logodark")}) }}" />
{{ 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') }}
{% if not app.session.get("apptheme") is empty %}
<link href="{{ appAlias }}themes/{{ app.session.get("apptheme") }}/style.css" rel="stylesheet" media="screen" />
{% endif %}
{% 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({{ path('app_minio_image',{file:app.session.get("headerimage")}) }});background-size:cover">
<a href="{{ path('app_home')}}">
<img src="{{ path('app_minio_image',{file:"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><a href="{{ path('app_home')}}">{{app.session.get("appsubname")}}</a></small>
</h1>
<div class="pe-3">
<nav class="nav">
{% if app.user %}
<a class="nav-link" href="{{path("app_all_user")}}" title="Mon Profil">
<img src="{{ path('app_minio_image',{file:"avatar/"~app.user.avatar}) }}" 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_all_users")}}" title="Annuaire des Utilisateurs"><i class="fas fa-address-book fa-2x"></i></a>
{% endif %}
{% if appGroupuse %}
<a class="nav-link" href="{{path("app_all_group")}}" title="Gestion des Groupes de Travail"><i class="fas fa-users fa-2x"></i></a>
{% endif %}
<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_all_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 d-flex align-items-center" href="{{ path('app_home')}}" style="display:none">
<img src="{{ path('app_minio_image',{file:"logo/"~app.session.get("logodark")}) }}">
{% if not useheader is defined or not useheader %}
<span style="padding-left:10px;font-family: var(--fonttitle); font-size: 20px; text-transform: uppercase">{{app.session.get("appname")}}</span>
{% endif %}
</a>
<div id="menuapp">
<ul class="nav">
<ul id="menupagesportal" class="navbar-nav">
{% set path=path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')) %}
{% if app.session.get("menuheader").menuchilds is defined %}
{% for menuchild in app.session.get("menuheader").menuchilds %}
{% set active="" %}
{% set url="" %}
{% set name="" %}
{% if menuchild.childtype == "blog" %}
{% set url=path("app_child_view",{catparent:'blog', idparent:menuchild.blog.id, idchild:menuchild.blog.childs[0].id }) %}
{% set active=(url==path ? "active" : "") %}
{% set name=menuchild.blog.name %}
{% elseif menuchild.childtype == "blogtype" %}
{% set url=path("app_typeblog_home",{id:menuchild.blogtype.id}) %}
{% set active=(url==path ? "active" : "") %}
{% set name=menuchild.blogtype.name %}
{% elseif menuchild.childtype == "page" %}
{% set url=path("app_child_view",{catparent:'page', idparent:menuchild.page.id, idchild:menuchild.page.childs[0].id }) %}
{% set active=(url==path ? "active" : "") %}
{% set name=menuchild.page.name %}
{% elseif menuchild.childtype == "pagetype" %}
{% set url=path("app_typepage_home",{id:menuchild.pagetype.id}) %}
{% set active=(url==path ? "active" : "") %}
{% set name=menuchild.pagetype.name %}
{% endif %}
<li class="nav-item {{active}}" style="cursor:pointer">
<a href="{{url}}">
{{name}}
</a>
</li>
{% endfor %}
{% endif %}
</ul>
</ul>
</div>
<div class="me-auto">&nbsp;</div>
<ul id="menuuser" class="nav navbar-right pe-3">
{% block menuuser %}
{% endblock %}
</ul>
<a class="nav-toogle pe-3" style="display:none" ><i class="fa-solid fa-bars"></i></a>
<ul id="menulink" class="nav navbar-right pe-3" style="display:none;">
{% if app.user %}
<a href="{{path("app_all_user")}}">
<img src="{{ path('app_minio_image',{file:"avatar/"~app.user.avatar}) }}" class="avatar" style="width:20px; height:20px; 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_all_users")}}"><i class="fas fa-address-book fa-fw"></i></a>
{% endif %}
{% if appGroupuse %}
<a href="{{path("app_all_group")}}"><i class="fas fa-users fa-fw"></i></a>
{% endif %}
{% if useheader is defined and useheader %}
<a id="switchHeader" class="btn-link" onclick="switchHeader()" title="Cacher / Afficher Bannière"><i class="fa fa-chevron-down fa-fw"></i></a>
{% endif %}
<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 %}
{% block beforebody %}
{% endblock %}
<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>
<div id="mymodalfull" class="modal" tabindex="-1">
<div class="modal-dialog modal-fullscreen">
<div class="modal-content">
<div class="modal-body" style="padding:0px">
<button type="button" class="btn btn-link" data-bs-dismiss="modal" aria-label="Close" style="position:absolute; right:10px;color: var(--colorftbodydark)"><i class="fas fa-close fa-2x"></i></button>
<iframe frameborder=0 width="100%" height="100%"></iframe>
</div>
</div>
</div>
</div>
<div id="selmenu" class="modal fade" role="dialog">
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div id="mymodalheader" class="modal-header">
<h4 class="modal-title">MENU</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{% set path=path(app.request.attributes.get('_route'),app.request.attributes.get('_route_params')) %}
{% if app.session.get("menuheader").menuchilds is defined %}
{% for menuchild in app.session.get("menuheader").menuchilds %}
{% set active="" %}
{% set url="" %}
{% set name="" %}
{% if menuchild.childtype == "blog" %}
{% set url=path("app_child_view",{catparent:'blog', idparent:menuchild.blog.id, idchild:menuchild.blog.childs[0].id }) %}
{% set active=(url==path ? "active" : "") %}
{% set name=menuchild.blog.name %}
{% elseif menuchild.childtype == "blogtype" %}
{% set url=path("app_typeblog_home",{id:menuchild.blogtype.id}) %}
{% set active=(url==path ? "active" : "") %}
{% set name=menuchild.blogtype.name %}
{% elseif menuchild.childtype == "page" %}
{% set url=path("app_child_view",{catparent:'page', idparent:menuchild.page.id, idchild:menuchild.page.childs[0].id }) %}
{% set active=(url==path ? "active" : "") %}
{% set name=menuchild.page.name %}
{% elseif menuchild.childtype == "pagetype" %}
{% set url=path("app_typepage_home",{id:menuchild.pagetype.id}) %}
{% set active=(url==path ? "active" : "") %}
{% set name=menuchild.pagetype.name %}
{% endif %}
<li class="nav-item {{active}}" style="cursor:pointer">
<a href="{{url}}">
{{name}}
</a>
</li>
{% endfor %}
{% endif %}
</div>
</div>
</div>
</div>
<script>
function switchHeader() {
{% if app.user %}
$.ajax({
method: "POST",
url: "{{ path('app_all_preference') }}",
data: {
id:0,
key:'fgheader',
value: !($("#header").is(":visible"))
},
success: function() {
location.reload();
}
});
{% endif %}
}
// Resize
function Resize() {
if($("#header").is(":visible")){
$(".navbar-logo").hide();
$("#menulink").hide();
$("#header").hide();
}
else {
$(".navbar-logo").show();
$("#menulink").show();
$("#header").show();
}
$("#sidebar").css("min-height",$("body").height()-$(".header").height());
if($("#menuapp").is(":visible") && $(".nav-toogle").is(":visible")){
$("#menuapp").css("height",$(window).height()-$(".header").height());
}
else {
$("#menuapp").css("height","auto");
}
if($('.heroheader').length) {
heighthero=$('.heroheader').width()/4;
$('.heroheader').height(heighthero);
$('.herocredit').css({ top: (heighthero-30)+'px' });
if($('.heroheader').width()>980) $('.heroheader').show();
}
if($('.herobody').length) {
left=$('.herobody').css("padding-left").replace("px","");
console.log($(".header").height());
console.log($(window).height());
$('.herobody').css("margin-top",left-$(".header").height());
$('.herobody').height($(window).height()-(left*2));
}
resizegrid();
}
$(document).ready(function() {
if($('.heroheader').length) {
{% if child is defined and child.childheaders|length > 1 %}
$('.heroheader').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 6000,
dots: true,
touchMove: false,
pauseOnDotsHover: true,
fade: true,
cssEase: 'linear',
prevArrow: false,
nextArrow: false,
customPaging: function(slider, i) {
return '<span class="heroheader-dot fa fa-circle fa-fw"></span>';
}
});
{% endif %}
}
$('.grid-item').imagesLoaded(function() {
$('.grid').masonry({
columnWidth: '.grid-sizer',
gutter: '.gutter-sizer',
itemSelector: '.grid-item',
percentPosition: true,
horizontalOrder: false,
});
resizegrid();
});
});
function resizegrid() {
$('.grid-square').each(function() {
$(this).height($(this).width());
});
$('.grid').masonry({
columnWidth: '.grid-sizer',
gutter: '.gutter-sizer',
itemSelector: '.grid-item',
percentPosition: true,
horizontalOrder: false,
});
}
$( ".grid-item" ).hover(function() {
$( this ).children(".grid-image").css("transform","scale(1.05)");
}, function() {
$( this ).children(".grid-image").css("transform","scale(1)");
});
</script>
{% block localscript %}{% endblock %}
</body>
</html>