Navbar plus propre.
This commit is contained in:
parent
9fdd7c9786
commit
135129769e
3 changed files with 17 additions and 12 deletions
|
@ -14,4 +14,7 @@
|
|||
{% endif %}
|
||||
</button>
|
||||
</form>
|
||||
{% if link %}
|
||||
<a href="{{link}}">{{link_text}}</a>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{% for c in categories %}
|
||||
<li class="nav-item
|
||||
{% if category.pk == c.pk %}active{%endif%}">
|
||||
<a class="nav-link" href="{% url 'content:category' c.pk %}">{{c.name}}
|
||||
<a class="nav-link" href="{% url 'content:category' c.pk %}"><i class="fas fa-video"></i> {{c.name}}
|
||||
</a></li>
|
||||
{% endfor %}
|
||||
{% for p in static_pages %}
|
||||
|
@ -30,27 +30,23 @@
|
|||
|
||||
</ul>
|
||||
<ul class="navbar-nav ml-auto">
|
||||
{% if request.user.school %}
|
||||
<li class="nav-item {% if school %}active{% endif %}"><a class="nav-link" href="{% url 'users:school' request.user.school.pk %}"><i class="fas fa-graduation-cap"></i> Mon école</a></li>
|
||||
{% endif %}
|
||||
<li class="nav-item {% if settings %}active{% endif %}"><a class="nav-link" href="{% url 'settings:index' %}"><i class="fas fa-cogs"></i> Administration</a></li>
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{{request.user}}
|
||||
<i class="fa fa-user"></i> {{request.user}}
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="{% url 'users:logout' %}"><i class="fa fa-sign-out-alt"></i> Se déconnecter</a>
|
||||
{% if request.user.school %}
|
||||
<a class="dropdown-item" href="{% url 'users:school' request.user.school.pk %}"><i class="fas fa-graduation-cap"></i> Mon école</a>
|
||||
{% endif %}
|
||||
<a class="dropdown-item" href="{% url 'settings:index' %}"><i class="fas fa-cogs"></i> Administration</a>
|
||||
</div>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item {% if active == 4 %}active{% endif %}">
|
||||
<a class="nav-link" href="{% url 'users:login' %}">Connexion<span class="sr-only">(current)</span></a>
|
||||
<a class="nav-link" href="{% url 'users:login' %}"><i class="fa fa-user"></i>Connexion<span class="sr-only">(current)</span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="nav-link" href="{% url "users:password-reset" %}">(Mot de passe oublié)</a>
|
||||
</li>
|
||||
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -12,7 +12,13 @@ urlpatterns = [
|
|||
),
|
||||
path(
|
||||
'login',
|
||||
auth_views.LoginView.as_view(template_name="edit.html"),
|
||||
auth_views.LoginView.as_view(
|
||||
template_name="edit.html",
|
||||
extra_context={
|
||||
'link_text':"Mot de passe oublié",
|
||||
'link':reverse_lazy('users:password-reset')
|
||||
}
|
||||
),
|
||||
name='login'
|
||||
),
|
||||
path(
|
||||
|
|
Loading…
Reference in a new issue