Commit 524db0d0 authored by BERJON Matthieu's avatar BERJON Matthieu
Browse files

Updating the header for login/logout



I changed the header in order to show only the gitlab sign-in/login
button when the user isn't authenticated and logout button when he is.
Signed-off-by: BERJON Matthieu's avatarMatthieu Berjon <matthieu.berjon@inria.fr>
parent d9392f3f
{% load static activelink %}
{% load static activelink socialaccount%}
<header class="container-fluid">
<div class="container">
......@@ -21,13 +21,14 @@
<ul class="navbar-nav ml-auto">
{% if not user.is_authenticated %}
<li class="nav-item
{% is_active request 'account_login' %}">
<a class="nav-link" href="{% url 'account_login' %}">Sign in</a>
</li>
<li class="nav-item nav-link disabled">or</li>
<li class="nav-item {% is_active request 'account_signup' %}">
<a class="nav-link" href="{% url 'account_signup' %}">Sign up</a>
<li class="nav-item">
{% get_providers as socialaccount_providers %}
{% if socialaccount_providers %}
{% for account in socialaccount_providers %}
<a href="{% provider_login_url account.id %}"
class="btn btn-primary {{ account.id }} text-center ">Log in with Gitlab</a>
{% endfor %}
{% endif %}
</li>
{% else %}
<li class="nav-item {% is_active request 'user_webapp_list' 'webapp_update' 'webapp_creation' 'webapp_sandbox_panel' %}">
......@@ -45,7 +46,7 @@
<a class="nav-link" href="{% url 'main:user_detail' %}"><i class="fas fa-user"></i> Profile</a>
</li>
<li class="nav-item {% is_active request 'account_logout' %}">
<a class="nav-link" href="{% url 'account_logout' %}"><i class="fas fa-sign-out-alt"></i> Sign out</a>
<a class="btn btn-primary" href="{% url 'account_logout' %}"><i class="fas fa-sign-out-alt"></i> Sign out</a>
</li>
{% endif %}
</ul>
......
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