From f8fbbb5ba712b3352b615c3609d7a85253031860 Mon Sep 17 00:00:00 2001 From: Peter Pfeufer Date: Tue, 16 Jan 2024 20:00:53 +0100 Subject: [PATCH] [CHANGE] Auth menu for public pages --- .../menu/templates/menu/menu-logo.html | 2 +- .../menu/templates/menu/menu-user.html | 47 +++++++++++-------- .../templates/menu/sortable-side-menu.html | 6 ++- .../templates/bundles/image-auth-logo.html | 3 ++ 4 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 allianceauth/templates/bundles/image-auth-logo.html diff --git a/allianceauth/menu/templates/menu/menu-logo.html b/allianceauth/menu/templates/menu/menu-logo.html index 858e3884..d871f4d6 100644 --- a/allianceauth/menu/templates/menu/menu-logo.html +++ b/allianceauth/menu/templates/menu/menu-logo.html @@ -1,5 +1,5 @@ {% load static %}
- {{ SITE_NAME }} + {% include "bundles/image-auth-logo.html" %}
diff --git a/allianceauth/menu/templates/menu/menu-user.html b/allianceauth/menu/templates/menu/menu-user.html index 8469811d..05c15967 100644 --- a/allianceauth/menu/templates/menu/menu-user.html +++ b/allianceauth/menu/templates/menu/menu-user.html @@ -1,30 +1,39 @@ +{% load static %} {% load i18n %} {% load evelinks %} {% load theme_tags %} -
+
- {% with request.user.profile.main_character as main %} - {{ main.character_name }} - {{ main.corporation_name }} - {% if main.alliance_id %} - {{ main.alliance_name }} - {% elif main.faction_id %} - {{ main.faction_name }} - {% endif %} - {% endwith %} + {% if user.is_authenticated %} + {% with request.user.profile.main_character as main %} + {{ main.character_name }} + {{ main.corporation_name }} + {% if main.alliance_id %} + {{ main.alliance_name }} + {% elif main.faction_id %} + {{ main.faction_name }} + {% endif %} + {% endwith %} + {% else %} + {% include "bundles/image-auth-logo.html" with logo_width="64px" %} + {% endif %}
- {% with request.user.profile.main_character as main %} -
{{ main.character_name }}
-

{{ main.corporation_name }}

- {% if main.alliance_id %} -

{{ main.alliance_name }}

- {% elif main.faction_id %} -

{{ main.faction_name }}

- {% endif %} - {% endwith %} + {% if user.is_authenticated %} + {% with request.user.profile.main_character as main %} +
{{ main.character_name }}
+

{{ main.corporation_name }}

+ {% if main.alliance_id %} +

{{ main.alliance_name }}

+ {% elif main.faction_id %} +

{{ main.faction_name }}

+ {% endif %} + {% endwith %} + {% else %} +
{{ SITE_NAME }}
+ {% endif %}