mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
PHRAS-2608 #comment Fix custom-link of nav-bar on responsive, hide the Navigation bar if there is no sub menu #time 2h
This commit is contained in:
@@ -20,123 +20,188 @@
|
||||
</li>
|
||||
<li class="show-menu" id="toggle-menu-main">
|
||||
<img src="/assets/common/images/icons/menu-burger.png"/>
|
||||
</li>
|
||||
<div id="nav_menu_container" class="desktopmenu">
|
||||
<div class="arrow-up"></div>
|
||||
<ol class="nav_menu">
|
||||
{% if module is defined and module != "lightbox" and app.getAuthenticator().isAuthenticated() %}
|
||||
<li class="menu-bar-item">
|
||||
<a target="_blank" href="{{ path('prod') }}">
|
||||
<img src="/assets/common/images/icons/menu-prod.png" class="mobilemenu"/>
|
||||
<span class="{% if module is defined and module == "prod" %}selected{% endif %}">
|
||||
{{ 'admin::monitor: production' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{% if app['browser'].isNewGeneration and app['conf'].get(['registry', 'modules', 'thesaurus']) == true and app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('thesaurus') %}
|
||||
<div id="nav_menu_container" class="desktopmenu">
|
||||
<div class="arrow-up"></div>
|
||||
<ol class="nav_menu">
|
||||
{% if module is defined and module != "lightbox" and app.getAuthenticator().isAuthenticated() %}
|
||||
<li class="menu-bar-item">
|
||||
<a target="_blank" href="{{ path('thesaurus') }}">
|
||||
<img src="/assets/common/images/icons/menu-thesaurus.png" class="mobilemenu"/>
|
||||
<span class="{% if module is defined and module == "thesaurus" %}selected{% endif %}">
|
||||
{{ 'admin::monitor: module thesaurus' | trans }}
|
||||
</span>
|
||||
<a target="_blank" href="{{ path('prod') }}">
|
||||
<img src="/assets/common/images/icons/menu-prod.png" class="mobilemenu"/>
|
||||
<span class="{% if module is defined and module == "prod" %}selected{% endif %}">
|
||||
{{ 'admin::monitor: production' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{# MODULE #}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('admin') %}
|
||||
<li class="menu-bar-item">
|
||||
<a target="_blank" href="{{ path('admin') }}">
|
||||
<img src="/assets/common/images/icons/menu-admin.png" class="mobilemenu"/>
|
||||
<span class="{% if module is defined and module == "admin" %}selected{% endif %}">
|
||||
{{ 'admin::monitor: module admin' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{# MODULE #}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('report') %}
|
||||
<li class="menu-bar-item">
|
||||
<a target="_blank" href="{{ path('report_dashboard') }}">
|
||||
<img src="/assets/common/images/icons/menu-report.png" class="mobilemenu"/>
|
||||
<span class="{% if module is defined and module == "report" %}selected{% endif %}">
|
||||
{{ 'admin::monitor: module report' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{# MODULE #}
|
||||
<li class="menu-bar-item">
|
||||
<a id="validation_link" target="_blank" href="{{ path('lightbox') }}">
|
||||
<img src="/assets/common/images/icons/menu-lightbox.png" class="mobilemenu"/>
|
||||
<span>
|
||||
{{ 'admin::monitor: module validation' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{# MODULE #}
|
||||
{% if module is defined and module == "prod" %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('upload') %}
|
||||
{% if app['browser'].isNewGeneration and app['conf'].get(['registry', 'modules', 'thesaurus']) == true and app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('thesaurus') %}
|
||||
<li class="menu-bar-item">
|
||||
{% set link = path('upload_html5_form') %}
|
||||
|
||||
{% if not app['browser'].supportFileAPI() %}
|
||||
{% set link = path('upload_flash_form') %}
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ link }}" class="uploader-open-action" title="{{ 'Upload' | trans }}">
|
||||
<img src="/assets/common/images/icons/menu-upload.png" class="mobilemenu"/>
|
||||
<span>
|
||||
{{ 'admin::monitor: module upload' | trans }}
|
||||
</span>
|
||||
<a target="_blank" href="{{ path('thesaurus') }}">
|
||||
<img src="/assets/common/images/icons/menu-thesaurus.png" class="mobilemenu"/>
|
||||
<span class="{% if module is defined and module == "thesaurus" %}selected{% endif %}">
|
||||
{{ 'admin::monitor: module thesaurus' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{# MODULE #}
|
||||
{% if module == "prod" %}
|
||||
|
||||
{# MODULE #}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('admin') %}
|
||||
<li class="menu-bar-item">
|
||||
<a target="_blank" href="{{ path('admin') }}">
|
||||
<img src="/assets/common/images/icons/menu-admin.png" class="mobilemenu"/>
|
||||
<span class="{% if module is defined and module == "admin" %}selected{% endif %}">
|
||||
{{ 'admin::monitor: module admin' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{# MODULE #}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('report') %}
|
||||
<li class="menu-bar-item">
|
||||
<a target="_blank" href="{{ path('report_dashboard') }}">
|
||||
<img src="/assets/common/images/icons/menu-report.png" class="mobilemenu"/>
|
||||
<span class="{% if module is defined and module == "report" %}selected{% endif %}">
|
||||
{{ 'admin::monitor: module report' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{# MODULE #}
|
||||
<li class="menu-bar-item">
|
||||
<a href="#" class="state-navigation" data-state="publication">
|
||||
<img src="/assets/common/images/icons/menu-publication.png" class="mobilemenu"/>
|
||||
<a id="validation_link" target="_blank" href="{{ path('lightbox') }}">
|
||||
<img src="/assets/common/images/icons/menu-lightbox.png" class="mobilemenu"/>
|
||||
<span>
|
||||
{{ 'Publications' | trans }}
|
||||
{{ 'admin::monitor: module validation' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if module is defined and module == "prod" and app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::ORDER_MASTER')) %}
|
||||
<li class="menu-bar-item">
|
||||
<a href="#" class="order-open-action" title="{{ 'Orders manager' | trans }}">
|
||||
<span>
|
||||
{{ 'Commandes' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{# MODULE #}
|
||||
{% if module is defined and module == "prod" %}
|
||||
{% if app.getAclForUser(app.getAuthenticatedUser()).has_access_to_module('upload') %}
|
||||
<li class="menu-bar-item">
|
||||
{% set link = path('upload_html5_form') %}
|
||||
|
||||
{% endif %}
|
||||
</ol>
|
||||
</div>
|
||||
<li class="show-menu" id="toggle-menu-link">
|
||||
{% if not app['browser'].supportFileAPI() %}
|
||||
{% set link = path('upload_flash_form') %}
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ link }}" class="uploader-open-action" title="{{ 'Upload' | trans }}">
|
||||
<img src="/assets/common/images/icons/menu-upload.png" class="mobilemenu"/>
|
||||
<span>
|
||||
{{ 'admin::monitor: module upload' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{# MODULE #}
|
||||
{% if module == "prod" %}
|
||||
<li class="menu-bar-item">
|
||||
<a href="#" class="state-navigation" data-state="publication">
|
||||
<img src="/assets/common/images/icons/menu-publication.png" class="mobilemenu"/>
|
||||
<span>
|
||||
{{ 'Publications' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if module is defined and module == "prod" and app.getAclForUser(app.getAuthenticatedUser()).has_right(constant('\\ACL::ORDER_MASTER')) %}
|
||||
<li class="menu-bar-item">
|
||||
<a href="#" class="order-open-action" title="{{ 'Orders manager' | trans }}">
|
||||
<span>
|
||||
{{ 'Commandes' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
<li class="show-menu" id="toggle-menu-link" style="display: none">
|
||||
<img src="/assets/common/images/icons/menu-web-site.png"/>
|
||||
<div id="nav_customlink_container" class="mobile-link">
|
||||
<div class="arrow-up"></div>
|
||||
<div class="nav-wrapper-box">
|
||||
<ol class="nav_menu"></ol>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="show-menu" id="toggle-menu-account" style="float: right;margin-right: 16px;">
|
||||
<img src="/assets/common/images/icons/menu-user.png"/>
|
||||
</li>
|
||||
<div id="nav_customlink_container">
|
||||
<div class="arrow-up"></div>
|
||||
<div class="nav-wrapper-box">
|
||||
<ol class="nav_menu"></ol>
|
||||
<div class="PNB right mobilemenu" id="nav_account_container">
|
||||
<div class="arrow-up"></div>
|
||||
<div class="nav-wrapper-box">
|
||||
<ol class="nav_menu">
|
||||
|
||||
<li class="menu-bar-item">
|
||||
{% if app.getAuthenticator().isAuthenticated() %}
|
||||
{% if app.getAuthenticatedUser().isGuest %}
|
||||
<img src="/assets/common/images/icons/menu-name-user.png"/>
|
||||
<span>
|
||||
{{ 'Guest' | trans }}
|
||||
</span>
|
||||
{% else %}
|
||||
<a target="_blank" href="{{ path('account') }}" title="{{ 'login:: Mon compte' | trans }}">
|
||||
<img src="/assets/common/images/icons/menu-name-user.png"/>
|
||||
<span>
|
||||
{{ app.getAuthenticatedUser().getDisplayName() }}
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="menu-bar-item">
|
||||
{% if app.getAuthenticator().isAuthenticated() %}
|
||||
<a href="{{ path('logout', { 'redirect' : '..' ~ app['request'].getPathInfo() }) }}"
|
||||
target="_self">
|
||||
<img src="/assets/common/images/icons/menu-logout.png"/>
|
||||
<span>
|
||||
{{ 'phraseanet:: deconnection' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="menu-bar-item">
|
||||
<a target="_blank" href="https://docs.phraseanet.com/4.0/">
|
||||
<img src="/assets/common/images/icons/menu-help.png"/>
|
||||
<span>
|
||||
{{ 'phraseanet:: aide' | trans }}
|
||||
<span style="display:inline-block;cursor:pointer;padding:0;border:none;padding-right:4px;padding-left:4px;"
|
||||
id="help-trigger"></span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% if module is defined and module == "prod" %}
|
||||
<li class="menu-bar-item">
|
||||
<a href="#">
|
||||
<img src="/assets/common/images/icons/menu-help.png"/>
|
||||
<span style="" class="shortcuts-trigger">
|
||||
{{ 'phraseanet:: raccourcis clavier' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="menu-bar-item">
|
||||
<a href="#">
|
||||
<img src="/assets/common/images/icons/menu-help.png"/>
|
||||
<span style="" class="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'> © Copyright Alchemy 2005-{{ "now"|date("Y") }}</a><p style='margin-top: 10px' ><a href='../../gitlog.txt' target='_blank'>gitlog</a></p></div>">{{ 'phraseanet:: a propos' | trans }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
@@ -232,70 +297,6 @@
|
||||
</li>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="PNB right mobilemenu" id="nav_account_container">
|
||||
<div class="arrow-up"></div>
|
||||
<div class="nav-wrapper-box">
|
||||
<ol class="nav_menu">
|
||||
|
||||
<li class="menu-bar-item">
|
||||
{% if app.getAuthenticator().isAuthenticated() %}
|
||||
{% if app.getAuthenticatedUser().isGuest %}
|
||||
<img src="/assets/common/images/icons/menu-name-user.png"/>
|
||||
<span>
|
||||
{{ 'Guest' | trans }}
|
||||
</span>
|
||||
{% else %}
|
||||
<a target="_blank" href="{{ path('account') }}" title="{{ 'login:: Mon compte' | trans }}">
|
||||
<img src="/assets/common/images/icons/menu-name-user.png"/>
|
||||
<span>
|
||||
{{ app.getAuthenticatedUser().getDisplayName() }}
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="menu-bar-item">
|
||||
{% if app.getAuthenticator().isAuthenticated() %}
|
||||
<a href="{{ path('logout', { 'redirect' : '..' ~ app['request'].getPathInfo() }) }}"
|
||||
target="_self">
|
||||
<img src="/assets/common/images/icons/menu-logout.png"/>
|
||||
<span>
|
||||
{{ 'phraseanet:: deconnection' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="menu-bar-item">
|
||||
<a target="_blank" href="https://docs.phraseanet.com/4.0/">
|
||||
<img src="/assets/common/images/icons/menu-help.png"/>
|
||||
<span>
|
||||
{{ 'phraseanet:: aide' | trans }}
|
||||
<span style="display:inline-block;cursor:pointer;padding:0;border:none;padding-right:4px;padding-left:4px;"
|
||||
id="help-trigger"></span>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% if module is defined and module == "prod" %}
|
||||
<li class="menu-bar-item">
|
||||
<a href="#">
|
||||
<img src="/assets/common/images/icons/menu-help.png"/>
|
||||
<span style="" class="shortcuts-trigger">
|
||||
{{ 'phraseanet:: raccourcis clavier' | trans }}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="menu-bar-item">
|
||||
<a href="#">
|
||||
<img src="/assets/common/images/icons/menu-help.png"/>
|
||||
<span style="" class="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'> © Copyright Alchemy 2005-{{ "now"|date("Y") }}</a><p style='margin-top: 10px' ><a href='../../gitlog.txt' target='_blank'>gitlog</a></p></div>">{{ 'phraseanet:: a propos' | trans }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if app.getAuthenticator().isAuthenticated() and module == "prod" %}
|
||||
@@ -312,10 +313,15 @@
|
||||
//seperate array based on location of link
|
||||
var seperatedLinksByLocation = _.groupBy(configurationSettingLinks, "linkLocation");
|
||||
|
||||
|
||||
for (key in seperatedLinksByLocation) {
|
||||
if (key === 'navigation-bar') {
|
||||
var sortedCustomLinks = _.sortBy(seperatedLinksByLocation[key], 'linkOrder');
|
||||
|
||||
/*show navigation-bar if there is some result*/
|
||||
console.log(sortedCustomLinks);
|
||||
if (sortedCustomLinks != undefined ) {
|
||||
$('#toggle-menu-link').show();
|
||||
}
|
||||
_.each(sortedCustomLinks, function (linksData) {
|
||||
if (linksData.linkLanguage == 'all' || linksData.linkLanguage === '{{ app['locale'] }}') {
|
||||
var styleAttr = "";
|
||||
|
Reference in New Issue
Block a user