toodego: move nav template in own file (#57655)

This commit is contained in:
Thomas Jund 2021-10-18 16:52:44 +02:00
parent 0e543d1424
commit da84cd9e95
2 changed files with 25 additions and 23 deletions

View File

@ -10,29 +10,6 @@
<h1 id="logo"><a accesskey="1" href="{% skeleton_extra_placeholder "top-logo-link" %}{% if user.is_authenticated %}{% firstof toodego_url portal_url %}{% else %}{% firstof toodego_url portal_url %}connect/{% endif %}{% end_skeleton_extra_placeholder %}">{% firstof global_title site_title %}</a></h1>
{% endblock %}
{% block menu %}
{# replace last menu item by user name #}
{% spaceless %}
<ul>
{% for page in pages.0.get_siblings %}
{% if page.public and not page.exclude_from_navigation %}
<li data-menu-page-id="{{ page.id }}"
{% if page.slug == pages.0.slug %}title="{{page.title}} - Page active"{% endif %}
class="menu-{{ page.slug }}
{% if page.slug == pages.0.slug %}selected{% endif %}"
>{% if page.slug != 'mon-compte' %}<a href="{% page_absolute_url page %}"><span>{{ page.title }}</span></a>{% else %}
{% skeleton_extra_placeholder "user-nav-link" %}{% if user.is_authenticated %}<a href="{{portal_url}}mon-compte/"><span>{{user.first_name}}</span></a>
<ul>
<li><a href="{{portal_url}}mon-compte/">Mon compte</a></li>
<li><a href="{% url 'auth_logout' %}">Me déconnecter</a></li>
</ul>
{% else %}<a href="/login"><span>Se connecter</span></a>{% endif %}{% end_skeleton_extra_placeholder %}{% endif %}</li>
{% endif %}
{% endfor %}
</ul>
{% endspaceless %}
{% endblock %}
{% block banner %}
{% skeleton_extra_placeholder banner %}
{% end_skeleton_extra_placeholder %}

View File

@ -0,0 +1,25 @@
{% extends "includes/nav.html" %}
{% load combo gadjo %}
{% block menu %}
{# replace last menu item by user name #}
{% spaceless %}
<ul>
{% for page in pages.0.get_siblings %}
{% if page.public and not page.exclude_from_navigation %}
<li data-menu-page-id="{{ page.id }}"
{% if page.slug == pages.0.slug %}title="{{page.title}} - Page active"{% endif %}
class="menu-{{ page.slug }}
{% if page.slug == pages.0.slug %}selected{% endif %}"
>{% if page.slug != 'mon-compte' %}<a href="{% page_absolute_url page %}"><span>{{ page.title }}</span></a>{% else %}
{% skeleton_extra_placeholder "user-nav-link" %}{% if user.is_authenticated %}<a href="{{portal_url}}mon-compte/"><span>{{user.first_name}}</span></a>
<ul>
<li><a href="{{portal_url}}mon-compte/">Mon compte</a></li>
<li><a href="{% url 'auth_logout' %}">Me déconnecter</a></li>
</ul>
{% else %}<a href="/login"><span>Se connecter</span></a>{% endif %}{% end_skeleton_extra_placeholder %}{% endif %}</li>
{% endif %}
{% endfor %}
</ul>
{% endspaceless %}
{% endblock %}