Add new menu instance for user related links.

This commit is contained in:
Roberto Rosario
2016-11-10 23:32:43 -04:00
parent aa2e8f3a11
commit d4a95ddb8b
7 changed files with 62 additions and 43 deletions
@@ -68,11 +68,32 @@
{% endfor %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if not request.user.is_authenticated %}
{% trans 'Anonymous' %}
{% else %}
<li><a href="{% url 'common:current_user_details' %}" title="{% trans 'User details' %}">{{ request.user.get_full_name|default:request.user }} <i class="fa fa-user"></i></a></li>
{% endif %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="true">
{% if not request.user.is_authenticated %}
{% trans 'Anonymous' %}
{% else %}
{{ request.user.get_full_name|default:request.user }} <i class="fa fa-user"></i>
{% endif %}
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
{% get_menu_links 'user menu' as menu_links %}
{% for link_set in menu_links %}
{% for link in link_set %}
{% with 'true' as as_li %}
{% with 'true' as hide_active_anchor %}
{% with 'first' as li_class_first %}
{% with ' ' as link_classes %}
{% include 'navigation/generic_subnavigation.html' %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endwith %}
{% endfor %}
{% endfor %}
</ul>
</li>
</ul>
</div>
</div>
@@ -1,5 +1,9 @@
{% if link.disabled %}
<a class="{% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if 'new_window' in link.tags %}new_window{% endif %} {% if link.active %}{{ link_class_active }}{% endif %}" disabled='disabled' style="cursor: default;" href="#">{% if link.icon %}<i class="hidden-xs hidden-sm {{ link.icon }}"></i> {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %}&nbsp;{% endif %}{% endif %}
{% if link.separator %}
<li role="separator" class="divider"></li>
{% else %}
<a class="{% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %}" href="{{ link.url }}">{% if link.icon %}<i class="hidden-xs hidden-sm {{ link.icon }}"></i> {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %}&nbsp;{% endif %}{% endif %}
{% if link.disabled %}
<a class="{% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if 'new_window' in link.tags %}new_window{% endif %} {% if link.active %}{{ link_class_active }}{% endif %}" disabled='disabled' style="cursor: default;" href="#">{% if link.icon %}<i class="hidden-xs hidden-sm {{ link.icon }}"></i> {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %}&nbsp;{% endif %}{% endif %}
{% else %}
<a class="{% if link_classes %}{{ link_classes }} {% else %}btn {% if 'dangerous' in link.tags %}btn-danger{% else %}btn-primary{% endif %} btn-xs{% endif %} {% if link.active %}{{ link_class_active }}{% endif %}" href="{{ link.url }}">{% if link.icon %}<i class="hidden-xs hidden-sm {{ link.icon }}"></i> {% endif %}{{ link.text }}{% if link.error %} - {{ link.error }}{% endif %}</a>{% if horizontal %}{% if not forloop.last %}&nbsp;{% endif %}{% endif %}
{% endif %}
{% endif %}