mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Merge branch 'user-menu-fixes' into 'master'
[CHANGE] User Menu Template Improvements See merge request allianceauth/allianceauth!1728
This commit is contained in:
commit
79b617f51f
@ -1,17 +1,15 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
<div class="dropdown">
|
<form class="dropdown-item" action="{% url 'set_language' %}" method="post">
|
||||||
<form action="{% url 'set_language' %}" method="post">
|
{% csrf_token %}
|
||||||
{% csrf_token %}
|
|
||||||
|
|
||||||
<select class="form-select" onchange="this.form.submit()" class="form-control" id="lang-select" name="language">
|
<select class="form-select" onchange="this.form.submit()" class="form-control" id="lang-select" name="language">
|
||||||
{% get_available_languages as LANGUAGES %}
|
{% get_available_languages as LANGUAGES %}
|
||||||
|
|
||||||
{% for lang_code, lang_name in LANGUAGES %}
|
{% for lang_code, lang_name in LANGUAGES %}
|
||||||
<option lang="{{ lang_code }}" value="{{ lang_code }}"{% if lang_code == LANGUAGE_CODE %} selected{% endif %}>
|
<option lang="{{ lang_code }}" value="{{ lang_code }}"{% if lang_code == LANGUAGE_CODE %} selected{% endif %}>
|
||||||
{{ lang_code|language_name_local|capfirst }} ({{ lang_code }})
|
{{ lang_code|language_name_local|capfirst }} ({{ lang_code }})
|
||||||
</option>
|
</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
|
@ -2,28 +2,51 @@
|
|||||||
{% load evelinks %}
|
{% load evelinks %}
|
||||||
{% load theme_tags %}
|
{% load theme_tags %}
|
||||||
|
|
||||||
<div id="aa-user-info" class="w-100 d-flex flex-column justify-content-center align-items-center text-center py-1 border-top border-secondary {% if not user.is_authenticated %}position-absolute bottom-0{% endif %}">
|
<div
|
||||||
|
id="aa-user-info"
|
||||||
|
class="w-100 d-flex flex-column justify-content-center align-items-center text-center py-1 border-top border-secondary {% if not user.is_authenticated %}position-absolute bottom-0{% endif %}"
|
||||||
|
>
|
||||||
<div class="d-flex mb-0 w-100">
|
<div class="d-flex mb-0 w-100">
|
||||||
<div class="p-2 position-relative m-2">
|
<div class="p-2 position-relative m-2">
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
{% with request.user.profile.main_character as main %}
|
{% 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
|
||||||
<img class="rounded-circle position-absolute bottom-0 start-0" src="{{ main.corporation_logo_url_32 }}" alt="{{ main.corporation_name }}">
|
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 %}
|
{% if main.alliance_id %}
|
||||||
<img class="rounded-circle position-absolute bottom-0 end-0" src="{{ main.alliance_logo_url_32 }}" alt="{{ main.alliance_name }}">
|
<img
|
||||||
|
class="rounded-circle position-absolute bottom-0 end-0"
|
||||||
|
src="{{ main.alliance_logo_url_32 }}"
|
||||||
|
alt="{{ main.alliance_name }}"
|
||||||
|
>
|
||||||
{% elif main.faction_id %}
|
{% elif main.faction_id %}
|
||||||
<img class="rounded-circle position-absolute bottom-0 end-0" src="{{ main.faction_logo_url_32 }}" alt="{{ main.faction_name }}">
|
<img
|
||||||
|
class="rounded-circle position-absolute bottom-0 end-0"
|
||||||
|
src="{{ main.faction_logo_url_32 }}"
|
||||||
|
alt="{{ main.faction_name }}"
|
||||||
|
>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% include "bundles/image-auth-logo.html" with logo_width="64px" %}
|
{% include "bundles/image-auth-logo.html" with logo_width="64px" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="align-self-center text-start">
|
<div class="align-self-center text-start">
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
{% with request.user.profile.main_character as main %}
|
{% with request.user.profile.main_character as main %}
|
||||||
<h5 class="m-0">{{ main.character_name }}</h5>
|
<h5 class="m-0">{{ main.character_name }}</h5>
|
||||||
<p class="m-0 small">{{ main.corporation_name }}</p>
|
<p class="m-0 small">{{ main.corporation_name }}</p>
|
||||||
|
|
||||||
{% if main.alliance_id %}
|
{% if main.alliance_id %}
|
||||||
<p class="m-0 small">{{ main.alliance_name }}</p>
|
<p class="m-0 small">{{ main.alliance_name }}</p>
|
||||||
{% elif main.faction_id %}
|
{% elif main.faction_id %}
|
||||||
@ -34,56 +57,106 @@
|
|||||||
<h5 class="m-0">{{ SITE_NAME }}</h5>
|
<h5 class="m-0">{{ SITE_NAME }}</h5>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ms-auto dropup">
|
<div class="ms-auto dropup">
|
||||||
<button type="button" class="h-100 btn" data-bs-toggle="dropdown" aria-expanded="false">
|
<button type="button" class="h-100 btn" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
<i class="fa-solid fa-gear fa-fw text-light"></i>
|
<i class="fa-solid fa-gear fa-fw text-light"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<ul class="dropdown-menu" style="min-width: 200px;">
|
<ul class="dropdown-menu" style="min-width: 200px;">
|
||||||
<li><h6 class="dropdown-header">{% translate "Language" %}</h6></li>
|
<li><h6 class="dropdown-header">{% translate "Language" %}</h6></li>
|
||||||
<li>
|
|
||||||
<a class="dropdown-item">{% include "public/lang_select.html" %}</a>
|
|
||||||
</li>
|
|
||||||
<li><h6 class="dropdown-header">{% translate "Theme" %}</h6></li>
|
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item">
|
{% include "public/lang_select.html" %}
|
||||||
{% theme_select %}
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
{% theme_select %}
|
||||||
|
|
||||||
{% if user.is_superuser %}
|
{% if user.is_superuser %}
|
||||||
<li><hr class="dropdown-divider"></li>
|
<li><hr class="dropdown-divider"></li>
|
||||||
<li><h6 class="dropdown-header">{% translate "Super User" %}</h6></li>
|
<li><h6 class="dropdown-header">{% translate "Super User" %}</h6></li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item" href="https://allianceauth.readthedocs.io/" title="Alliance Auth Documentation"><i class="fa-solid fa-book fa-fw"></i> Alliance Auth Documentation</a>
|
<a
|
||||||
</li>
|
class="dropdown-item"
|
||||||
<li>
|
href="https://allianceauth.readthedocs.io/"
|
||||||
<a class="dropdown-item" href="https://discord.gg/fjnHAmk" title="Alliance Auth Discord"><i class="fa-brands fa-discord fa-fw"></i> Alliance Auth Discord</a>
|
title="{% translate 'Alliance Auth Documentation' %}"
|
||||||
</li>
|
>
|
||||||
<li>
|
<i class="fa-solid fa-book fa-fw"></i>
|
||||||
<a class="dropdown-item" href="https://gitlab.com/allianceauth/allianceauth" title="Alliance Auth Git"><i class="fa-brands fa-gitlab fa-fw"></i> Alliance Auth Git</a>
|
{% translate "Alliance Auth Documentation" %}
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if user.is_staff %}
|
|
||||||
<li>
|
|
||||||
<a class="dropdown-item" href="{% url 'admin:index' %}">
|
|
||||||
<i class="fa-solid fa-gear fa-fw"></i> {% translate "Admin" %}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
<li><hr class="dropdown-divider"></li>
|
|
||||||
{% if user.is_authenticated %}
|
|
||||||
<li>
|
|
||||||
<a class="dropdown-item" href="{% url 'authentication:token_management' %}">
|
|
||||||
<i class="fa-solid fa-user-lock fa-fw"></i> Token Management
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item text-danger" href="{% url 'logout' %}" title="{% translate 'Sign Out' %}"><i class="fa-solid fa-right-from-bracket fa-fw "></i> {% translate 'Sign Out' %}</a>
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="https://discord.gg/fjnHAmk"
|
||||||
|
title="{% translate 'Alliance Auth Discord' %}"
|
||||||
|
>
|
||||||
|
<i class="fa-brands fa-discord fa-fw"></i>
|
||||||
|
{% translate "Alliance Auth Discord" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="https://gitlab.com/allianceauth/allianceauth"
|
||||||
|
title="{% translate 'Alliance Auth Git' %}"
|
||||||
|
>
|
||||||
|
<i class="fa-brands fa-gitlab fa-fw"></i>
|
||||||
|
{% translate "Alliance Auth Git" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if user.is_staff %}
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="{% url 'admin:index' %}"
|
||||||
|
title="{% translate 'Admin' %}"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-gear fa-fw"></i>
|
||||||
|
{% translate "Admin" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<li><hr class="dropdown-divider"></li>
|
||||||
|
|
||||||
|
{% if user.is_authenticated %}
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
class="dropdown-item"
|
||||||
|
href="{% url 'authentication:token_management' %}"
|
||||||
|
title="{% translate 'Token Management' %}"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-user-lock fa-fw"></i>
|
||||||
|
{% translate "Token Management" %}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
class="dropdown-item text-danger"
|
||||||
|
href="{% url 'logout' %}"
|
||||||
|
title="{% translate 'Sign Out' %}"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-right-from-bracket fa-fw"></i>
|
||||||
|
{% translate 'Sign Out' %}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item text-success" href="{% url 'authentication:login' %}" title="{% translate 'Sign In' %}"> <i class="fa-solid fa-right-to-bracket fa-fw "></i> {% translate 'Sign In' %}</a>
|
<a
|
||||||
|
class="dropdown-item text-success"
|
||||||
|
href="{% url 'authentication:login' %}"
|
||||||
|
title="{% translate 'Sign In' %}"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-right-to-bracket fa-fw"></i>
|
||||||
|
{% translate 'Sign In' %}
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -1,13 +1,21 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
<form action="{% url 'theme' %}?next={{ next|urlencode }}" method="post">
|
{% if themes|length > 1 %}
|
||||||
{% csrf_token %}
|
<li><h6 class="dropdown-header">{% translate "Theme" %}</h6></li>
|
||||||
|
|
||||||
<select name="theme" class="form-select" aria-label="" onchange="this.form.submit()">
|
<li>
|
||||||
<option selected>{% translate "Select Theme" %}</option>
|
<form class="dropdown-item" action="{% url 'theme' %}?next={{ next|urlencode }}" method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
|
||||||
{% for theme in themes %}
|
<select name="theme" class="form-select" onchange="this.form.submit()">
|
||||||
<option value="{{ theme.get_name }}"{% if selected_theme.name == theme.name %} selected="selected"{% endif %}>{{ theme.name }}</option>
|
<option selected>{% translate "Select Theme" %}</option>
|
||||||
{% endfor %}
|
|
||||||
</select>
|
{% for theme in themes %}
|
||||||
</form>
|
<option value="{{ theme.get_name }}"{% if selected_theme.name == theme.name %} selected="selected"{% endif %}>
|
||||||
|
{{ theme.name }}
|
||||||
|
</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user