<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">        
        <title>Vision - {% block title %}{% trans %}page_title{% endtrans %}{% endblock %}</title>
        <!-- HTML5 Shim and Respond.js IE11 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
        <!--[if lt IE 11]>
            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
            <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
            <![endif]-->
        <!-- Meta -->

        <meta name="description" content="Vision, web software for public services">
        <meta name="author" content="@GameXperiencefr @Xbird_">

        <meta name="twitter:card" content="summary_large_image" />
        <meta name="twitter:site" content="{{ app.request.requesturi }}" />
        <meta name="twitter:title" content="Vision - {{ block('title') }}" />
        <meta name="twitter:description" content="Vision {{ vision_version() }}, web software for public services" />
        <meta name="twitter:image" content="{{ asset('img/vision_long_2100x250.svg') }}" />
        <meta name="og:title" content="Vision - {{ block('title') }}" />
        <meta name="og:url" content="{{ app.request.requesturi }}" />
        <meta name="og:site_name" content="Vision - {{ block('title') }}" />
        <meta name="og:description" content="Vision {{ vision_version() }}, web software for public services" />
        <meta name="og:type" content="Website" />
        <meta name="og:image" content="{{ asset('img/vision_long_2100x250.svg') }}" />

        <!-- Favicon icon -->
        <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
        <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
        <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
        <link rel="manifest" href="/site.webmanifest">
        <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
        <meta name="msapplication-TileColor" content="#603cba">
        <meta name="theme-color" content="#ffffff">



        <!-- font css -->
        <link rel="stylesheet" href="{{ asset('fonts/feather.css') }}">
        <link rel="stylesheet" href="{{ asset('fonts/fontawesome.css') }}">
        <link rel="stylesheet" href="{{ asset('fonts/material.css') }}">

        <!-- theme css -->
        <link rel="stylesheet" href="{{ asset('css/style.css') }}" id="main-style-link">
        <link rel="stylesheet" href="{{ asset('css/custom.css') }}">
        
        {% block stylesheets %} {% endblock %}
        
        {% if app.request.attributes.get('_route') is not null %}
          {% set currentPath = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
        {% else %}
          {% set currentPath = null %}
        {% endif %}
    </head>
    <body>

      <!-- [ Pre-loader ] start -->
      <div class="loader-bg">
        <div class="loader-track">
            <div class="loader-fill"></div>
        </div>
      </div>
      <!-- [ Pre-loader ] End -->   
      {% if app.user and shared is not defined%} <!-- [ user is connected ] Start -->
      <!-- [ Mobile header ] start -->
      <div class="pc-mob-header pc-header">
        <div class="pcm-logo">
          <a href="{{ path('home') }}"><img src="{{ asset('img/vision_long_2100x250.svg') }}" alt="" class="logo logo-lg img-fluid"></a>
        </div>
        <div class="pcm-toolbar">
          <a href="#!" class="pc-head-link" id="mobile-collapse">
            <div class="hamburger hamburger--arrowturn">
              <div class="hamburger-box">
                <div class="hamburger-inner"></div>
              </div>
            </div>
          </a>
          {% if is_granted('IS_IMPERSONATOR') or is_granted('ROLE_ADMIN') %}
          <a href="#!" class="pc-head-link" id="headerdrp-collapse">
            <i data-feather="align-right"></i>
          </a>
          {% endif %}
          <a href="#!" class="pc-head-link {% if user_notifications_count > 0 %}pulse{% endif %}" id="header-collapse">
            <i data-feather="more-vertical"></i>
          </a>
        </div>
      </div>
      <!-- [ Mobile header ] End -->

      <!-- [ navigation menu ] start -->
      <nav class="pc-sidebar ">
        <div class="navbar-wrapper">
          <div class="m-header">
            <a href="{{ path('home') }}" class="b-brand">              
              <img src="{{ asset('img/vision_long_2100x250.svg') }}" alt="VISION" class="logo logo-lg">
              <img src="{{ asset('img/vision_logo_500x500.svg') }}" alt="VISION" class="logo logo-sm">
            </a>
          </div>
          <div class="navbar-content">
            <ul class="pc-navbar">
              <li class="pc-item pc-caption">
                <label>{% trans %}title_navigation{% endtrans %}</label>
              </li>
              <li class="pc-item">
                <a href="{{ path('home') }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">home</i></span><span class="pc-mtext">{% trans %}title_home{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('user_list') }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">view_list</i></span><span class="pc-mtext">{% trans %}title_book{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('directory_list') }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">account_box</i></span><span class="pc-mtext">{% trans %}title_directories{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'folder'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">folder_special</i></span><span class="pc-mtext">{% trans %}title_folders{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'gang'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">accessible</i></span><span class="pc-mtext">{% trans %}title_gangs{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'report'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">sticky_note_2</i></span><span class="pc-mtext">{% trans %}title_reports{% endtrans %}</span></a>
              </li>              
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'certificate'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">content_paste</i></span><span class="pc-mtext">{% trans %}title_certificates{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'complaint'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">feedback</i></span><span class="pc-mtext">{% trans %}title_complaints{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'infringement'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">paid</i></span><span class="pc-mtext">{% trans %}title_infringements{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'licencewithdrawal'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">local_police</i></span><span class="pc-mtext">{% trans %}title_licencewithdrawals{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'jail'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">receipt</i></span><span class="pc-mtext">{% trans %}title_jails{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'bracelet'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">share_location</i></span><span class="pc-mtext">{% trans %}title_bracelets{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'criminal'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">policy</i></span><span class="pc-mtext">{% trans %}title_criminals{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'stolenvehicle'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">taxi_alert</i></span><span class="pc-mtext">{% trans %}title_stolen_vehicles{% endtrans %}</span></a>
              </li>              
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'medical'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">vaccines</i></span><span class="pc-mtext">{% trans %}title_medicals{% endtrans %}</span></a>
              </li>
              
              {% if app.user.hasPermission('group_administrate') %}
              <li class="pc-item pc-caption">
                <label>{% trans %}title_management{% endtrans %}</label>
                <span>{% trans %}subtitle_management{% endtrans %}</span>
              </li>
              <li class="pc-item">
                <a href="{{ path('group_index') }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">engineering</i></span><span class="pc-mtext">{% trans %}title_general{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'template'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">description</i></span><span class="pc-mtext">{% trans %}title_templates{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('document_list', {type: 'sanction'}) }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">warning</i></span><span class="pc-mtext">{% trans %}title_sanctions{% endtrans %}</span></a>
              </li>
              {% endif %}

              {% if is_granted('ROLE_ADMIN') %}
              <li class="pc-item pc-caption">
                <label>{% trans %}title_administration{% endtrans %}</label>
                <span>{% trans %}subtitle_administration{% endtrans %}</span>
              </li>
              <li class="pc-item">
                <a href="{{ path('admin_index') }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">dashboard</i></span><span class="pc-mtext">{% trans %}title_dashboard{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('admin_user_list') }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">person</i></span><span class="pc-mtext">{% trans %}title_users{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('admin_group_list') }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">people</i></span><span class="pc-mtext">{% trans %}title_groups{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('admin_watchdog') }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">fingerprint</i></span><span class="pc-mtext">{% trans %}title_watchdog{% endtrans %}</span></a>
              </li>
              <li class="pc-item">
                <a href="{{ path('admin_logs') }}" class="pc-link"><span class="pc-micon"><i class="material-icons-two-tone">list</i></span><span class="pc-mtext">{% trans %}title_logs{% endtrans %}</span></a>
              </li>
              {% endif %}
              <li class="pc-item pc-caption">
                <label><hr></label>
                <span>Vision: {{ vision_version() }}</span>
              </li>

            </ul>
          </div>
        </div>
      </nav>
      <!-- [ navigation menu ] end -->

      <!-- [ Header ] start -->
      <header class="pc-header">
        <div class="header-wrapper">
          
          <div class="me-auto pc-mob-drp">            
            <ul class="list-unstyled">
              {% if is_granted('ROLE_ADMIN') %}              
              <li class="pc-h-item">
                {% if app.user.adminmode %}
                <a class="pc-head-link active arrow-none me-0" href="{{ path('admin_mode') }}" role="button">
                  <i class="fas fa-user-tie me-2 text-success"></i> {% trans %}adminmode_exit{% endtrans %}
                </a>
                {% else %}
                <a class="pc-head-link active arrow-none me-0" href="{{ path('admin_mode') }}" role="button">
                  <i class="fas fa-user-tie me-2 text-danger"></i> {% trans %}adminmode_enter{% endtrans %}
                </a>
                {% endif %}
              </li>
              {% endif %}
              {% if is_granted('IS_IMPERSONATOR') %}
              <li class="pc-h-item">                
                <a class="pc-head-link active arrow-none me-0" href="{{ impersonation_exit_path() }}" role="button">
                  <i class="fas fa-user-secret me-2 text-success"></i> {% trans %}impersonation_exit{% endtrans %}
                </a>                
              </li>
              {% endif %}
            </ul>
          </div>
          
          <div class="ms-auto">
            <ul class="list-unstyled">
              {% set groupLogo = 'img/nologo.png' %}
              {% if app.user.mainGroup %}
                {% if app.user.mainGroup.imageSize != 0 %}
                  {% set groupLogo = 'uploads/groups/' ~ app.user.mainGroup.imageName %}
                {% endif %}
              {% endif %}
              <li class="dropdown pc-h-item">
                <a class="pc-head-link dropdown-toggle arrow-none me-0" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
                  <img src="{{ asset(groupLogo) }}" alt="{% trans %}title_group{% endtrans %}" class="user-avtar {% if user_notifications_count > 0 %}pulse{% endif %}">                 
                  <span>
                    <span class="user-name">{% if app.user.mainRank %}{{ app.user.mainRank.shortname }}. {% endif %}{{ app.user.fullName }}                      
                    </span>
                    <span class="user-desc">{% if app.user.mainGroup %}{{ app.user.mainGroup.name }}{% endif %}</span>
                  </span>
                </a>
                <div class="dropdown-menu dropdown-menu-end pc-h-dropdown" style="margin: 0px;">
                  {% if user_notifications_count > 0 %}
                    {% for notif in user_notifications_list %}
                      <div class="dropdown-item notification_box">
                        {{ (notif.icon|trans)|raw }}
                        <span>{{ notif.content|raw }} <a href="{{ path('notification_markread', {'id': notif.id}) }}" class="mark-notification-readed text-success" data-bs-toggle="tooltip" data-placement="top"  title="{% trans %}tooltip_markread{% endtrans %}"><i class="fas fa-check"></i></a></span>
                      </div>                  
                    {% endfor %}
                    <hr />
                  {% endif %}
                  <a href="{{ path('me_index') }}" class="dropdown-item">
                    <i class="material-icons-two-tone">account_circle</i>
                    <span>{% trans %}title_profile{% endtrans %}</span>
                  </a>
                  <a href="{{ path('notification_list') }}" class="dropdown-item">
                    <i class="material-icons-two-tone">contactless</i>
                    <span>{% trans %}title_notifications{% endtrans %}</span>
                  </a>
                  <a href="{{ path('app_logout') }}" class="dropdown-item">
                    <i class="material-icons-two-tone">power_settings_new</i>
                    <span>{% trans %}title_logout{% endtrans %}</span>
                  </a>
                </div>
              </li>
            </ul>
          </div>
    
        </div>
        
      </header>
      <!-- [ Header ] end -->     
      <!-- [ Main Content ] start -->
      <div class="pc-container">
        <div class="pcoded-content">
            <!-- [ breadcrumb ] start -->
            <div class="page-header">
                <div class="page-block">
                    <div class="row align-items-center">
                        <div class="col-md-12">                            
                          {% include 'breadcrumb.html.twig' with {'items': null} %}
                        </div>
                    </div>
                </div>
            </div>
            <!-- [ breadcrumb ] end -->

            
            <div class="row mb-3">                
                <h5>{% block subtitle %}{{ block('title') }}{% endblock %}</h5>
                <hr>
            </div>
            <!-- [ page ] start -->
            {{ block('body') }}
            <!-- [ Page ] end -->
        </div>
      </div>
      <!-- [ Main Content ] end -->
      {% else %} <!-- [ user is connected (here : not)] else -->
        <!-- [ page ] start -->
        {{ block('body') }}
        <!-- [ Page ] end -->
      {% endif %} <!-- [ user is connected ] end -->
      
      <div  class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
        <div class="toast-container">
          {% for l, x in app.flashes %}
            {% for k, m in x %}
                <!-- [ toast ] start -->              
                    <div id="{{ l }}-{{ k }}" class="toast hide bg-{{ l }} text-black" role="alert" aria-live="assertive" aria-atomic="true">
                      <div class="toast-header bg-{{ l }} text-black">
                        {% if l == 'success' %}<i class="fas fa-check-circle"></i>
                            {% elseif l == 'danger' %}<i class="fas fa-times-circle"></i>
                            {% elseif l == 'warning' %}<i class="fas fa-exclamation-triangle"></i>                     
                            {% else %}<i class="fas fa-info-circle"></i>
                        {% endif %}&nbsp;
                        {% if l == 'success' %}<strong class="me-auto">{% trans %}alert_title_success{% endtrans %}</strong>
                            {% elseif l == 'danger' %}<strong class="me-auto">{% trans %}alert_title_danger{% endtrans %}</strong>
                            {% elseif l == 'warning' %}<strong class="me-auto">{% trans %}alert_title_warning{% endtrans %}</strong>                        
                            {% else %}<strong class="me-auto">{% trans %}alert_title_information{% endtrans %}</strong>
                        {% endif %}
                        <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
                      </div>
                      <div class="toast-body">
                        {{ m |trans }}
                      </div>
                    </div>                
                <!-- [ toast ] end -->
            {% endfor %}
        {% endfor %}
      </div>
    </div>

      <!-- [ Main Content ] end -->
    <!-- Warning Section start -->
    <!-- Older IE warning message -->
    <!--[if lt IE 11]>
        <div class="ie-warning">
            <h1>Warning!!</h1>
            <p>You are using an outdated version of Internet Explorer, please upgrade
               <br/>to any of the following web browsers to access this website.
            </p>
            <div class="iew-container">
                <ul class="iew-download">
                    <li>
                        <a href="http://www.google.com/chrome/">
                            <img src="img/browser/chrome.png" alt="Chrome">
                            <div>Chrome</div>
                        </a>
                    </li>
                    <li>
                        <a href="https://www.mozilla.org/en-US/firefox/new/">
                            <img src="img/browser/firefox.png" alt="Firefox">
                            <div>Firefox</div>
                        </a>
                    </li>
                    <li>
                        <a href="http://www.opera.com">
                            <img src="img/browser/opera.png" alt="Opera">
                            <div>Opera</div>
                        </a>
                    </li>
                    <li>
                        <a href="https://www.apple.com/safari/">
                            <img src="img/browser/safari.png" alt="Safari">
                            <div>Safari</div>
                        </a>
                    </li>
                    <li>
                        <a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie">
                            <img src="img/browser/ie.png" alt="">
                            <div>IE (11 & above)</div>
                        </a>
                    </li>
                </ul>
            </div>
            <p>Sorry for the inconvenience!</p>
        </div>
    <![endif]-->
    <!-- Warning Section Ends -->

    <!-- Required Js -->
    <script src="{{ asset('js/vendor-all.min.js') }}"></script>
    <script src="{{ asset('js/plugins/bootstrap.bundle.min.js') }}"></script>
    <script src="{{ asset('js/plugins/feather.min.js') }}"></script>
    <script src="{{ asset('js/pcoded.min.js') }}"></script>    
    <script src="{{ asset('js/tinymce/tinymce.min.js') }}"></script>    
    <script src="{{ asset('js/bs5-lightbox.bundle.min.js') }}"></script>
    <script src="{{ asset('js/custom.js') }}"></script>

    {% block javascripts %}{% endblock %}
    </body>
</html>
