Merge branch 'template-stuff' into 'v4.x'

Auth Menu Changes and Other Template Fixes

See merge request allianceauth/allianceauth!1586
This commit is contained in:
Ariel Rin 2024-02-15 01:53:38 +00:00
commit 2815ebaa07
20 changed files with 130 additions and 64 deletions

View File

@ -1,5 +1,5 @@
{% load i18n %} {% load i18n %}
<div class="col-12 col-xl-8 align-self-stretch p-2 ps-0 pe-0 ps-xl-0 pe-xl-2"> <div id="aa-dashboard-panel-characters" class="col-12 col-xl-8 align-self-stretch p-2 ps-0 pe-0 ps-xl-0 pe-xl-2">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">

View File

@ -1,5 +1,5 @@
{% load i18n %} {% load i18n %}
<div class="col-12 col-xl-4 align-self-stretch py-2 ps-xl-2"> <div id="aa-dashboard-panel-membership" class="col-12 col-xl-4 align-self-stretch py-2 ps-xl-2">
<div class="card h-100"> <div class="card h-100">
<div class="card-body"> <div class="card-body">
<h4 class="card-title text-center">{% translate "Membership" %}</h4> <h4 class="card-title text-center">{% translate "Membership" %}</h4>

View File

@ -16,7 +16,7 @@
{% translate "This page is a best attempt, but backups or database logs can still contain your tokens. Always revoke tokens on https://community.eveonline.com/support/third-party-applications/ where possible."|urlize %} {% translate "This page is a best attempt, but backups or database logs can still contain your tokens. Always revoke tokens on https://community.eveonline.com/support/third-party-applications/ where possible."|urlize %}
</p> </p>
<table class="table" id="table_tokens" style="width: 100%;"> <table class="table w-100" id="table_tokens">
<thead> <thead>
<tr> <tr>
<th>{% translate "Scopes" %}</th> <th>{% translate "Scopes" %}</th>

View File

