Commit 25597ab5 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE

refactoring login menu so it can be moved easily

parent c553ce0f
......@@ -39,27 +39,7 @@
</ul>
<ul class="nav navbar-nav navbar-right">
{% block extra_li_dropdown_right %}{% endblock %}
{%if not request.user.is_authenticated %}
<li class="nav-item"><a class="nav-link" href="{% url 'basetheme_bootstrap:login'%}?next={{ request.path|urlencode }}">{% block sign_in_word %}{%trans "Login "%}{% endblock %}<i class="fa fa-sign-in"></i></a></li>
{%else%}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle"
href="#"
id="dropdown-user"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
><i class="fa fa-user-circle-o"></i> <span class="caret"></span></a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-user">
{%if request.user.is_staff %}
<a class="dropdown-item" href="/admin/"><i class="fa fa-cogs"></i> {%trans "Admin"%}</a>
<div class="dropdown-divider"></div>
{%endif%}
<a class="dropdown-item" href="{% url 'basetheme_bootstrap:account'%}"><i class="fa fa-user-circle-o"></i> {%trans "Account"%}</a>
<a class="dropdown-item" href="{% url 'basetheme_bootstrap:logout'%}"><i class="fa fa-sign-out"></i> {%trans "Logout"%}</a>
</div>
</li>
{%endif%}
{% include_if_exists "login_menu.html"|localize_template "basetheme_bootstrap/login_menu.html" %}
</ul>
{% block form_in_nav_bar %}
<!--<form class="form-inline mt-2 mt-md-0">-->
......
......@@ -45,27 +45,9 @@
</form>
{% endblock %}
<ul class="nav navbar-nav navbar-right">
{%if not request.user.is_authenticated %}
<li class="nav-item"><a class="nav-link" href="{% url 'basetheme_bootstrap:login'%}?next={{ request.path|urlencode }}">{% block sign_in_word %}{%trans "Login "%}{% endblock %}<i class="fa fa-sign-in"></i></a></li>
{%else%}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle"
href="#"
id="dropdown-user"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
><i class="fa fa-user-circle-o"></i> <span class="caret"></span></a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-user">
{%if request.user.is_staff %}
<a class="dropdown-item" href="/admin/"><i class="fa fa-cogs"></i> {%trans "Admin"%}</a>
<div class="dropdown-divider"></div>
{%endif%}
<a class="dropdown-item" href="{% url 'basetheme_bootstrap:account'%}"><i class="fa fa-user-circle-o"></i> {%trans "Account"%}</a>
<a class="dropdown-item" href="{% url 'basetheme_bootstrap:logout'%}"><i class="fa fa-sign-out"></i> {%trans "Logout"%}</a>
</div>
</li>
{%endif%}
{% block li_dropdown_right_in_first_header_top %}
{% include_if_exists "login_menu.html"|localize_template "basetheme_bootstrap/login_menu.html" %}
{% endblock li_dropdown_right_in_first_header_top %}
</ul>
</div>
</nav>
......
{% load i18n %}
{%if not request.user.is_authenticated %}
<li class="nav-item"><a class="nav-link" href="{% url 'basetheme_bootstrap:login'%}?next={{ request.path|urlencode }}">{% block sign_in_word %}{%trans "Login "%}{% endblock %}<i class="fa fa-sign-in"></i></a></li>
{%else%}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle"
href="#"
id="dropdown-user"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
><i class="fa fa-user-circle-o"></i> <span class="caret"></span></a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-user">
{%if request.user.is_staff %}
<a class="dropdown-item" href="/admin/"><i class="fa fa-cogs"></i> {%trans "Admin"%}</a>
<div class="dropdown-divider"></div>
{%endif%}
<a class="dropdown-item" href="{% url 'basetheme_bootstrap:account'%}"><i class="fa fa-user-circle-o"></i> {%trans "Account"%}</a>
<a class="dropdown-item" href="{% url 'basetheme_bootstrap:logout'%}"><i class="fa fa-sign-out"></i> {%trans "Logout"%}</a>
</div>
</li>
{%endif%}
\ No newline at end of file
......@@ -5,29 +5,11 @@
{% load crispy_forms_tags %}
{% load sstatic %}
{% block li_dropdown_right_in_first_header_top %}{% endblock li_dropdown_right_in_first_header_top %}
{% block extra_li_dropdown_right %}
<li class="nav-item bug-tracking"><a class="nav-link" href="https://gitlab.pasteur.fr/bbrancot/django-basetheme-bootstrap/issues"><i class="fa fa-bug"></i> {%trans "Bug tracking"%}</a></li>
{%if not request.user.is_authenticated %}
<li class="nav-item"><a class="nav-link" href="{% url 'basetheme_bootstrap:login'%}?next={{ request.path|urlencode }}">{% block sign_in_word %}{%trans "Login "%}{% endblock %}<i class="fa fa-sign-in"></i></a></li>
{%else%}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle"
href="#"
id="dropdown-user"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
><i class="fa fa-user-circle-o"></i> <span class="caret"></span></a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-user">
{%if request.user.is_staff %}
<a class="dropdown-item" href="/admin/"><i class="fa fa-cogs"></i> {%trans "Admin"%}</a>
<div class="dropdown-divider"></div>
{%endif%}
<a class="dropdown-item" href="{% url 'basetheme_bootstrap:account'%}"><i class="fa fa-user-circle-o"></i> {%trans "Account"%}</a>
<a class="dropdown-item" href="{% url 'basetheme_bootstrap:logout'%}"><i class="fa fa-sign-out"></i> {%trans "Logout"%}</a>
</div>
</li>
{%endif%}
{% include_if_exists "login_menu.html"|localize_template "basetheme_bootstrap/login_menu.html" %}
{% endblock %}
{% block page_title %}A Page examplE{% endblock %}
......
{% load basetheme_bootstrap %}
{% load i18n %}
<li class="nav-item "><a href="https://www.pasteur.fr/" target="_blank" class="nav-link">{%trans "L'Institut Pasteur"%}</a></li>
<li class="nav-item "><a href="https://www.pasteur.fr/" target="_blank" class="nav-link">{%trans "L'Institut Pasteur"%}</a></li>
\ No newline at end of file
<li class="nav-item "><a href="https://www.pasteur.fr/" target="_blank" class="nav-link">{%trans "L'Institut Pasteur"%}</a></li>
{% include_if_exists "login_menu.html"|localize_template "basetheme_bootstrap/login_menu.html" %}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment