<div id="mainMenu" class="PNB">
    <div class="PNB" style="right:auto;overflow:hidden;">
      <ol>
        <li>
            <span class="title {% if module == "prod" %}selected{% endif %}">
              {%  block menu_bar_title %}Phraseanet{% endblock %}
            </span>
        </li>
        {% if module != "lightbox" and app['authentication'].isAuthenticated() %}
          <li>
            {% if module == "prod" %}
              <a target="_self" href="{{ path('get_client') }}">
                <span class="">
                  {% trans 'admin::monitor: Ancienne version (client)' %}
                </span>
              </a>
            {% else %}
              {% if app['browser'].isNewGeneration %}
                {% if module == "client" %}
                  <a target="_self" href="{{ path('prod') }}">
                    <span class="">
                      {% trans 'admin::monitor: Nouvelle version (prod)' %}
                    </span>
                  </a>
                {% else %}
                  <a target="_blank" href="{{ path('prod') }}">
                    <span class="">
                      {% trans 'admin::monitor: production' %}
                    </span>
                  </a>
                {% endif %}
              {% endif %}
            {% endif %}
          </li>

          {% if app['browser'].isNewGeneration and app['phraseanet.registry'].get('GV_thesaurus') == true and app['authentication'].getUser().ACL.has_access_to_module('thesaurus') %}
          <li>
            <a target="_blank" href="{{ path('thesaurus') }}">
              <span class="{% if module == "thesaurus" %}selected{% endif %}">
              {% trans 'admin::monitor: module thesaurus' %}
              </span>
            </a>
          </li>
          {% endif %}


          {# MODULE #}
          {% if app['authentication'].getUser().ACL.has_access_to_module('admin') %}
          <li>
            <a target="_blank" href="{{ path('admin') }}">
              <span class="{% if module == "admin" %}selected{% endif %}">
                {% trans 'admin::monitor: module admin' %}
              </span>
            </a>
          </li>
          {% endif %}

          {# MODULE #}
          {% if app['authentication'].getUser().ACL.has_access_to_module('report') %}
          <li>
            <a target="_blank" href="{{ path('report_dashboard') }}">
              <span class="{% if module == "report" %}selected{% endif %}">
                {% trans 'admin::monitor: module report' %}
              </span>
            </a>
          </li>
          {% endif %}

          {# MODULE #}
          <li>
            <a id="validation_link" target="_blank" href="{{ path('lightbox') }}">
              <span>
              {% trans 'admin::monitor: module validation' %}
              </span>
            </a>
          </li>

          {# MODULE #}
          {% if module == "prod" %}
            {% if app['authentication'].getUser().ACL.has_access_to_module('upload') %}
            <li>
                {% set link = path('upload_form') %}

                {% if not app['browser'].supportFileAPI() %}
                    {% set link = path('upload_flash_form') %}
                {% endif %}

                <a  href="{{ link }}" class="dialog full-dialog" title="{% trans 'Upload' %}">
                <span>
                    {% trans 'admin::monitor: module upload' %}
                </span>
                </a>
            </li>
            {% endif %}
          {% endif %}

          {# MODULE #}
          {% if module == "prod" or module == "client" %}
          <li>
            <a href="#" onclick="getHome('PUBLI');" >
              <span>
                {% trans 'Publications' %}
              </span>
            </a>
          </li>
          {% endif %}

          {% if module == "prod" and app['authentication'].getUser().ACL.has_right('order_master') %}
          <li>
            <a href="{{ path('prod_orders') }}" class="dialog full-dialog" title="{% trans 'Orders manager' %}">
              <span>
                {% trans 'Commandes' %}
              </span>
            </a>
          </li>
          {% endif %}

        {% endif %}
      </ol>

    </div>
    <div class="PNB" style="left:auto;overflow:hidden;">
      <ol>

    {% if app['authentication'].isAuthenticated()  and (module == "client" or module == "prod") %}
        <li id="notification_trigger">
          <a href="#" style="font-weight:bold;text-decoration:none;">
            <span>
              {% trans 'Notifications' %}
              <button class="counter btn btn-danger" style="visibility:{% if app['events-manager'].get_unread_notifications_number > 0 %}visible{% else %}hidden{% endif %};">
                  {% if app['events-manager'].get_unread_notifications_number > 0 %}
                    {{app['events-manager'].get_unread_notifications_number}}
                  {% endif %}
              </button>
            </span>
          </a>
        </li>
    {% endif %}
        <li>
          {% if app['authentication'].isAuthenticated() %}
            {% if app['authentication'].getUser().is_guest %}
              <span>
                {% trans 'Guest' %}
              </span>
            {% else %}
              <a target="_blank" href="{{ path('account') }}" title="{% trans 'login:: Mon compte' %}">
                <span>
                  {{app['authentication'].getUser().get_login()}}
                </span>
              </a>
            {% endif %}
          {% endif %}
        </li>
        <li>
          <a target="_blank" href="https://docs.phraseanet.com/3.8/">
            <span>
              {% trans 'phraseanet:: aide' %}
              <span style="display:inline-block;cursor:pointer;padding:0;border:none;" id="help-trigger"> &#9660;</span>
            </span>
          </a>
          <table cellspacing="0" cellpadding="0" style="display:none;" class="contextMenu helpcontextmenu">
              <tbody>
                  <tr>
                      <td>
                          <div class="context-menu context-menu-theme-vista">
                          {% if module == "prod" %}
                              <div title="" class="context-menu-item menu3-custom-item">
                                  <div style="" class="context-menu-item-inner shortcuts-trigger">
                                          {% trans 'phraseanet:: raccourcis clavier' %}
                                  </div>
                              </div>
                          {% endif %}
                              <div title="" class="context-menu-item menu3-custom-item">
                                  <div style="" class="context-menu-item-inner infoDialog" infos="<div><span style='font-size:18px;'>PHRASEANET</span> {{ app['phraseanet.version'].getName() }} (V{{ app['phraseanet.version'].getNumber() }})</div><div></div><br/><div><a href='http://www.gnu.org/licenses/gpl.html' target='_blank'><img src='http://www.gnu.org/graphics/gplv3-88x31.png' style='vertical-align:middle;'/><span>License GNU GPL v3</span></a></div><br/><div><a href='http://www.phraseanet.com/' target='_blank'>  &copy; Copyright Alchemy 2005-{{ "now"|date("Y") }}</a></div>">{% trans 'phraseanet:: a propos' %}</div>
                              </div>
                          </div>
                      </td>
                  </tr>
              </tbody>
          </table>
        </li>
        <li>
        {% if app['authentication'].isAuthenticated() %}
          <a href="{{ path('logout', { 'redirect' : '..' ~ app['request'].getPathInfo() }) }}" target="_self">
            <span>
              {% trans 'phraseanet:: deconnection' %}
            </span>
          </a>
        {% endif %}
        </li>
      </ol>
    </div>
</div>

 {% if app['authentication'].isAuthenticated()  and (module == "client" or module == "prod") %}
    <div style="display:none;z-index:30000;" id="notification_box">
        {% set notifications = app['events-manager'].get_notifications %}
        {% include 'prod/notifications.html.twig' %}
    </div>
{% endif %}