@ -1,6 +1,6 @@
{% extends 'public/base.html' %} {% extends 'public/base.html' %}
{% load bootstrap %} {% load django_bootstrap5 %}
{% load i18n %} {% load i18n %}
{% block page_title %}{% translate "Registration" %}{% endblock %} {% block page_title %}{% translate "Registration" %}{% endblock %}
@ -12,16 +12,20 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="col-md-4 col-md-offset-4"> <div class="row justify-content-center">
<div class="panel panel-default panel-transparent"> <div class="col-md-4">
<div class="panel-body"> <div class="card card-login border-secondary p-3">
<form method="POST"> <div class="card-body">
{% csrf_token %} <form method="POST">
{{ form|bootstrap }} {% csrf_token %}
<button class="btn btn-lg btn-primary btn-block" type="submit">{% translate "Register" %}</button> {% bootstrap_form form %}
</form>
<button class="btn btn-primary btn-block" type="submit">{% translate "Register" %}</button>
</form>
{% include 'public/lang_select.html' %}
</div>
</div> </div>
</div> </div>
{% include 'public/lang_select.html' %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -31,7 +31,7 @@
<div class="card card-default mt-4"> <div class="card card-default mt-4">
<div class="card-header clearfix" role="tablist"> <div class="card-header clearfix" role="tablist">
<ul class="nav nav-pills text-right float-start"> <ul class="nav nav-pills float-start">
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<a <a
class="nav-link active" class="nav-link active"

View File

@ -13,6 +13,36 @@
} }
} }
/* Side Navigation
------------------------------------------------------------------------------------- */
@media all {
#sidebar > div {
width: 325px;
}
#sidebar-menu li > a,
#sidebar-menu li > ul > li > a {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
max-width: 210px;
}
#sidebar-menu li > ul > li > a {
max-width: 189px;
}
#sidebar-menu [data-bs-toggle="collapse"] > i.fa-chevron-down,
#sidebar-menu [data-bs-toggle="collapse"].collapsed > i.fa-chevron-right {
display: block;
}
#sidebar-menu [data-bs-toggle="collapse"] > i.fa-chevron-right,
#sidebar-menu [data-bs-toggle="collapse"].collapsed > i.fa-chevron-down {
display: none;
}
}
/* Cursor classes /* Cursor classes
------------------------------------------------------------------------------------- */ ------------------------------------------------------------------------------------- */
@media all { @media all {

View File

@ -30,7 +30,11 @@
<tr> <tr>
<th>{% translate "Name" %}</th> <th>{% translate "Name" %}</th>
<th>{% translate "Description" %}</th> <th>{% translate "Description" %}</th>
<th>{% translate "Leaders" %}<span class="m-1 fw-lighter badge bg-primary">{% translate "User" %}</span><span class="m-1 fw-lighter badge bg-secondary ">{% translate "Group" %}</span></th> <th>
{% translate "Leaders" %}<br>
<span class="my-1 me-1 fw-lighter badge bg-primary">{% translate "User" %}</span>
<span class="my-1 me-1 fw-lighter badge bg-secondary">{% translate "Group" %}</span>
</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -39,13 +43,23 @@
{% for g in groups %} {% for g in groups %}
<tr> <tr>
<td>{{ g.group.name }}</td> <td>{{ g.group.name }}</td>
<td>{{ g.group.authgroup.description|linebreaks|urlize }}</td> <td>
{% if g.group.authgroup.description %}
{{ g.group.authgroup.description|linebreaks|urlize }}
{% endif %}
</td>
<td style="max-width: 30%;"> <td style="max-width: 30%;">
{% if g.group.authgroup.group_leaders.all.count %} {% if g.group.authgroup.group_leaders.all.count %}
{% for leader in g.group.authgroup.group_leaders.all %}{% if leader.profile.main_character %}<span class="m-1 badge bg-primary">{{leader.profile.main_character}}</span>{% endif %}{% endfor %} {% for leader in g.group.authgroup.group_leaders.all %}
{% if leader.profile.main_character %}
<span class="my-1 me-1 badge bg-primary">{{leader.profile.main_character}}</span>
{% endif %}
{% endfor %}
{% endif %} {% endif %}
{% if g.group.authgroup.group_leaders.all.count %} {% if g.group.authgroup.group_leaders.all.count %}
{% for group in g.group.authgroup.group_leader_groups.all %}<span class="badge bg-secondary">{{group.name}}</span>{% endfor %} {% for group in g.group.authgroup.group_leader_groups.all %}
<span class="my-1 me-1 badge bg-secondary">{{group.name}}</span>
{% endfor %}
{% endif %} {% endif %}
</td> </td>
<td class="text-end"> <td class="text-end">

View File

@ -10,21 +10,24 @@
</a> </a>
{% if item.count >= 1 %} {% if item.count >= 1 %}
<span class="badge bg-primary m-2 align-self-center {% if item.items|length == 0 %}me-4{% endif %}"> <span class="badge bg-primary m-2 align-self-center {% if item.items|length == 0 %}me-2{% endif %}">
{{ item.count }} {{ item.count }}
</span> </span>
{% elif item.url %} {% elif item.url %}
<span class="pill m-2 me-4 align-self-center fas fa-external-link-alt"></span> <span class="pill m-2 me-2 align-self-center fas fa-external-link-alt" title="{% translate 'External link' %}"></span>
{% endif %} {% endif %}
{% if item.items|length > 0 %} {% if item.items|length > 0 %}
<span <span
class="pill m-2 me-4 align-self-center fas fa-solid fa-chevron-down" class="pill m-2 me-2 align-self-center collapsed"
type="button" type="button"
data-bs-toggle="collapse" data-bs-toggle="collapse"
data-bs-target="#id-{{ item.text|slugify }}" data-bs-target="#id-{{ item.text|slugify }}"
aria-expanded="false" aria-expanded="false"
aria-controls=""> aria-controls=""
>
<i class="fas fa-chevron-right"></i>
<i class="fas fa-chevron-down"></i>
</span> </span>
<!--<hr class="m-0 w-100">--> <!--<hr class="m-0 w-100">-->
<ul class="collapse ps-1 w-100 border-start rounded-start border-light border-3" id="id-{{ item.text|slugify }}"> <ul class="collapse ps-1 w-100 border-start rounded-start border-light border-3" id="id-{{ item.text|slugify }}">

View File

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

View File

@ -2,35 +2,43 @@
{% load evelinks %} {% load evelinks %}
{% load theme_tags %} {% 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 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 bg-dark text-light"> <div class="d-flex mb-0 w-100">
<div class="p-2 position-relative m-2"> <div class="p-2 position-relative m-2">
{% with request.user.profile.main_character as main %} {% if user.is_authenticated %}
<img class="rounded-circle" src="{{ main.character_id|character_portrait_url:64 }}" alt="{{ main.character_name }}"> {% with request.user.profile.main_character as main %}
<img class="rounded-circle position-absolute bottom-0 start-0" src="{{ main.corporation_logo_url_32 }}" alt="{{ main.corporation_name }}"> <img class="rounded-circle" src="{{ main.character_id|character_portrait_url:64 }}" alt="{{ main.character_name }}">
{% if main.alliance_id %} <img class="rounded-circle position-absolute bottom-0 start-0" src="{{ main.corporation_logo_url_32 }}" alt="{{ main.corporation_name }}">
<img class="rounded-circle position-absolute bottom-0 end-0" src="{{ main.alliance_logo_url_32 }}" alt="{{ main.alliance_name }}"> {% if main.alliance_id %}
{% elif main.faction_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.faction_logo_url_32 }}" alt="{{ main.faction_name }}"> {% elif main.faction_id %}
{% endif %} <img class="rounded-circle position-absolute bottom-0 end-0" src="{{ main.faction_logo_url_32 }}" alt="{{ main.faction_name }}">
{% endwith %} {% endif %}
{% endwith %}
{% else %}
{% include "bundles/image-auth-logo.html" with logo_width="64px" %}
{% endif %}
</div> </div>
<div class="align-self-center text-start"> <div class="align-self-center text-start">
{% with request.user.profile.main_character as main %} {% if user.is_authenticated %}
<h5 class="m-0">{{ main.character_name }}</h5> {% with request.user.profile.main_character as main %}
<p class="m-0 small">{{ main.corporation_name }}</p> <h5 class="m-0">{{ main.character_name }}</h5>
{% if main.alliance_id %} <p class="m-0 small">{{ main.corporation_name }}</p>
<p class="m-0 small">{{ main.alliance_name }}</p> {% if main.alliance_id %}
{% elif main.faction_id %} <p class="m-0 small">{{ main.alliance_name }}</p>
<p class="m-0 small">{{ main.faction_name }}</p> {% elif main.faction_id %}
{% endif %} <p class="m-0 small">{{ main.faction_name }}</p>
{% endwith %} {% endif %}
{% endwith %}
{% else %}
<h5 class="m-0">{{ SITE_NAME }}</h5>
{% 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"> <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> <li>
<a class="dropdown-item">{% include "public/lang_select.html" %}</a> <a class="dropdown-item">{% include "public/lang_select.html" %}</a>
@ -76,8 +84,6 @@
<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>
</div> </div>
</div> </div>

View File

@ -4,10 +4,10 @@
<div class="col-auto px-0"> <div class="col-auto px-0">
<div class="collapse collapse-horizontal" tabindex="-1" id="sidebar"> <div class="collapse collapse-horizontal" tabindex="-1" id="sidebar">
<div style="width: 350px;"> <div>
<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 %} {% if user.is_authenticated %}
<ul style="z-index:5;" id="sidebar-menu" class="navbar-nav flex-column mb-auto overflow-auto pt-2"> <ul 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"> <li class="d-flex flex-wrap m-2 p-2 pt-0 pb-0 mt-0 mb-0 me-0 pe-0">
<i class="nav-link fas fa-tachometer-alt fa-fw align-self-center me-3 {% navactive request 'authentication:dashboard' %}"></i> <i class="nav-link fas fa-tachometer-alt fa-fw align-self-center me-3 {% navactive request 'authentication:dashboard' %}"></i>
<a class="nav-link flex-fill align-self-center" href="{% url 'authentication:dashboard' %}"> <a class="nav-link flex-fill align-self-center" href="{% url 'authentication:dashboard' %}">
@ -17,8 +17,10 @@
{% sorted_menu_items %} {% sorted_menu_items %}
</ul> </ul>
{% include 'menu/menu-logo.html' %}
{% endif %} {% endif %}
{% include 'menu/menu-logo.html' %}
{% include 'menu/menu-user.html' %} {% include 'menu/menu-user.html' %}
</div> </div>
</div> </div>

View File

@ -23,7 +23,7 @@
</p> </p>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped" id="tab_permissions_audit" style="width: 100%;"> <table class="table table-striped w-100" id="tab_permissions_audit">
<thead> <thead>
<tr> <tr>
<th scope="col">{% translate "Group" %}</th> <th scope="col">{% translate "Group" %}</th>

View File

@ -23,7 +23,7 @@
</p> </p>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped" id="tab_permissions_overview" style="width: 100%;"> <table class="table table-striped w-100" id="tab_permissions_overview">
<thead> <thead>
<tr> <tr>
<th scope="col">{% translate "App" %}</th> <th scope="col">{% translate "App" %}</th>

View File

@ -23,7 +23,7 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-6"> <div class="col-md-6">
{% if generated != "" %} {% if generated != "" %}
<div class="text-right mb-3"> <div class="text-end mb-3">
<textarea class="form-control" rows="10" cols="60">{{ generated }}</textarea> <textarea class="form-control" rows="10" cols="60">{{ generated }}</textarea>
</div> </div>
{% endif %} {% endif %}

View File

@ -1,6 +1,6 @@
{% load i18n %} {% load i18n %}
<div class="card text-center m-3" style="min-width: 18rem; min-height: 18rem;"> <div class="card text-center m-2" style="min-width: 18rem; min-height: 18rem;">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">{% block title %}{% endblock title %}</h5> <h5 class="card-title">{% block title %}{% endblock title %}</h5>

View File

@ -2,7 +2,7 @@
{% load humanize %} {% load humanize %}
{% if notifications %} {% if notifications %}
<div class="col-12 align-self-stretch pb-2"> <div id="aa-dashboard-panel-admin-notifications" class="col-12 align-self-stretch pb-2">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="d-flex align-items-center"> <div class="d-flex align-items-center">
@ -51,10 +51,10 @@
</div> </div>
{% endif %} {% endif %}
<div class="col-12 align-self-stretch py-2"> <div class="col-12 align-self-stretch pb-2">
<div class="card"> <div class="card">
<div class="card-body d-flex flex-row flex-wrap"> <div class="card-body d-flex flex-row flex-wrap">
<div class="col-xl-6 col-lg-12 col-md-12 col-sm-12"> <div id="aa-dashboard-panel-software-version" class="col-xl-6 col-lg-12 col-md-12 col-sm-12">
<h4 class="ms-auto me-auto text-center"> <h4 class="ms-auto me-auto text-center">
{% translate "Software Version" %} {% translate "Software Version" %}
</h4> </h4>
@ -97,7 +97,7 @@
</div> </div>
</div> </div>
<div class="col-xl-6 col-lg-12 col-md-12 col-sm-12"> <div id="aa-dashboard-panel-task-queue" class="col-xl-6 col-lg-12 col-md-12 col-sm-12">
<h4 class="ms-auto me-auto text-center"> <h4 class="ms-auto me-auto text-center">
{% translate "Task Queue" %} {% translate "Task Queue" %}
</h4> </h4>

View File

@ -1,6 +1,6 @@
{% load i18n %} {% load i18n %}
<li class="nav-item active"> <li class="nav-item">
<a href="{% url 'authentication:add_character' %}" class="nav-link" title="{% translate 'Add Character' %}"> <a href="{% url 'authentication:add_character' %}" class="nav-link" title="{% translate 'Add Character' %}">
<i class="fa-solid fa-plus"></i> <i class="fa-solid fa-plus"></i>
<span class="d-lg-none d-md-inline m-2">{% translate "Add Character" %}</span> <span class="d-lg-none d-md-inline m-2">{% translate "Add Character" %}</span>

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 }}">

View File

@ -1,9 +1,13 @@
{% load i18n %}
<form action="{% url 'theme' %}?next={{ next|urlencode }}" method="post"> <form action="{% url 'theme' %}?next={{ next|urlencode }}" method="post">
{% csrf_token %} {% csrf_token %}
<select name="theme" value="theme" class="form-select" aria-label="" onchange="this.form.submit()">
<option selected>Select Theme</option> <select name="theme" class="form-select" aria-label="" onchange="this.form.submit()">
<option selected>{% translate "Select Theme" %}</option>
{% for theme in themes %} {% for theme in themes %}
<option value="{{ theme.get_name }}">{{ theme.name }}</option> <option value="{{ theme.get_name }}"{% if selected_theme.name == theme.name %} selected="selected"{% endif %}>{{ theme.name }}</option>
{% endfor %} {% endfor %}
</select> </select>
</form> </form>

View File

@ -72,5 +72,6 @@ def theme_select(context):
request = context['request'] request = context['request']
return { return {
'next': request.path, 'next': request.path,
'themes': get_hooks('theme_hook') 'themes': get_hooks('theme_hook'),
'selected_theme': get_theme(request)
} }