[CHANGE] Auth menu for public pages

This commit is contained in:
Peter Pfeufer 2024-01-16 20:00:53 +01:00
parent dd3ef41396
commit f8fbbb5ba7
No known key found for this signature in database
GPG Key ID: 6051D2C6AD4EBC27
4 changed files with 36 additions and 22 deletions

View File

@ -1,5 +1,5 @@
{% load static %}
<div class="align-items-center text-center">
<img src="{% static 'allianceauth/images/auth-logo.svg' %}" width="128px" height="128px" alt="{{ SITE_NAME }}">
{% include "bundles/image-auth-logo.html" %}
</div>

View File

@ -1,30 +1,39 @@
{% load static %}
{% load i18n %}
{% load evelinks %}
{% load theme_tags %}
<div style="z-index:5;" class="w100 d-flex flex-column justify-content-center align-items-center text-center pb-2 border-top border-secondary">
<div style="z-index:5;" class="w100 d-flex flex-column justify-content-center align-items-center text-center pb-2 border-top border-secondary {% if not user.is_authenticated %}position-absolute bottom-0 w-100{% endif %}">
<div class="d-flex mb-0 w-100 bg-dark text-light">
<div class="p-2 position-relative m-2">
{% with request.user.profile.main_character as main %}
<img class="rounded-circle" src="{{ main.character_id|character_portrait_url:64 }}" alt="{{ main.character_name }}">
<img class="rounded-circle position-absolute bottom-0 start-0" src="{{ main.corporation_logo_url_32 }}" alt="{{ main.corporation_name }}">
{% if main.alliance_id %}
<img class="rounded-circle position-absolute bottom-0 end-0" src="{{ main.alliance_logo_url_32 }}" alt="{{ main.alliance_name }}">
{% elif main.faction_id %}
<img class="rounded-circle position-absolute bottom-0 end-0" src="{{ main.faction_logo_url_32 }}" alt="{{ main.faction_name }}">
{% endif %}
{% endwith %}
{% if user.is_authenticated %}
{% with request.user.profile.main_character as main %}
<img class="rounded-circle" src="{{ main.character_id|character_portrait_url:64 }}" alt="{{ main.character_name }}">
<img class="rounded-circle position-absolute bottom-0 start-0" src="{{ main.corporation_logo_url_32 }}" alt="{{ main.corporation_name }}">
{% if main.alliance_id %}
<img class="rounded-circle position-absolute bottom-0 end-0" src="{{ main.alliance_logo_url_32 }}" alt="{{ main.alliance_name }}">
{% elif main.faction_id %}
<img class="rounded-circle position-absolute bottom-0 end-0" src="{{ main.faction_logo_url_32 }}" alt="{{ main.faction_name }}">
{% endif %}
{% endwith %}
{% else %}
{% include "bundles/image-auth-logo.html" with logo_width="64px" %}
{% endif %}
</div>
<div class="align-self-center text-start">
{% with request.user.profile.main_character as main %}
<h5 class="m-0">{{ main.character_name }}</h5>
<p class="m-0 small">{{ main.corporation_name }}</p>
{% if main.alliance_id %}
<p class="m-0 small">{{ main.alliance_name }}</p>
{% elif main.faction_id %}
<p class="m-0 small">{{ main.faction_name }}</p>
{% endif %}
{% endwith %}
{% if user.is_authenticated %}
{% with request.user.profile.main_character as main %}
<h5 class="m-0">{{ main.character_name }}</h5>
<p class="m-0 small">{{ main.corporation_name }}</p>
{% if main.alliance_id %}
<p class="m-0 small">{{ main.alliance_name }}</p>
{% elif main.faction_id %}
<p class="m-0 small">{{ main.faction_name }}</p>
{% endif %}
{% endwith %}
{% else %}
<h5 class="m-0">{{ SITE_NAME }}</h5>
{% endif %}
</div>
<div class="ms-auto dropup">
<button type="button" class="h-100 btn" data-bs-toggle="dropdown" aria-expanded="false">

View File

@ -5,7 +5,7 @@
<div class="col-auto px-0">
<div class="collapse collapse-horizontal" tabindex="-1" id="sidebar">
<div style="width: 350px;">
<div class="nav-padding navbar-dark bg-dark text-light px-0 d-flex flex-column overflow-hidden vh-100">
<div class="nav-padding navbar-dark bg-dark text-light px-0 d-flex flex-column overflow-hidden vh-100 {% if not user.is_authenticated %}position-relative{% endif %}">
{% if user.is_authenticated %}
<ul style="z-index:5;" id="sidebar-menu" class="navbar-nav flex-column mb-auto overflow-auto pt-2">
<li class="d-flex flex-wrap m-2 p-2 pt-0 pb-0 mt-0 mb-0 me-0 pe-0">
@ -17,8 +17,10 @@
{% sorted_menu_items %}
</ul>
{% include 'menu/menu-logo.html' %}
{% endif %}
{% include 'menu/menu-logo.html' %}
{% include 'menu/menu-user.html' %}
</div>
</div>

View File

@ -0,0 +1,3 @@
{% load static %}
<img src="{% static 'allianceauth/images/auth-logo.svg' %}" width="{{ logo_width|default:"128px" }}" height="{% if logo_height %}{{ logo_ }}{% else %}{{ logo_width|default:"128px" }}{% endif %}" alt="{{ SITE_NAME }}">