mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-09 12:30:15 +02:00
Merge branch 'v4.x' of gitlab.com:allianceauth/allianceauth into v4.x
This commit is contained in:
commit
e8c3b5225c
@ -17,7 +17,7 @@
|
|||||||
<span class="d-md-inline m-2">{% translate 'Change Main' %}</span>
|
<span class="d-md-inline m-2">{% translate 'Change Main' %}</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<table class="table" style="--bs-table-bg: transparent;">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-center"></th>
|
<th class="text-center"></th>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div style="height: 300px; overflow-y:auto;">
|
<div style="height: 300px; overflow-y:auto;">
|
||||||
<h6 class="text-center">{% translate "State:" %} {{ request.user.profile.state }}</h6>
|
<h6 class="text-center">{% translate "State:" %} {{ request.user.profile.state }}</h6>
|
||||||
<table class="table" style="--bs-table-bg: transparent;">
|
<table class="table">
|
||||||
{% for group in groups %}
|
{% for group in groups %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text-center">{{ group.name }}</td>
|
<td class="text-center">{{ group.name }}</td>
|
||||||
|
@ -64,7 +64,7 @@ class TestViews(TestCase):
|
|||||||
content = response_content_to_str(response)
|
content = response_content_to_str(response)
|
||||||
|
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertIn('<a data-toggle="tab" href="#leave">', content)
|
self.assertIn('id="leave-tab" data-bs-toggle="tab" data-bs-target="#leave"', content)
|
||||||
self.assertIn('<div id="leave" class="tab-pane">', content)
|
self.assertIn('<div id="leave" class="tab-pane">', content)
|
||||||
|
|
||||||
@override_settings(GROUPMANAGEMENT_AUTO_LEAVE=True)
|
@override_settings(GROUPMANAGEMENT_AUTO_LEAVE=True)
|
||||||
@ -81,5 +81,5 @@ class TestViews(TestCase):
|
|||||||
content = response_content_to_str(response)
|
content = response_content_to_str(response)
|
||||||
|
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.assertNotIn('<a data-toggle="tab" href="#leave">', content)
|
self.assertNotIn('id="leave-tab" data-bs-toggle="tab" data-bs-target="#leave"', content)
|
||||||
self.assertNotIn('<div id="leave" class="tab-pane">', content)
|
self.assertNotIn('<div id="leave" class="tab-pane">', content)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load navactive %}
|
{% load navactive %}
|
||||||
{% load menu_items %}
|
{% load menu_menu_items %}
|
||||||
|
|
||||||
<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 style="width: 350px;">
|
||||||
|
@ -29,7 +29,7 @@ def menu_items(context):
|
|||||||
@register.inclusion_tag('menu/menu-block.html', takes_context=True)
|
@register.inclusion_tag('menu/menu-block.html', takes_context=True)
|
||||||
def sorted_menu_items(context):
|
def sorted_menu_items(context):
|
||||||
request = context['request']
|
request = context['request']
|
||||||
manu_items = MenuItem.render_menu(request)
|
menu_items = MenuItem.render_menu(request)
|
||||||
return {
|
return {
|
||||||
'menu_items':manu_items
|
'menu_items':menu_items
|
||||||
}
|
}
|
@ -8,7 +8,7 @@
|
|||||||
<th class="text-end">{% translate "Action" %}</th>
|
<th class="text-end">{% translate "Action" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for notif in notifications %}
|
{% for notif in notifications %}
|
||||||
<tr class="{{ notif.level }}">
|
<tr class="table-{{ notif.level }}">
|
||||||
<td>{{ notif.timestamp }}</td>
|
<td>{{ notif.timestamp }}</td>
|
||||||
<td>{{ notif.title }}</td>
|
<td>{{ notif.title }}</td>
|
||||||
<td class="text-end">
|
<td class="text-end">
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<h4 class="card-title text-center">{% translate "Upcoming Fleets" %}</h4>
|
<h4 class="card-title text-center">{% translate "Upcoming Fleets" %}</h4>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div style="height: 300px; overflow-y:auto;">
|
<div style="height: 300px; overflow-y:auto;">
|
||||||
<table class="table" style="--bs-table-bg: transparent;">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-center">{% translate "Operation" %}</th>
|
<th class="text-center">{% translate "Operation" %}</th>
|
||||||
|
@ -3,7 +3,7 @@ from django import urls
|
|||||||
from django.contrib.auth.models import Group, Permission
|
from django.contrib.auth.models import Group, Permission
|
||||||
|
|
||||||
from allianceauth.tests.auth_utils import AuthUtils
|
from allianceauth.tests.auth_utils import AuthUtils
|
||||||
|
from allianceauth.menu.models import MenuItem
|
||||||
|
|
||||||
class PermissionsToolViewsTestCase(WebTest):
|
class PermissionsToolViewsTestCase(WebTest):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@ -34,13 +34,19 @@ class PermissionsToolViewsTestCase(WebTest):
|
|||||||
self.member.user_permissions.add(self.permission)
|
self.member.user_permissions.add(self.permission)
|
||||||
AuthUtils.connect_signals()
|
AuthUtils.connect_signals()
|
||||||
|
|
||||||
|
# TODO find a nicer way to do this later
|
||||||
|
MenuItem.sync_hook_models()
|
||||||
|
|
||||||
def test_menu_item(self):
|
def test_menu_item(self):
|
||||||
|
# If we change the side menu again this will fail again.
|
||||||
self.app.set_user(self.member)
|
self.app.set_user(self.member)
|
||||||
response = self.app.get(urls.reverse('permissions_tool:overview'))
|
response = self.app.get(urls.reverse('permissions_tool:overview'))
|
||||||
|
|
||||||
response_content = response.content.decode('utf-8')
|
response_content = response.content.decode(response.charset)
|
||||||
|
|
||||||
self.assertInHTML('<li><a class="active" href="/permissions/overview/"><i class="fas fa-id-card fa-fw"></i> Permissions Audit</a></li>', response_content)
|
self.assertIn("fa-id-card", response_content)
|
||||||
|
self.assertIn('href="/permissions/overview/"', response_content)
|
||||||
|
self.assertIn("Permissions Audit", response_content)
|
||||||
|
|
||||||
def test_permissions_overview(self):
|
def test_permissions_overview(self):
|
||||||
self.app.set_user(self.member)
|
self.app.set_user(self.member)
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
from django import template
|
|
||||||
|
|
||||||
from allianceauth.hooks import get_hooks
|
|
||||||
|
|
||||||
register = template.Library()
|
|
||||||
|
|
||||||
|
|
||||||
def process_menu_items(hooks, request):
|
|
||||||
_menu_items = list()
|
|
||||||
items = [fn() for fn in hooks]
|
|
||||||
items.sort(key=lambda i: i.order)
|
|
||||||
for item in items:
|
|
||||||
_menu_items.append(item.render(request))
|
|
||||||
return _menu_items
|
|
||||||
|
|
||||||
|
|
||||||
@register.inclusion_tag('public/menublock.html', takes_context=True)
|
|
||||||
def menu_items(context):
|
|
||||||
request = context['request']
|
|
||||||
|
|
||||||
return {
|
|
||||||
'menu_items': process_menu_items(get_hooks('menu_item_hook'), request),
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
/* BS 5 Additions
|
|
||||||
|
|
||||||
Helpful CSS classes that are missing in BS5
|
|
||||||
------------------------------------------------------------------------------------- */
|
|
||||||
@media all {
|
|
||||||
.cursor-auto {
|
|
||||||
cursor: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-default {
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-pointer {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-wait {
|
|
||||||
cursor: wait;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-text {
|
|
||||||
cursor: text;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-move {
|
|
||||||
cursor: move;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-help {
|
|
||||||
cursor: help;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-not-allowed {
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-inherit {
|
|
||||||
cursor: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-zoom-in {
|
|
||||||
cursor: zoom-in;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cursor-zoom-out {
|
|
||||||
cursor: zoom-out;
|
|
||||||
}
|
|
||||||
}
|
|
101
allianceauth/static/allianceauth/css/auth-framework.css
Normal file
101
allianceauth/static/allianceauth/css/auth-framework.css
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
/**
|
||||||
|
* Alliance Auth CSS Framework
|
||||||
|
*
|
||||||
|
* This provides some CSS classes together with a couple of Bootstrap fixes
|
||||||
|
* to be used throughout Alliance Auth and its Community Apps
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Bootstrap fixes
|
||||||
|
------------------------------------------------------------------------------------- */
|
||||||
|
@media all {
|
||||||
|
.table {
|
||||||
|
--bs-table-bg: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Cursor classes
|
||||||
|
------------------------------------------------------------------------------------- */
|
||||||
|
@media all {
|
||||||
|
.cursor-auto {
|
||||||
|
cursor: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-default {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-pointer {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-wait {
|
||||||
|
cursor: wait;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-text {
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-move {
|
||||||
|
cursor: move;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-help {
|
||||||
|
cursor: help;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-not-allowed {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-inherit {
|
||||||
|
cursor: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-zoom-in {
|
||||||
|
cursor: zoom-in;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cursor-zoom-out {
|
||||||
|
cursor: zoom-out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Callouts
|
||||||
|
*
|
||||||
|
* Not quite alerts, but custom and helpful notes for folks.
|
||||||
|
* Requires a base and modifier class.
|
||||||
|
------------------------------------------------------------------------------------- */
|
||||||
|
@media all {
|
||||||
|
/* Common styles for all types */
|
||||||
|
.aa-callout {
|
||||||
|
border: 1px solid var(--bs-border-color);
|
||||||
|
border-left-width: 0.25rem;
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
margin-bottom: 1.25rem;
|
||||||
|
margin-top: 1.25rem;
|
||||||
|
padding: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Last item bottom margin should be 0 */
|
||||||
|
.aa-callout :last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Variations */
|
||||||
|
.aa-callout.aa-callout-danger {
|
||||||
|
border-left-color: var(--bs-danger);
|
||||||
|
}
|
||||||
|
|
||||||
|
.aa-callout.aa-callout-info {
|
||||||
|
border-left-color: var(--bs-info);
|
||||||
|
}
|
||||||
|
|
||||||
|
.aa-callout.aa-callout-success {
|
||||||
|
border-left-color: var(--bs-success);
|
||||||
|
}
|
||||||
|
|
||||||
|
.aa-callout.aa-callout-warning {
|
||||||
|
border-left-color: var(--bs-warning);
|
||||||
|
}
|
||||||
|
}
|
@ -22,7 +22,7 @@
|
|||||||
{% theme_css %}
|
{% theme_css %}
|
||||||
|
|
||||||
{% include 'bundles/fontawesome.html' %}
|
{% include 'bundles/fontawesome.html' %}
|
||||||
{% include 'bundles/auth-base-bs5-css.html' %}
|
{% include 'bundles/auth-framework-css.html' %}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.navbar-toggler.collapsed{
|
.navbar-toggler.collapsed{
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<div class="alert alert-{{ message.level_tag }} alert-dismissible d-flex align-items-center fade show" role="alert">
|
<div class="alert alert-{{ message.level_tag }} alert-dismissible d-flex align-items-center fade show" role="alert">
|
||||||
|
|
||||||
<div class="" style="">
|
<div>
|
||||||
{% if message.level_tag == "info" %}
|
{% if message.level_tag == "info" %}
|
||||||
<i class="fas fa-info-circle"></i>
|
<i class="fas fa-info-circle"></i>
|
||||||
{% elif message.level_tag == "success" %}
|
{% elif message.level_tag == "success" %}
|
||||||
@ -15,12 +15,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ms-2" style="">
|
<div class="ms-2">
|
||||||
{{ message }}
|
{{ message }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load navactive %}
|
{% load navactive %}
|
||||||
{% load menu_items %}
|
{% load menu_menu_items %}
|
||||||
|
|
||||||
<div class="col-sm-2 auth-side-navbar" role="navigation">
|
<div class="col-sm-2 auth-side-navbar" role="navigation">
|
||||||
<div class="collapse navbar-collapse auth-menus-collapse auth-side-navbar-collapse">
|
<div class="collapse navbar-collapse auth-menus-collapse auth-side-navbar-collapse">
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
{% load static %}
|
|
||||||
|
|
||||||
<link href="{% static 'allianceauth/css/auth-base-bs5.css' %}" rel="stylesheet">
|
|
3
allianceauth/templates/bundles/auth-framework-css.html
Normal file
3
allianceauth/templates/bundles/auth-framework-css.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% load static %}
|
||||||
|
|
||||||
|
<link href="{% static 'allianceauth/css/auth-framework.css' %}" rel="stylesheet">
|
@ -7,7 +7,7 @@
|
|||||||
<h4 class="card-title text-center">{% translate "Upcoming Timers" %}</h4>
|
<h4 class="card-title text-center">{% translate "Upcoming Timers" %}</h4>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div style="height: 300px; overflow-y:auto;">
|
<div style="height: 300px; overflow-y:auto;">
|
||||||
<table class="table" style="--bs-table-bg: transparent;">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-center">{% translate "Details" %}</th>
|
<th class="text-center">{% translate "Details" %}</th>
|
||||||
@ -20,10 +20,10 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for timer in timers %}
|
{% for timer in timers %}
|
||||||
<tr>
|
<tr>
|
||||||
<td style="" class="text-center">
|
<td class="text-center">
|
||||||
{{ timer.details }}
|
{{ timer.details }}
|
||||||
</td>
|
</td>
|
||||||
<td style="" class="text-center">
|
<td class="text-center">
|
||||||
{{ timer.get_timer_type_display }}
|
{{ timer.get_timer_type_display }}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center" nowrap>
|
<td class="text-center" nowrap>
|
||||||
|
@ -98,7 +98,7 @@ class TimerboardViewsTestCase(WebTest):
|
|||||||
|
|
||||||
response = self.app.get(self.view_url)
|
response = self.app.get(self.view_url)
|
||||||
|
|
||||||
context = response.context[-1]
|
context = response.context
|
||||||
|
|
||||||
timers = context['timers']
|
timers = context['timers']
|
||||||
corp_timers = context['corp_timers']
|
corp_timers = context['corp_timers']
|
||||||
|
@ -67,6 +67,7 @@ class AddUpdateMixin:
|
|||||||
|
|
||||||
class AddTimerView(TimerManagementView, AddUpdateMixin, CreateView):
|
class AddTimerView(TimerManagementView, AddUpdateMixin, CreateView):
|
||||||
template_name_suffix = '_create_form'
|
template_name_suffix = '_create_form'
|
||||||
|
form_class = TimerForm
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
result = super().form_valid(form)
|
result = super().form_valid(form)
|
||||||
@ -78,6 +79,7 @@ class AddTimerView(TimerManagementView, AddUpdateMixin, CreateView):
|
|||||||
|
|
||||||
class EditTimerView(TimerManagementView, AddUpdateMixin, UpdateView):
|
class EditTimerView(TimerManagementView, AddUpdateMixin, UpdateView):
|
||||||
template_name_suffix = '_update_form'
|
template_name_suffix = '_update_form'
|
||||||
|
form_class = TimerForm
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
messages.success(self.request, _('Saved changes to the timer.'))
|
messages.success(self.request, _('Saved changes to the timer.'))
|
||||||
@ -85,7 +87,7 @@ class EditTimerView(TimerManagementView, AddUpdateMixin, UpdateView):
|
|||||||
|
|
||||||
|
|
||||||
class RemoveTimerView(TimerManagementView, DeleteView):
|
class RemoveTimerView(TimerManagementView, DeleteView):
|
||||||
pass
|
form_class = TimerForm
|
||||||
|
|
||||||
|
|
||||||
def dashboard_timers(request):
|
def dashboard_timers(request):
|
||||||
|
BIN
docs/_static/images/development/css-framework/callout-boxes.png
vendored
Normal file
BIN
docs/_static/images/development/css-framework/callout-boxes.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
42
docs/development/custom/css-framework.md
Normal file
42
docs/development/custom/css-framework.md
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# CSS Framework
|
||||||
|
|
||||||
|
To establish a unified style language throughout Alliance Auth and Community Apps,
|
||||||
|
Alliance Auth is providing its own CSS framework with a couple of CSS classes.
|
||||||
|
|
||||||
|
## Callout-Boxes
|
||||||
|
|
||||||
|
These are similar to the Bootstrap alert/notification boxes, but not as "loud".
|
||||||
|
|
||||||
|
Callout-boxes need a base-class (`.aa-callout`) and a modifier-class (e.g.:
|
||||||
|
`.aa-callout-info` for an info-box). Modifier classes are available for the usual
|
||||||
|
Bootstrap alert levels "Success", "Info", "Warning" and "Danger".
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### HTML
|
||||||
|
|
||||||
|
```html
|
||||||
|
<div class="aa-callout aa-callout-success">
|
||||||
|
<p>
|
||||||
|
This is a success callout-box.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="aa-callout aa-callout-info">
|
||||||
|
<p>
|
||||||
|
This is an info callout-box.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="aa-callout aa-callout-warning">
|
||||||
|
<p>
|
||||||
|
This is a warning callout-box.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="aa-callout aa-callout-danger">
|
||||||
|
<p>
|
||||||
|
This is a danger callout-box.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
```
|
@ -11,4 +11,5 @@ This section describes how to extend **Alliance Auth** with custom apps, service
|
|||||||
menu-hooks
|
menu-hooks
|
||||||
url-hooks
|
url-hooks
|
||||||
logging
|
logging
|
||||||
|
css-framework
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user