templates/base.html.twig line 1

Open in your IDE?
  1. {%- set route = app.request.get('_route') -%}
  2. <!DOCTYPE html>
  3. <html>
  4.     <head>
  5.         <meta charset="UTF-8">
  6.         <title>{% block title %}Liveboards {% if page_title is defined and page_title %} - {{ page_title }}{%- endif -%}{% endblock %}</title>
  7.         <link rel="stylesheet" href="{{ asset('build/app.css') }}" />
  8.         <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.9/css/all.css" integrity="sha384-5SOiIsAziJl6AWe0HWRKTXlfcSHKmYV4RBF18PPJ173Kzn7jzMyFuTtk8JA7QQG1" crossorigin="anonymous" media="none" onload="if(media!='all')media='all'">
  9.         <noscript><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.9/css/all.css" integrity="sha384-5SOiIsAziJl6AWe0HWRKTXlfcSHKmYV4RBF18PPJ173Kzn7jzMyFuTtk8JA7QQG1" crossorigin="anonymous"></noscript>
  10.         {% block stylesheets %}{% endblock %}
  11.     </head>
  12.     <body>
  13.         {% if is_granted('ROLE_PREVIOUS_ADMIN') %}
  14.             <div class="app-level-alert">
  15.                 <div class="container">
  16.                     You are currently impersonating {{ app.user.username }} <a href="{{ path('identity_read', {identity: app.user.id}) }}?_switch_user=_exit" class="float-right">Exit impersonation</a>
  17.                 </div>
  18.             </div>
  19.         {% endif %}
  20.         {% block navbar %} {# Figure out menu active flag etc: {{ dump(app.request) }} #}
  21.         <nav class="navbar navbar-expand-lg navbar-light bg-light">
  22.             <div class="container-fluid">
  23.                 <a class="navbar-brand" href="/"><img src="{{ asset('build/images/swplogo.png') }}" height="50" width="210" alt="SafeWorkPro Logo"></a>
  24.                 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  25.                     <span class="navbar-toggler-icon"></span>
  26.                 </button>
  27.                 {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  28.                 <div class="collapse navbar-collapse" id="navbarSupportedContent">
  29.                     <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
  30.                         {% if is_granted('ROLE_BROWSER') %}
  31.                         <li class="nav-item{% if route != 'browser_staff' and (route starts with 'browser' or route == 'index') %} active{% endif %}">
  32.                             <a class="nav-link" href="
  33.                                 {%- if dbname is defined and dbname -%}
  34.                                     {{ path('browser_documents', {dbname: dbname}) }}
  35.                                 {%- else -%}
  36.                                     {{ path('index') }}
  37.                                 {%- endif -%}
  38.                             ">Documents</a>
  39.                         </li>
  40.                         {% endif %}
  41.                         {% if is_granted('ROLE_BROWSER') or is_granted('ROLE_LIVEBOARD') %}
  42.                         <li class="nav-item{% if route starts with 'liveboard' %} active{% endif %}">
  43.                             <a class="nav-link" href="
  44.                                 {%- if dbname is defined and dbname -%}
  45.                                     {{ path('liveboard_index', {dbname: dbname}) }}
  46.                                 {%- else -%}
  47.                                     {{ path('liveboard_index') }}
  48.                                 {%- endif -%}
  49.                             ">Liveboards</a>
  50.                         </li>
  51.                         {% endif %}
  52.                         {% if is_granted('ROLE_BROWSER') or is_granted('ROLE_LIVEBOARD') %}
  53.                             <li class="nav-item{% if route starts with 'alert_unresolved_alerts' %} active{% endif %}">
  54.                                 <a class="nav-link" href="
  55.                                 {%- if dbname is defined and dbname -%}
  56.                                     {{ path('alert_unresolved_alerts', {dbname: dbname}) }}
  57.                                 {%- else -%}
  58.                                     {{ path('alert_unresolved_alerts') }}
  59.                                 {%- endif -%}
  60.                             ">Alerts</a>
  61.                             </li>
  62.                         {% endif %}
  63.                         {% if is_granted('ROLE_GRID') %}
  64.                         <li class="nav-item{% if route starts with 'grid' %} active{% endif %}">
  65.                             <a class="nav-link" href="
  66.                             {%- if dbname is defined and dbname -%}
  67.                                 {{ path('grid_index', {dbname: dbname}) }}
  68.                             {%- else -%}
  69.                                 {{ path('grid_index') }}
  70.                             {%- endif -%}
  71.                         ">Grids</a>
  72.                         </li>
  73.                         {% endif %}
  74.                         {% if is_granted('ROLE_LIVEBOARD') %}
  75.                             <li class="nav-item{% if route == 'staff_activity' %} active{% endif %}">
  76.                                 {%- if dbname is defined and dbname -%}
  77.                                     <a href="{{ path('staff_activity', {dbname: dbname}) }}" class="nav-link">SWP Activity</a>
  78.                                 {%- else -%}
  79.                                     {# Need a database selected first cant go scanning every DB #}
  80.                                     <a href="{{ path('index') }}" class="nav-link">SWP Activity</a>
  81.                                 {%- endif -%}
  82.                             </li>
  83.                         {% endif %}
  84.                         {% if is_granted('ROLE_LIVEBOARD') %}
  85.                             <li class="nav-item{% if route == 'staff_jobs' %} active{% endif %}">
  86.                                 {%- if dbname is defined and dbname -%}
  87.                                     <a href="{{ path('staff_jobs', {dbname: dbname}) }}" class="nav-link">Jobs</a>
  88.                                 {%- else -%}
  89.                                     {# Need a database selected first cant go scanning every DB #}
  90.                                     <a href="{{ path('index') }}" class="nav-link">Jobs</a>
  91.                                 {%- endif -%}
  92.                             </li>
  93.                         {% endif %}
  94.                         {% if is_granted('ROLE_COMMUNICATION') or is_granted('ROLE_ADMIN') %}
  95.                             <li class="nav-item{% if route == 'staff_communication' %} active{% endif %}">
  96.                                 {# This lets managers contact their SWP users by sms/email. Must have access to at least one database.
  97.                                 Even if you are a SWP Admin - to stop any accidents / people seeing entire swp user list.
  98.                                  If you dont have a SWP database selected, you will see users for all databases your account is
  99.                                  set to have specifically set 'access to' #}
  100.                                 {%- if dbname is defined and dbname -%}
  101.                                     <a href="{{ path('staff_communication', {dbname: dbname}) }}" class="nav-link">Communication</a>
  102.                                 {%- else -%}
  103.                                     <a href="{{ path('index') }}" title="Select a data source first" class="disabled nav-link">Communication<small> select data source</small></a>
  104.                                 {%- endif -%}
  105.                             </li>
  106.                         {% endif %}
  107.                         {# Removed 25-02-2020
  108.                         {% if is_granted('ROLE_ADMIN') %}
  109.                         <li class="nav-item{% if route starts with 'identity' %} active{% endif %}">
  110.                             <a href="{{ path('identity') }}" class="nav-link">Users</a>
  111.                         </li>
  112.                         {% endif %}#}
  113.                     </ul>
  114.                     {% if dbname is defined and dbname %}
  115.                     <form class="form-inline my-2 my-lg-0 ml-auto" method="get" action="{{ path('browser_search', {dbname: dbname}) }}">
  116.                         <div class="input-group">
  117.                         <input class="form-control input-lg" type="search" name="q" placeholder="Doc name / submission #" aria-label="Search" value="{{ app.session.get('query') }}">
  118.                             <div class="input-group-append">
  119.                             <button class="btn btn-outline-success" type="submit">
  120.                             <i class="fa fa-search"></i>
  121.                         </button>
  122.                         </div>
  123.                         </div>
  124.                     </form>
  125.                     {% endif %}
  126.                     {# is being real difficult to style - wont follow normal bootstrap colours?? #}
  127.                     <div class="dropdown ml-5">
  128.                         <button class="btn AAAbtn-outline-secondary NiceColourWithNothingbtn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  129.                             {{ app.user.username }}
  130.                         </button>
  131.                         <div class="dropdown-menu">
  132.                             {% if is_granted('ROLE_ADMIN') %}
  133.                                 <a class="dropdown-item" href="{{ path('identity') }}">Manage Users</a>
  134.                                 {%- if dbname is defined and dbname -%}
  135.                                     <a class="dropdown-item" href="{{ path('browser_research', {dbname: dbname}) }}">SWP Research</a>
  136.                                 {%- else -%}
  137.                                     <a class="dropdown-item" href="{{ path('index') }}">SWP Research</a>
  138.                                 {%- endif -%}
  139.                             {% endif %}
  140.                             <a class="dropdown-item" href="https://safeworkpro.zendesk.com" target="_blank">Support</a>
  141.                             <a class="dropdown-item" href="{{ path('logout') }}">Log out</a>
  142.                         </div>
  143.                     </div>
  144.                     {# Removed 25-02-2020
  145.                     <ul class="navbar-nav ml-auto mb-2 mt-lg-0">
  146.                         <li class="nav-item">
  147.                             {{ app.user.username }} | <a href="{{ path('logout') }}">Log out</a>
  148.                         </li>
  149.                     </ul>#}
  150.                 </div>
  151.                 {% endif %}
  152.             </div>
  153.         </nav>
  154.         {% endblock %}
  155.         {%- block main -%}
  156.         <div class="container">
  157.             {%- block body %}{% endblock -%}
  158.         </div>
  159.         {%- endblock -%}
  160.         <script type="text/javascript" src="{{ asset('build/manifest.js') }}"></script>
  161.         <script type="text/javascript" src="{{ asset('build/vendor.js') }}"></script>
  162.         <script type="text/javascript" src="{{ asset('build/app.js') }}"></script>
  163.         <script type="text/javascript" src="{{ asset('build/font-awesome.js') }}"></script>
  164.         <script type="text/javascript" src="{{ asset('build/datatables-bs4.js') }}"></script>
  165.         <link rel="stylesheet" href="{{ asset('build/datatables-bs4-css.css') }}"/>
  166.         <link rel="stylesheet" href="{{ asset('build/datatables-css.css') }}"/>
  167.         {#pointless not helpful <script type="text/javascript" src="{{ asset('build/datatables-bs4.js') }}"></script>
  168.         <link rel="stylesheet" href="{{ asset('build/datatables-bs4-css.css') }}"/>#}
  169.         <script type="text/javascript" src="{{ asset('build/datatables-buttons-html5.js') }}"></script>
  170.         <link rel="stylesheet" href="{{ asset('build/datatables-buttons-html5-css.css') }}"/>
  171.         <!--  <link rel="stylesheet" href="https://cdn.datatables.net/1.10.18/css/dataTables.bootstrap4.min.css"/>
  172.         <script type="text/javascript" src="https://cdn.datatables.net/1.10.18/js/jquery.dataTables.min.js"></script>
  173.         <script type="text/javascript" src="https://cdn.datatables.net/1.10.18/js/dataTables.bootstrap4.min.js"></script>
  174.         -->
  175.        <!-- <link rel="stylesheet" href="https://cdn.datatables.net/1.10.18/css/jquery.dataTables.min.css" />
  176.         <script type="text/javascript" src="https://cdn.datatables.net/1.10.18/js/jquery.dataTables.min.js"></script>-->
  177.         {% block javascripts %}{% endblock %}
  178.     </body>
  179. </html>