templates/base.html.twig line 1

Open in your IDE?
  1. {% set color = app.session.get('color') %}
  2. {% set logo = app.session.get('logo') %}
  3. {% set fgheader = app.session.get('fgheader') %}
  4. {% set fguserheader = app.session.get('fguserheader') %}
  5. {% set header =  app.session.get('header') %}
  6. {% set heightheader =  app.session.get('heightheader') %}
  7. {% set colorR = color['mainrgb']['r'] %}
  8. {% set colorG = color['mainrgb']['g'] %}
  9. {% set colorB = color['mainrgb']['b'] %}
  10. {% set theme = app.session.get('theme') %}
  11. {% if theme is not empty %}
  12.     {{ include('@Theme/'~theme~'/function.html.twig') }}
  13.     {% import '@Theme/constant.html.twig' as constant %}
  14.     {% set logo = constant.logo().__toString %}
  15.     {% set header = constant.header().__toString %}
  16.     {% set heightheader = constant.heightheader().__toString %}
  17.     {% set colorR = constant.colorR.__toString %}
  18.     {% set colorG = constant.colorG.__toString %}
  19.     {% set colorB = constant.colorB.__toString %}
  20. {%endif%}
  21. <!DOCTYPE html>
  22. <html>   
  23.     {{ include('Include/head.html.twig') }}
  24.     <style>
  25.     {% block localstyle %}
  26.     {% endblock %}
  27.     
  28.     </style>
  29.     {% if maxwidth is defined and maxwidth %}
  30.         {% set bodystyle="simple" %}
  31.     {% elseif useheader %}
  32.         {% set bodystyle="body" %}
  33.     {% else %}
  34.         {% set bodystyle="simple" %}
  35.     {% endif %}
  36.     {% if app.user %}
  37.         {% for usergroup in app.user.groups %}
  38.             {% set bodystyle = bodystyle~" grp-"~usergroup.group.label|replace({" ":"", "'":""}) %}
  39.         {% endfor %}
  40.     {% endif %}
  41.     {% if useheader and app.request.attributes.get('_route')=='app_core_home' %}
  42.         {{ render(url("app_core_checkuser")) }}
  43.     {% endif %}
  44.     <body class="{{ bodystyle }}">
  45.         <div class="d-flex flex-column ">
  46.             {% if fgheader==1 and (fguserheader==1 or not app.user)%}     
  47.                 {% if useheader %}
  48.                     <!-- Header -->
  49.                     <div class="header sticky-top d-flex align-items-center" style="height:{{heightheader}}px; background-image: linear-gradient(90deg,rgba({{ colorR }},{{ colorG }},{{ colorB }},1),rgba({{ colorR }},{{ colorG }},{{ colorB }},0.1)),url({{ asset(header) }});">
  50.                         <a href="{{ path('app_core_home')}}">
  51.                             <img class="logo" src="{{ asset(logo) }}" style="height:{{heightheader-20}}px;margin-left:10px; max-height:120px;">
  52.                             {% if not app.session.get('sublogo') is empty %}
  53.                                 <img class="logo" src="{{ asset(app.session.get('sublogo')) }}" style="height:{{ heightheader-20}}px;">
  54.                             {% endif %}
  55.                         </a>
  56.                         <h1 class="flex-grow-1">
  57.                             <a href="{{ path('app_core_home')}}">
  58.                                 {{app.session.get("appname")}}
  59.                             </a>
  60.                             <br>
  61.                             <small><a href="{{ path('app_core_home')}}">{{app.session.get("subappname")}}</a></small>                        
  62.                         </h1>
  63.                         <div class="pe-3">
  64.                             <nav class="nav">
  65.                                 {% if mustread is not defined %}
  66.                                     {{ include('Include/menu.html.twig') }}
  67.                                 {% endif %}
  68.                             </nav>
  69.                             {% if app.user %}
  70.                             <div class="nav-nameuser"><a href="{{ path('app_core_user') }}" title="Profil">{{ app.user.firstname }} {{ app.user.lastname }}</a></div>
  71.                             {% endif %}
  72.                         </div>
  73.                     </div>
  74.                 {% endif %}
  75.             {% endif %}
  76.             
  77.             {% if useheader %}
  78.                 <!-- Littleheader -->
  79.                 <div class="littleheader sticky-top align-items-center" style="{{ (fgheader==1 and (fguserheader==1 or not app.user)?'display:none;':'display:flex') }}">
  80.                     <a href="{{ path('app_core_home')}}">
  81.                         <img id="logo" src="{{ asset(logo) }}">
  82.                         {% if not app.session.get('sublogo') is empty %}
  83.                             <img id="logo" src="{{ asset(app.session.get('sublogo')) }}">
  84.                         {% endif %}
  85.                     </a>
  86.                     <h1 class="flex-grow-1">
  87.                         <a href="{{ path('app_core_home')}}">
  88.                             {{app.session.get("appname")}}
  89.                         </a>                     
  90.                     </h1>
  91.                     {% if mustread is not  defined  %}
  92.                         <div class="ms-auto pe-3">
  93.                             <nav class="nav">
  94.                                 {{ include('Include/menu.html.twig') }}
  95.                                 {% if usesidebar %}
  96.                                     <a id="showsidebar" class="nav-link" title="Menu"><i class="fa fa-bars fa-fw"></i></a>
  97.                                 {% endif %}
  98.                                 {% if usemenu %}
  99.                                     <a id="showmenu" class="nav-link" title="Menu"><i class="fa fa-bars fa-fw"></i></a>
  100.                                 {% endif %}                                
  101.                             </nav>
  102.                         </div>
  103.                     {% endif %}
  104.                 </div>
  105.             {% endif %}
  106.             {% if usemenu %}
  107.                 <div id="menu">
  108.                     {% block appmenu %}
  109.                     {% endblock %}
  110.                 </div>    
  111.             {% endif %}    
  112.             <main class="d-flex align-items-stretch">
  113.                 {% if usesidebar %}
  114.                     {% block sidebar %}
  115.                         {{ include('Include/sidebar.html.twig') }}
  116.                     {% endblock %}
  117.                 {% endif %} 
  118.                 <div id="page-wrapper" class="flex-grow-1 {{ (useheader and not usesidebar)?"page-header" }} {{ (maxwidth is defined and maxwidth)?"page-maxed" }}" style="{{ (not useheader)? "background-color:transparent; " }}">
  119.                     <div>
  120.                         {% block pagewrapper %}
  121.                         {% endblock %}
  122.                     </div>
  123.                 </div>
  124.             </main>
  125.         </div>
  126.         
  127.         {{ include('Include/footer.html.twig') }}
  128.         {% block localexternalscript %}
  129.         {% endblock %}
  130.         <script>
  131.             {% block localjavascript %}
  132.             {% endblock %}
  133.         </script>
  134.         {% if activate_widsonde and not framed is defined %}
  135.             {{ render(path("app_core_sonde")) }}
  136.         {% endif %}
  137.     </body>
  138. </html>