Changeset View
Changeset View
Standalone View
Standalone View
swh/web/webapp/templates/layout.html
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | <div class="wrapper"> | ||||
<a class="swh-donate-link" href="https://www.softwareheritage.org/donate">Donate</a> | <a class="swh-donate-link" href="https://www.softwareheritage.org/donate">Donate</a> | ||||
</li> | </li> | ||||
<li class="swh-position-right"> | <li class="swh-position-right"> | ||||
<a href="{{ status.server_url }}" target="_blank" | <a href="{{ status.server_url }}" target="_blank" | ||||
class="swh-current-status mr-3 d-none d-lg-inline-block d-xl-inline-block"> | class="swh-current-status mr-3 d-none d-lg-inline-block d-xl-inline-block"> | ||||
<span id="swh-current-status-description">Operational</span> | <span id="swh-current-status-description">Operational</span> | ||||
<i class="swh-current-status-indicator green"></i> | <i class="swh-current-status-indicator green"></i> | ||||
</a> | </a> | ||||
{% url 'logout' as logout_url %} | |||||
{% if user.is_authenticated %} | {% if user.is_authenticated %} | ||||
Logged in as | Logged in as | ||||
{% if 'OIDC' in user.backend %} | {% if 'OIDC' in user.backend %} | ||||
<a id="swh-login" href="{% url 'oidc-profile' %}"><strong>{{ user.username }}</strong></a>, | <a id="swh-login" href="{% url 'oidc-profile' %}"><strong>{{ user.username }}</strong></a>, | ||||
<a href= "{% url 'oidc-logout' %}?next_path={% url 'logout' %}?remote_user=1">logout</a> | <a href= "{% url 'oidc-logout' %}?next_path={% url 'logout' %}?remote_user=1">logout</a> | ||||
{% else %} | {% else %} | ||||
<strong id="swh-login">{{ user.username }}</strong>, | <strong id="swh-login">{{ user.username }}</strong>, | ||||
<a href="{{ logout_url }}">logout</a> | <a href="{% url logout_url %}">logout</a> | ||||
{% endif %} | {% endif %} | ||||
{% elif oidc_enabled %} | |||||
{% if request.path != logout_url %} | |||||
<a id="swh-login" href="{% url 'oidc-login' %}?next_path={{ request.build_absolute_uri }}">login</a> | |||||
{% else %} | {% else %} | ||||
<a id="swh-login" href="{% url 'oidc-login' %}">login</a> | {% if request.resolver_match.url_name != logout_url %} | ||||
{% endif %} | <a id="swh-login" href="{% url login_url %}?next_path={{ request.build_absolute_uri }}">login</a> | ||||
{% else %} | |||||
{% if request.path != logout_url %} | |||||
<a id="swh-login" href="{% url 'login' %}?next={{ request.build_absolute_uri }}">login</a> | |||||
{% else %} | {% else %} | ||||
<a id="swh-login" href="{% url 'login' %}">login</a> | <a id="swh-login" href="{% url login_url %}">login</a> | ||||
{% endif %} | {% endif %} | ||||
{% endif %} | {% endif %} | ||||
</li> | </li> | ||||
</ul> | </ul> | ||||
</div> | </div> | ||||
{% if "swh.web.banners" in SWH_DJANGO_APPS %} | {% if "swh.web.banners" in SWH_DJANGO_APPS %} | ||||
<div class="swh-banner"> | <div class="swh-banner"> | ||||
{% include "hiring-banner.html" %} | {% include "hiring-banner.html" %} | ||||
▲ Show 20 Lines • Show All 188 Lines • Show Last 20 Lines |