Compare commits

..

40 Commits

Author SHA1 Message Date
Ariel Rin
abff26fb6e Version Bump 4.0.0a2 2023-10-27 22:48:06 +10:00
Ariel Rin
e8c3b5225c Merge branch 'v4.x' of gitlab.com:allianceauth/allianceauth into v4.x 2023-10-27 22:42:53 +10:00
Ariel Rin
98fd1dcc4c Merge branch 'master' of gitlab.com:allianceauth/allianceauth into v4.x 2023-10-27 22:42:30 +10:00
Ariel Rin
cfe46e4ca5 Merge branch 'fix-same-name-template-tag-modules' into 'v4.x'
[FIX] Give template tag modules unique names

See merge request allianceauth/allianceauth!1548
2023-10-27 12:15:27 +00:00
Peter Pfeufer
4675193416 [REEMOVE] services.templatetags as its no longer needed 2023-10-27 14:08:44 +02:00
Ariel Rin
a84fa1ca69 Merge branch 'aa-css-framework' into 'v4.x'
Alliance Auth CSS Framework

See merge request allianceauth/allianceauth!1544
2023-10-27 11:58:16 +00:00
Ariel Rin
8f6cb0b9bb Merge branch 'fix-notification-colors' into 'v4.x'
[FIX]  Restore notification level colours

See merge request allianceauth/allianceauth!1547
2023-10-27 11:54:40 +00:00
Ariel Rin
1c8634f1c8 Merge branch 'theme-work' into 'v4.x'
Theme test fixes

See merge request allianceauth/allianceauth!1549
2023-10-27 11:33:08 +00:00
Aaron Kable
2a21599d45 BS5 Theme test fixes 2023-10-27 11:33:08 +00:00
Peter Pfeufer
e379c01655 [FIX] Typo in variable name while we're at it 2023-10-27 08:31:55 +02:00
Peter Pfeufer
afa3d2e7cc [FIX] Give template tags modules unique names
This fixes the check error:

?: (templates.E003) 'menu_items' is used for multiple template tag modules: 'allianceauth.menu.templatetags.menu_items', 'allianceauth.services.templatetags.menu_items'
2023-10-27 08:28:09 +02:00
Peter Pfeufer
e5ed33aeec [FIX] [Bootstrap] Uniform default table background
Also removed empty style and class arguments while I was at it
2023-10-26 18:21:23 +02:00
Peter Pfeufer
b12471e775 [CHANGE] Bring back the level colors to the notification list 2023-10-26 15:30:54 +02:00
Peter Pfeufer
5e70dab11f [FIX] Ensure the modifier is only applied to elements with the base class 2023-10-24 12:54:20 +02:00
Peter Pfeufer
f728c786b3 [FIX] Grammar and indentation (it's important!) 2023-10-24 12:27:08 +02:00
Peter Pfeufer
7056912d54 [FIX] Path to image in .md file 2023-10-24 11:58:34 +02:00
Peter Pfeufer
7efed950ca [CHANGE] Seems it needs to be a PNG image … 2023-10-24 11:53:00 +02:00
Peter Pfeufer
886acf2005 [ADD] CSS framework docs to custom documentation index 2023-10-24 11:36:54 +02:00
Peter Pfeufer
b2dec3bff2 [FIX] Typo … 2023-10-24 11:31:15 +02:00
Peter Pfeufer
f0a402e141 [ADD] Documentation 2023-10-24 11:25:52 +02:00
Peter Pfeufer
2e2afd7923 [ADD] Callout boxes
Not quite alerts, but custom and helpful notes for folks. Requires a base and modifier class.
2023-10-24 11:05:15 +02:00
Peter Pfeufer
e9ea09bc56 [CHANGE] Rename auth-base-bs5.css to auth-framework.css 2023-10-24 10:58:45 +02:00
Ariel Rin
186fa1be03 Correct Django version back to !1541 after porting !1513 2023-10-24 12:37:37 +10:00
Ariel Rin
37d1d84fc3 Merge branch 'aa4-bs5-template-fixes' into 'v4.x'
v4 Template fixes

See merge request allianceauth/allianceauth!1541
2023-10-24 02:04:50 +00:00
Peter Pfeufer
ee24706e43 v4 Template fixes 2023-10-24 02:04:49 +00:00
Ariel Rin
07e85727ea Merge branch 'v4theme' into 'v4.x'
Theme handling improvements

See merge request allianceauth/allianceauth!1542
2023-10-21 09:08:28 +00:00
Ariel Rin
4912f0f8f0 Theme handling improvements 2023-10-21 09:08:28 +00:00
Ariel Rin
424246df26 Version Bump 3.7.1 2023-10-19 14:00:29 +10:00
Ariel Rin
563e2210ef Bump Django-ESI to >=5.0.0 2023-10-19 13:11:35 +10:00
Ariel Rin
02a1078005 Merge branch 'remove-thirdparty' into 'master'
Remove outdated supervisor configs - refer to docs

See merge request allianceauth/allianceauth!1533
2023-10-19 03:03:35 +00:00
Ariel Rin
30107de44e Merge branch 'docs-precommit' into 'master'
Add code-style docs

Closes #1379

See merge request allianceauth/allianceauth!1534
2023-10-19 03:03:14 +00:00
Ariel Rin
77a08cd218 Add code-style docs 2023-10-07 22:32:19 +10:00
Ariel Rin
e5a09027e5 Remove outdated supervisor configs - refer to docs 2023-10-07 21:53:03 +10:00
Ariel Rin
24376262f0 minor doc structure changes 2023-10-07 21:27:08 +10:00
Ariel Rin
efe0c6963b move doc dependencies to pyproject 2023-10-07 20:45:39 +10:00
Ariel Rin
a4644028ae file path typos 2023-10-07 20:44:16 +10:00
Ariel Rin
3a77b4a429 Add missing docker tags, make docker buildsteps more readable 2023-10-07 19:57:55 +10:00
Ariel Rin
52b6c5d341 Rework default celery configuration and documentation 2023-10-07 19:31:53 +10:00
Ariel Rin
fa375a551c Merge branch 'celry' into 'v4.x'
Rework default celery configuration and documentation

See merge request allianceauth/allianceauth!1482
2023-10-07 09:28:04 +00:00
Aaron Kable
00a93e6fe9 Rework default celery configuration and documentation 2023-10-07 09:28:04 +00:00
92 changed files with 1082 additions and 983 deletions

View File

@@ -259,7 +259,16 @@ build-image:
docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-*
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --use --name new-builder
docker buildx build . -t $IMAGE_TAG -t $MINOR_TAG -t $MAJOR_TAG -t $LATEST_TAG -f docker/Dockerfile --platform linux/amd64,linux/arm64 --push --build-arg AUTH_VERSION=$(echo $CI_COMMIT_TAG | cut -c 2-)
docker buildx build .
--tag $IMAGE_TAG
--tag $CURRENT_TAG
--tag $MINOR_TAG
--tag $MAJOR_TAG
--tag $LATEST_TAG
--file docker/Dockerfile
--platform linux/amd64,linux/arm64
--push
--build-arg AUTH_VERSION=$(echo $CI_COMMIT_TAG | cut -c 2-)
rules:
- if: $CI_COMMIT_TAG
when: delayed
@@ -279,7 +288,12 @@ build-image-dev:
docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-*
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --use --name new-builder
docker buildx build . -t $IMAGE_TAG -f docker/Dockerfile --platform linux/amd64,linux/arm64 --push --build-arg AUTH_PACKAGE=git+https://gitlab.com/allianceauth/allianceauth@$CI_COMMIT_BRANCH
docker buildx build .
--tag $IMAGE_TAG
--file docker/Dockerfile
--platform linux/amd64,linux/arm64
--push
--build-arg AUTH_PACKAGE=git+https://gitlab.com/allianceauth/allianceauth@$CI_COMMIT_BRANCH
rules:
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == ""'
when: manual
@@ -300,7 +314,12 @@ build-image-mr:
docker run --privileged --rm tonistiigi/binfmt --uninstall qemu-*
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --use --name new-builder
docker buildx build . -t $IMAGE_TAG -f docker/Dockerfile --platform linux/amd64,linux/arm64 --push --build-arg AUTH_PACKAGE=git+$CI_MERGE_REQUEST_SOURCE_PROJECT_URL@$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
docker buildx build .
--tag $IMAGE_TAG
--file docker/Dockerfile
--platform linux/amd64,linux/arm64
--push
--build-arg AUTH_PACKAGE=git+$CI_MERGE_REQUEST_SOURCE_PROJECT_URL@$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: manual

View File

@@ -23,4 +23,7 @@ formats: all
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- docs

View File

@@ -5,7 +5,7 @@ manage online service access.
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
__version__ = '4.0.0a1'
__version__ = '4.0.0a2'
__title__ = 'Alliance Auth'
__url__ = 'https://gitlab.com/allianceauth/allianceauth'
NAME = f'{__title__} v{__version__}'

View File

@@ -44,6 +44,8 @@ class UserSettingsMiddleware(MiddlewareMixin):
logger.exception(e)
# AA v4 Themes
# Null = has not been set by the user ever, dont act
# DEFAULT_THEME or DEFAULT_THEME_DARK will be used in get_theme()
try:
if request.user.profile.theme is not None:
request.session["THEME"] = request.user.profile.theme

View File

@@ -1,5 +1,5 @@
{% load i18n %}
<div class="col-12 col-xl-8 align-self-stretch p-2">
<div class="col-12 col-xl-8 align-self-stretch p-2 ps-0">
<div class="card">
<div class="card-body">
<div class="d-flex align-items-center">
@@ -8,32 +8,37 @@
</h4>
</div>
<div class="card-body">
<div style="height: 300px;overflow:-moz-scrollbars-vertical;overflow-y:auto;">
<div class="d-flex">
<a href="{% url 'authentication:add_character' %}" class="btn btn-primary flex-fill m-1" title="{% translate 'Add Character' %}"><span class="d-md-inline m-2">{% translate 'Add Character' %}</span></a>
<a href="{% url 'authentication:change_main_character' %}" class="btn btn-primary flex-fill m-1" title="{% translate 'Change Main' %}"></span><span class="d-md-inline m-2">{% translate 'Change Main' %}</span></a>
</div>
<table class="table" style="--bs-table-bg: transparent;">
<thead>
<tr>
<th class="text-center"></th>
<th class="text-center">{% translate "Name" %}</th>
<th class="text-center">{% translate "Corp" %}</th>
<th class="text-center">{% translate "Alliance" %}</th>
</tr>
</thead>
<tbody>
{% for char in characters %}
<div style="height: 300px; overflow-y:auto;">
<div class="d-flex">
<a href="{% url 'authentication:add_character' %}" class="btn btn-primary flex-fill m-1" title="{% translate 'Add Character' %}">
<span class="d-md-inline m-2">{% translate 'Add Character' %}</span>
</a>
<a href="{% url 'authentication:change_main_character' %}" class="btn btn-primary flex-fill m-1" title="{% translate 'Change Main' %}">
<span class="d-md-inline m-2">{% translate 'Change Main' %}</span>
</a>
</div>
<table class="table">
<thead>
<tr>
<td class="text-center"><img class="ra-avatar rounded-circle" src="{{ char.portrait_url_32 }}">
</td>
<td class="text-center">{{ char.character_name }}</td>
<td class="text-center">{{ char.corporation_name }}</td>
<td class="text-center">{{ char.alliance_name|default_if_none:"" }}</td>
<th class="text-center"></th>
<th class="text-center">{% translate "Name" %}</th>
<th class="text-center">{% translate "Corp" %}</th>
<th class="text-center">{% translate "Alliance" %}</th>
</tr>
{% endfor %}
</tbody>
</table>
</thead>
<tbody>
{% for char in characters %}
<tr>
<td class="text-center">
<img class="ra-avatar rounded-circle" src="{{ char.portrait_url_32 }}" alt="{{ char.character_name }}">
</td>
<td class="text-center">{{ char.character_name }}</td>
<td class="text-center">{{ char.corporation_name }}</td>
<td class="text-center">{{ char.alliance_name|default_if_none:"" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>

View File

@@ -1,12 +1,12 @@
{% load i18n %}
<div class="col-12 col-xl-4 align-self-stretch p-2">
<div class="col-12 col-xl-4 align-self-stretch py-2 ps-2">
<div class="card h-100">
<div class="card-body">
<h4 class="card-title text-center">{% translate "Membership" %}</h4>
<div class="card-body">
<div style="height: 300px;overflow:-moz-scrollbars-vertical;overflow-y:auto;">
<div style="height: 300px; overflow-y:auto;">
<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 %}
<tr>
<td class="text-center">{{ group.name }}</td>

View File

@@ -5,8 +5,8 @@
{% block content %}
<h1 class="page-header text-center">{% translate "Token Management" %}</h1>
<div class="col-sm-12">
<table class="table table-aa" id="table_tokens" style="width:100%">
<div>
<table class="table table-aa" id="table_tokens" style="width: 100%;">
<thead>
<tr>
<th>{% translate "Scopes" %}</th>
@@ -18,8 +18,11 @@
<tbody>
{% for t in tokens %}
<tr>
<td styl="white-space:initial;">{% for s in t.scopes.all %}<span class="badge badge-secondar">{{ s.name }}</span> {% endfor %}</td>
<td nowrap class="text-end"><a href="{% url 'authentication:token_delete' t.id %}" class="btn btn-danger"><i class="fas fa-trash"></i></a> <a href="{% url 'authentication:token_refresh' t.id %}" class="btn btn-success"><i class="fas fa-sync-alt"></i></a></td>
<td style="white-space:initial;">{% for s in t.scopes.all %}<span class="badge bg-secondary">{{ s.name }}</span>{% endfor %}</td>
<td nowrap class="text-end">
<a href="{% url 'authentication:token_delete' t.id %}" class="btn btn-danger"><i class="fas fa-trash"></i></a>
<a href="{% url 'authentication:token_refresh' t.id %}" class="btn btn-success"><i class="fas fa-sync-alt"></i></a>
</td>
<td>{{ t.character_name }}</td>
</tr>
{% endfor %}

View File

@@ -31,7 +31,7 @@
}
.panel-transparent {
background: rgba(48, 48, 48, 0.7);
background: rgba(48 48 48 / 0.7);
color: #ffffff;
padding-bottom: 21px;
}

View File

@@ -32,6 +32,7 @@ def create_project(parser, options, args):
'python': shutil.which('python'),
'gunicorn': shutil.which('gunicorn'),
'celery': shutil.which('celery'),
'memmon': shutil.which('memmon'),
'extensions': ['py', 'conf', 'json'],
}

View File

@@ -1,5 +1,5 @@
from django.conf import settings
from .views import NightModeRedirectView, ThemeRedirectView
from .views import NightModeRedirectView
def auth_settings(request):

View File

@@ -4,37 +4,37 @@
{% translate "Corporation Member Data" %}
{% endblock page_title %}
{% block content %}
<div class="col-lg-12">
<div>
<h1 class="page-header text-center">{% translate "Corporation Member Data" %}</h1>
<div class="col-lg-10 col-lg-offset-1 container">
<nav class="navbar navbar-default">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" id="dLabel" class="dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">{% translate "Corporations" %}<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
{% for corpstat in available %}
<li>
<a href="{% url 'corputils:view_corp' corpstat.corp.corporation_id %}">{{ corpstat.corp.corporation_name }}</a>
</li>
{% endfor %}
</ul>
<nav class="navbar navbar-default">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" id="dLabel" class="dropdown-toggle" role="button" data-toggle="dropdown" aria-haspopup="false" aria-expanded="false">{% translate "Corporations" %}<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
{% for corpstat in available %}
<li>
<a href="{% url 'corputils:view_corp' corpstat.corp.corporation_id %}">{{ corpstat.corp.corporation_name }}</a>
</li>
{% endfor %}
</ul>
</li>
{% if perms.corputils.add_corpstats %}
<li>
<a href="{% url 'corputils:add' %}">{% translate "Add" %}</a>
</li>
{% if perms.corputils.add_corpstats %}
<li>
<a href="{% url 'corputils:add' %}">{% translate "Add" %}</a>
</li>
{% endif %}
</ul>
<form class="navbar-form navbar-right" role="search" action="{% url 'corputils:search' %}" method="GET">
<div class="form-group">
<input type="text" class="form-control" name="search_string" placeholder="{% if search_string %}{{ search_string }}{% else %}{% translate 'Search all corporations...' %}{% endif %}">
</div>
</form>
</div>
</nav>
{% block member_data %}
{% endblock member_data %}
</div>
{% endif %}
</ul>
<form class="navbar-form navbar-right" role="search" action="{% url 'corputils:search' %}" method="GET">
<div class="form-group">
<input type="text" class="form-control" name="search_string" placeholder="{% if search_string %}{{ search_string }}{% else %}{% translate 'Search all corporations...' %}{% endif %}">
</div>
</form>
</div>
</nav>
{% block member_data %}
{% endblock member_data %}
</div>
{% endblock content %}

View File

@@ -3,177 +3,175 @@
{% load humanize %}
{% block member_data %}
{% if corpstats %}
<div class="row">
<div class="col-lg-12 text-center">
<table class="table">
<tr>
<td class="text-center col-lg-6{% if corpstats.corp.alliance %}{% else %}col-lg-offset-3{% endif %}">
<img class="ra-avatar" src="{{ corpstats.corp.logo_url_64 }}" alt="{{ corpstats.corp.corporation_name }}">
</td>
{% if corpstats.corp.alliance %}
<td class="text-center col-lg-6">
<img class="ra-avatar" src="{{ corpstats.corp.alliance.logo_url_64 }}" alt="{{ corpstats.corp.alliance.alliance_name }}">
</td>
{% endif %}
</tr>
<tr>
<td class="text-center"><h4>{{ corpstats.corp.corporation_name }}</h4></td>
{% if corpstats.corp.alliance %}
<td class="text-center"><h4>{{ corpstats.corp.alliance.alliance_name }}</h4></td>
{% endif %}
</tr>
</table>
</div>
<div>
<table class="table">
<tr>
<td class="text-center col-lg-6{% if corpstats.corp.alliance %}{% else %}col-lg-offset-3{% endif %}">
<img class="ra-avatar" src="{{ corpstats.corp.logo_url_64 }}" alt="{{ corpstats.corp.corporation_name }}">
</td>
{% if corpstats.corp.alliance %}
<td class="text-center col-lg-6">
<img class="ra-avatar" src="{{ corpstats.corp.alliance.logo_url_64 }}" alt="{{ corpstats.corp.alliance.alliance_name }}">
</td>
{% endif %}
</tr>
<tr>
<td class="text-center"><h4>{{ corpstats.corp.corporation_name }}</h4></td>
{% if corpstats.corp.alliance %}
<td class="text-center"><h4>{{ corpstats.corp.alliance.alliance_name }}</h4></td>
{% endif %}
</tr>
</table>
</div>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<ul class="nav nav-pills pull-left">
<li class="active"><a href="#mains" data-toggle="pill">{% translate 'Mains' %} ({{ total_mains }})</a></li>
<li><a href="#members" data-toggle="pill">{% translate 'Members' %} ({{ corpstats.member_count }})</a></li>
<li><a href="#unregistered" data-toggle="pill">{% translate 'Unregistered' %} ({{ unregistered.count }})</a></li>
</ul>
<div class="pull-right hidden-xs">
{% translate "Last update:" %} {{ corpstats.last_update|naturaltime }}&nbsp;
<a class="btn btn-success" type="button" href="{% url 'corputils:update' corpstats.corp.corporation_id %}" title="Update Now">
<span class="glyphicon glyphicon-refresh"></span>
</a>
</div>
<div class="clearfix"></div>
<div>
<div class="panel panel-default">
<div class="panel-heading">
<ul class="nav nav-pills pull-left">
<li class="active"><a href="#mains" data-toggle="pill">{% translate 'Mains' %} ({{ total_mains }})</a></li>
<li><a href="#members" data-toggle="pill">{% translate 'Members' %} ({{ corpstats.member_count }})</a></li>
<li><a href="#unregistered" data-toggle="pill">{% translate 'Unregistered' %} ({{ unregistered.count }})</a></li>
</ul>
<div class="pull-right hidden-xs">
{% translate "Last update:" %} {{ corpstats.last_update|naturaltime }}&nbsp;
<a class="btn btn-success" type="button" href="{% url 'corputils:update' corpstats.corp.corporation_id %}" title="Update Now">
<span class="glyphicon glyphicon-refresh"></span>
</a>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane fade in active" id="mains">
{% if mains %}
<div class="table-responsive">
<table class="table table-hover" id="table-mains">
<thead>
<div class="clearfix"></div>
</div>
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane fade in active" id="mains">
{% if mains %}
<div class="table-responsive">
<table class="table table-hover" id="table-mains">
<thead>
<tr>
<th style="height:1em;"><!-- Must have text or height to prevent clipping --></th>
<th></th>
</tr>
</thead>
<tbody>
{% for id, main in mains.items %}
<tr>
<th style="height:1em;"><!-- Must have text or height to prevent clipping --></th>
<th></th>
</tr>
</thead>
<tbody>
{% for id, main in mains.items %}
<tr>
<td class="text-center" style="vertical-align:middle">
<div class="thumbnail" style="border: 0 none; box-shadow: none; background: transparent;">
<img src="{{ main.main.portrait_url_64 }}" class="img-circle" alt="{{ main.main }}">
<div class="caption text-center">
{{ main.main }}
</div>
<td class="text-center" style="vertical-align:middle">
<div class="thumbnail" style="border: 0 none; box-shadow: none; background: transparent;">
<img src="{{ main.main.portrait_url_64 }}" class="img-circle" alt="{{ main.main }}">
<div class="caption text-center">
{{ main.main }}
</div>
</td>
<td>
<table class="table table-hover">
{% for alt in main.alts %}
{% if forloop.first %}
<tr>
<th></th>
<th class="text-center">{% translate "Character" %}</th>
<th class="text-center">{% translate "Corporation" %}</th>
<th class="text-center">{% translate "Alliance" %}</th>
<th class="text-center"></th>
</tr>
{% endif %}
</div>
</td>
<td>
<table class="table table-hover">
{% for alt in main.alts %}
{% if forloop.first %}
<tr>
<td class="text-center" style="width:5%">
<div class="thumbnail" style="border: 0 none; box-shadow: none; background: transparent;">
<img src="{{ alt.portrait_url_32 }}" class="img-circle" alt="{{ alt.character_name }}">
</div>
</td>
<td class="text-center" style="width:30%">{{ alt.character_name }}</td>
<td class="text-center" style="width:30%">{{ alt.corporation_name }}</td>
<td class="text-center" style="width:30%">{{ alt.alliance_name }}</td>
<td class="text-center" style="width:5%">
<a href="https://zkillboard.com/character/{{ alt.character_id }}/" class="badge badge-danger" target="_blank">
{% translate "Killboard" %}
</a>
</td>
<th></th>
<th class="text-center">{% translate "Character" %}</th>
<th class="text-center">{% translate "Corporation" %}</th>
<th class="text-center">{% translate "Alliance" %}</th>
<th class="text-center"></th>
</tr>
{% endfor %}
</table>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="tab-pane fade" id="members">
{% if members %}
<div class="table-responsive">
<table class="table table-hover" id="table-members">
<thead>
<tr>
<th></th>
<th class="text-center">{% translate "Character" %}</th>
<th class="text-center"></th>
<th class="text-center">{% translate "Main Character" %}</th>
<th class="text-center">{% translate "Main Corporation" %}</th>
<th class="text-center">{% translate "Main Alliance" %}</th>
{% endif %}
<tr>
<td class="text-center" style="width:5%">
<div class="thumbnail" style="border: 0 none; box-shadow: none; background: transparent;">
<img src="{{ alt.portrait_url_32 }}" class="img-circle" alt="{{ alt.character_name }}">
</div>
</td>
<td class="text-center" style="width:30%">{{ alt.character_name }}</td>
<td class="text-center" style="width:30%">{{ alt.corporation_name }}</td>
<td class="text-center" style="width:30%">{{ alt.alliance_name }}</td>
<td class="text-center" style="width:5%">
<a href="https://zkillboard.com/character/{{ alt.character_id }}/" class="badge bg-danger" target="_blank">
{% translate "Killboard" %}
</a>
</td>
</tr>
{% endfor %}
</table>
</td>
</tr>
</thead>
<tbody>
{% for member in members %}
<tr>
<td><img src="{{ member.portrait_url }}" class="img-circle" alt="{{ member }}"></td>
<td class="text-center">{{ member }}</td>
<td class="text-center">
<a href="https://zkillboard.com/character/{{ member.character_id }}/" class="badge badge-danger" target="_blank">{% translate "Killboard" %}</a>
</td>
<td class="text-center">{{ member.character_ownership.user.profile.main_character.character_name }}</td>
<td class="text-center">{{ member.character_ownership.user.profile.main_character.corporation_name }}</td>
<td class="text-center">{{ member.character_ownership.user.profile.main_character.alliance_name }}</td>
</tr>
{% endfor %}
{% for member in unregistered %}
<tr class="danger">
<td><img src="{{ member.portrait_url }}" class="img-circle" alt="{{ member.character_name }}"></td>
<td class="text-center">{{ member.character_name }}</td>
<td class="text-center">
<a href="https://zkillboard.com/character/{{ member.character_id }}/" class="badge badge-danger" target="_blank">{% translate "Killboard" %}</a>
</td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="tab-pane fade" id="unregistered">
{% if unregistered %}
<div class="table-responsive">
<table class="table table-hover" id="table-unregistered">
<thead>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="tab-pane fade" id="members">
{% if members %}
<div class="table-responsive">
<table class="table table-hover" id="table-members">
<thead>
<tr>
<th></th>
<th class="text-center">{% translate "Character" %}</th>
<th class="text-center"></th>
<th class="text-center">{% translate "Main Character" %}</th>
<th class="text-center">{% translate "Main Corporation" %}</th>
<th class="text-center">{% translate "Main Alliance" %}</th>
</tr>
</thead>
<tbody>
{% for member in members %}
<tr>
<th></th>
<th class="text-center">{% translate "Character" %}</th>
<th class="text-center"></th>
<td><img src="{{ member.portrait_url }}" class="img-circle" alt="{{ member }}"></td>
<td class="text-center">{{ member }}</td>
<td class="text-center">
<a href="https://zkillboard.com/character/{{ member.character_id }}/" class="badge bg-danger" target="_blank">{% translate "Killboard" %}</a>
</td>
<td class="text-center">{{ member.character_ownership.user.profile.main_character.character_name }}</td>
<td class="text-center">{{ member.character_ownership.user.profile.main_character.corporation_name }}</td>
<td class="text-center">{{ member.character_ownership.user.profile.main_character.alliance_name }}</td>
</tr>
</thead>
<tbody>
{% for member in unregistered %}
<tr class="danger">
<td><img src="{{ member.portrait_url }}" class="img-circle" alt="{{ member.character_name }}"></td>
<td class="text-center">{{ member.character_name }}</td>
<td class="text-center">
<a href="https://zkillboard.com/character/{{ member.character_id }}/" class="badge badge-danger" target="_blank">
{% translate "Killboard" %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
{% endfor %}
{% for member in unregistered %}
<tr class="danger">
<td><img src="{{ member.portrait_url }}" class="img-circle" alt="{{ member.character_name }}"></td>
<td class="text-center">{{ member.character_name }}</td>
<td class="text-center">
<a href="https://zkillboard.com/character/{{ member.character_id }}/" class="badge bg-danger" target="_blank">{% translate "Killboard" %}</a>
</td>
<td class="text-center"></td>
<td class="text-center"></td>
<td class="text-center"></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
<div class="tab-pane fade" id="unregistered">
{% if unregistered %}
<div class="table-responsive">
<table class="table table-hover" id="table-unregistered">
<thead>
<tr>
<th></th>
<th class="text-center">{% translate "Character" %}</th>
<th class="text-center"></th>
</tr>
</thead>
<tbody>
{% for member in unregistered %}
<tr class="danger">
<td><img src="{{ member.portrait_url }}" class="img-circle" alt="{{ member.character_name }}"></td>
<td class="text-center">{{ member.character_name }}</td>
<td class="text-center">
<a href="https://zkillboard.com/character/{{ member.character_id }}/" class="badge bg-danger" target="_blank">
{% translate "Killboard" %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</div>
</div>
</div>
@@ -181,12 +179,15 @@
</div>
{% endif %}
{% endblock %}
{% block extra_javascript %}
{% include 'bundles/datatables-js.html' %}
{% endblock %}
{% block extra_css %}
{% include 'bundles/datatables-css.html' %}
{% endblock %}
{% block extra_script %}
$(document).ready(function(){
$('#table-mains').DataTable({

View File

@@ -24,7 +24,7 @@
<td class="text-center"><img src="{{ result.1.portrait_url }}" class="img-circle" alt="{{ result.1.character_name }}"></td>
<td class="text-center">{{ result.1.character_name }}</td>
<td class="text-center">{{ result.0.corp.corporation_name }}</td>
<td class="text-center"><a href="https://zkillboard.com/character/{{ result.1.character_id }}/" class="badge badge-danger" target="_blank">{% translate "Killboard" %}</a></td>
<td class="text-center"><a href="https://zkillboard.com/character/{{ result.1.character_id }}/" class="badge bg-danger" target="_blank">{% translate "Killboard" %}</a></td>
<td class="text-center">{{ result.1.main_character.character_name }}</td>
<td class="text-center">{{ result.1.main_character.corporation_name }}</td>
<td class="text-center">{{ result.1.main_character.alliance_name }}</td>

View File

@@ -17,7 +17,7 @@
<form class="form-signin" role="form" action="" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
<br/>
<br>
<button class="btn btn-lg btn-primary btn-block"
type="submit"
name="submit_fat">

View File

@@ -33,39 +33,39 @@
{% endfor %}
</table>
{% if created_fats %}
<h2>
{% blocktranslate count links=n_created_fats trimmed %}
{{ user }} has created one link this month.
{% plural %}
{{ user }} has created {{ links }} links this month.
{% endblocktranslate %}
</h2>
{% if created_fats %}
<table class="table">
<tr>
<th class="text-center">{% translate "Fleet" %}</th>
<th class="text-center">{% translate "Creator" %}</th>
<th class="text-center">{% translate "Eve Time" %}</th>
<th class="text-center">{% translate "Duration" %}</th>
<th class="text-center">{% translate "Edit" %}</th>
</tr>
{% for link in created_fats %}
<tr>
<td class="text-center"><a href="{% url 'fatlink:click' link.hash %}" class="badge badge-primary">{{ link.fleet }}</a></td>
<td class="text-center">{{ link.creator.username }}</td>
<td class="text-center">{{ link.fatdatetime }}</td>
<td class="text-center">{{ link.duration }}</td>
<td class="text-center">
<a href="{% url 'fatlink:modify' link.hash %}">
<button type="button" class="btn btn-info"><span
class="glyphicon glyphicon-edit"></span></button>
</a>
</td>
</tr>
{% endfor %}
<h2>
{% blocktranslate count links=n_created_fats trimmed %}
{{ user }} has created one link this month.
{% plural %}
{{ user }} has created {{ links }} links this month.
{% endblocktranslate %}
</h2>
{% if created_fats %}
<table class="table">
<tr>
<th class="text-center">{% translate "Fleet" %}</th>
<th class="text-center">{% translate "Creator" %}</th>
<th class="text-center">{% translate "Eve Time" %}</th>
<th class="text-center">{% translate "Duration" %}</th>
<th class="text-center">{% translate "Edit" %}</th>
</tr>
{% for link in created_fats %}
<tr>
<td class="text-center"><a href="{% url 'fatlink:click' link.hash %}" class="badge bg-primary">{{ link.fleet }}</a></td>
<td class="text-center">{{ link.creator.username }}</td>
<td class="text-center">{{ link.fatdatetime }}</td>
<td class="text-center">{{ link.duration }}</td>
<td class="text-center">
<a href="{% url 'fatlink:modify' link.hash %}">
<button type="button" class="btn btn-info"><span
class="glyphicon glyphicon-edit"></span></button>
</a>
</td>
</tr>
{% endfor %}
</table>
{% endif %}
</table>
{% endif %}
{% endif %}
</div>
{% endblock content %}

View File

@@ -10,7 +10,7 @@
<div class="text-end">
<a href="{% url "fatlink:statistics_month" previous_month|date:"Y" previous_month|date:"m" %}" class="btn btn-info">{% translate "Previous month" %}</a>
{% if next_month %}
<a href="{% url 'fatlink:statistics_month' next_month|date:"Y" next_month|date:"m" %}" wclass="btn btn-info">{% translate "Next month" %}</a>
<a href="{% url 'fatlink:statistics_month' next_month|date:"Y" next_month|date:"m" %}" class="btn btn-info">{% translate "Next month" %}</a>
{% endif %}
</div>
</h1>
@@ -31,7 +31,7 @@
{% for corpStat in fatStats %}
<tr>
<td>
<img src="{{ corpStat.corp.logo_url_32 }}" class="ra-avatar img-responsive" alt="{{ corpStat.corp.corporation_name }}"/>
<img src="{{ corpStat.corp.logo_url_32 }}" class="ra-avatar img-responsive" alt="{{ corpStat.corp.corporation_name }}">
</td>
<td class="text-center">
<a href="{% url 'fatlink:statistics_corp' corpStat.corp.corporation_id %}">[{{ corpStat.corp.corporation_ticker }}]</a>

View File

@@ -80,7 +80,7 @@
{% for link in fatlinks %}
<tr>
<td class="text-center">
<a href="{% url 'fatlink:click' link.hash %}" class="badge badge-primary">{{ link.fleet }}</a>
<a href="{% url 'fatlink:click' link.hash %}" class="badge bg-primary">{{ link.fleet }}</a>
</td>
<td class="text-center">{{ link.creator.username }}</td>
<td class="text-center">{{ link.fleet }}</td>

View File

@@ -17,13 +17,15 @@
<div class="table-responsive">
<table class="table table-striped" id="log-entries">
<thead>
<th scope="col">{% translate "Date/Time" %}</th>
<th scope="col">{% translate "Requestor" %}</th>
<th scope="col">{% translate "Character" %}</th>
<th scope="col">{% translate "Corporation" %}</th>
<th scope="col">{% translate "Type" %}</th>
<th scope="col">{% translate "Action" %}</th>
<th scope="col">{% translate "Actor" %}</th>
<tr>
<th scope="col">{% translate "Date/Time" %}</th>
<th scope="col">{% translate "Requestor" %}</th>
<th scope="col">{% translate "Character" %}</th>
<th scope="col">{% translate "Corporation" %}</th>
<th scope="col">{% translate "Type" %}</th>
<th scope="col">{% translate "Action" %}</th>
<th scope="col">{% translate "Actor" %}</th>
</tr>
</thead>
<tbody>

View File

@@ -29,7 +29,7 @@
{% for member in members %}
<tr>
<td>
<img src="{{ member.main_char|character_portrait_url:32 }}" class="rounded-circle" style="margin-right: 1rem;">
<img src="{{ member.main_char|character_portrait_url:32 }}" class="rounded-circle" style="margin-right: 1rem;" alt="{{ member.main_char.character_name }}">
{% if member.main_char %}
<a href="{{ member.main_char|evewho_character_url }}" target="_blank">
{{ member.main_char.character_name }}

View File

@@ -23,7 +23,7 @@
<tr>
<th>{% translate "Name" %}</th>
<th>{% translate "Description" %}</th>
<th>{% translate "Leaders" %}<span class="m-1 fw-lighter badge bg-primary">User</span><span class="m-1 fw-lighter badge bg-secondary ">Group</span></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></th>
</tr>
</thead>
@@ -72,7 +72,6 @@
{% endfor %}
</tbody>
</table>
{% else %}
<div class="alert alert-warning text-center">
{% translate "No groups available." %}
@@ -88,9 +87,7 @@
{% endblock %}
{% block extra_script %}
$(document).ready(function () {
$('#groupsTable').DataTable();
});
{% endblock extra_script %}

View File

@@ -58,7 +58,7 @@
{% for acceptrequest in acceptrequests %}
<tr>
<td>
<img src="{{ acceptrequest.main_char|character_portrait_url:32 }}" class="rounded-circle" style="margin-right: 1rem;">
<img src="{{ acceptrequest.main_char|character_portrait_url:32 }}" class="rounded-circle" style="margin-right: 1rem;" alt="{{ acceptrequest.main_char.character_name }}">
{% if acceptrequest.main_char %}
<a href="{{ acceptrequest.main_char|evewho_character_url }}" target="_blank">
{{ acceptrequest.main_char.character_name }}
@@ -115,7 +115,7 @@
{% for leaverequest in leaverequests %}
<tr>
<td>
<img src="{{ leaverequest.main_char|character_portrait_url:32 }}" class="rounded-circle" style="margin-right: 1rem;">
<img src="{{ leaverequest.main_char|character_portrait_url:32 }}" class="rounded-circle" style="margin-right: 1rem;" alt="{{ leaverequest.main_char.character_name }}">
{% if leaverequest.main_char %}
<a href="{{ leaverequest.main_char|evewho_character_url }}" target="_blank">
{{ leaverequest.main_char.character_name }}

View File

@@ -64,7 +64,7 @@ class TestViews(TestCase):
content = response_content_to_str(response)
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)
@override_settings(GROUPMANAGEMENT_AUTO_LEAVE=True)
@@ -81,5 +81,5 @@ class TestViews(TestCase):
content = response_content_to_str(response)
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)

View File

@@ -134,5 +134,5 @@ class DashboardItemHook:
logger.debug(f"Rendering {self.view_function} to dashboard")
return self.view_function(request)
except Exception as e:
logger.exception("Rendering {self.view_function} Failed!")
logger.exception(f"Rendering {self.view_function} failed!")
return ""

View File

@@ -33,11 +33,11 @@
<td class="text-center">{{ personal_app.form.corp.corporation_name }}</td>
<td class="text-center">
{% if personal_app.approved == None %}
<div class="badge badge-warning">{% translate "Pending" %}</div>
<div class="badge bg-warning">{% translate "Pending" %}</div>
{% elif personal_app.approved == True %}
<div class="badge badge-success">{% translate "Approved" %}</div>
<div class="badge bg-success">{% translate "Approved" %}</div>
{% else %}
<div class="badge badge-danger">{% translate "Rejected" %}</div>
<div class="badge bg-danger">{% translate "Rejected" %}</div>
{% endif %}
</td>
<td class="text-center">
@@ -91,14 +91,14 @@
<td class="text-center">
{% if app.approved == None %}
{% if app.reviewer_str %}
<div class="badge badge-info">{% translate "Reviewer:" %} {{ app.reviewer_str }}</div>
<div class="badge bg-info">{% translate "Reviewer:" %} {{ app.reviewer_str }}</div>
{% else %}
<div class="badge badge-warning">{% translate "Pending" %}</div>
<div class="badge bg-warning">{% translate "Pending" %}</div>
{% endif %}
{% elif app.approved == True %}
<div class="badge badge-success">{% translate "Approved" %}</div>
<div class="badge bg-success">{% translate "Approved" %}</div>
{% else %}
<div class="badge badge-danger">{% translate "Rejected" %}</div>
<div class="badge bg-danger">{% translate "Rejected" %}</div>
{% endif %}
</td>
<td class="text-center">
@@ -135,14 +135,14 @@
<td class="text-center">
{% if app.approved == None %}
{% if app.reviewer_str %}
<div class="badge badge-info">{% translate "Reviewer:" %} {{ app.reviewer_str }}</div>
<div class="badge bg-info">{% translate "Reviewer:" %} {{ app.reviewer_str }}</div>
{% else %}
<div class="badge badge-warning">{% translate "Pending" %}</div>
<div class="badge bg-warning">{% translate "Pending" %}</div>
{% endif %}
{% elif app.approved == True %}
<div class="badge badge-success">{% translate "Approved" %}</div>
<div class="badge bg-success">{% translate "Approved" %}</div>
{% else %}
<div class="badge badge-danger">{% translate "Rejected" %}</div>
<div class="badge bg-danger">{% translate "Rejected" %}</div>
{% endif %}
</td>
<td class="text-center">

View File

@@ -34,11 +34,11 @@
<td class="text-center">{{ app.form.corp }}</td>
<td class="text-center">
{% if app.approved == None %}
<div class="badge badge-warning">{% translate "Pending" %}</div>
<div class="badge bg-warning">{% translate "Pending" %}</div>
{% elif app.approved == True %}
<div class="badge badge-success">{% translate "Approved" %}</div>
<div class="badge bg-success">{% translate "Approved" %}</div>
{% else %}
<div class="badge badge-danger">{% translate "Rejected" %}</div>
<div class="badge bg-danger">{% translate "Rejected" %}</div>
{% endif %}
</td>
<td class="text-center">

View File

@@ -8,7 +8,7 @@ class MenuItemHook:
"""
Auth Hook for generating Side Menu Items
"""
def __init__(self, text: str, classes: List[str], url_name: str, order: Optional[int] = None, navactive: List = list([])):
def __init__(self, text: str, classes: str, url_name: str, order: Optional[int] = None, navactive: List = []):
"""
:param text: The text shown as menu item, e.g. usually the name of the app.
:type text: str

View File

@@ -8,7 +8,7 @@
{% translate item.text %}
</a>
{% if item.count >= 1 %}
<span class="badge bg-primary rounded-pill 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-4{% endif %}">
{{ item.count }}
</span>
{% elif item.url %}

View File

@@ -7,9 +7,7 @@
href="{% url 'notifications:list' %}">
<span class="fa">
{% with unread_count=request.user|user_unread_notification_count %}
<i
class="fas fa-bell{% if unread_count %} text-danger{% endif %}"
></i>
<i class="fas fa-bell{% if unread_count %} text-danger{% endif %}"></i>
{% endwith %}
</span>
<span class="d-lg-none d-md-inline m-2">

View File

@@ -1,51 +1,57 @@
{% 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">
{% if request.user.profile.main_character %}
{% with request.user.profile.main_character as main %}
<div class="p-2 position-relative m-2">
<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 %}
</div>
<h5>{{ main.character_name }}</h5>
{% endwith %}
{% else %}
<img class="rounded-circle m-2" src="{{ 1|character_portrait_url:32 }}" alt="{% translate 'No Main Character!' %}"/>
<h5>{% translate "No Main Character!" %}</h5>
{% endif %}
<div style="z-index:5;" class="w100 d-flex flex-column justify-content-center align-items-center text-center pb-2">
{% if user.is_authenticated %}
{% if request.user.profile.main_character %}
{% with request.user.profile.main_character as main %}
<div class="p-2 position-relative m-2">
<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 %}
</div>
<h5>{{ main.character_name }}</h5>
{% endwith %}
{% else %}
<img class="rounded-circle m-2" src="{{ 1|character_portrait_url:32 }}" alt="{% translate 'No Main Character!' %}">
<h5>{% translate "No Main Character!" %}</h5>
{% endif %}
{% theme_select %}
{% endif %}
<div class="btn-group m-2">
<button type="button" class="btn btn-secondary p-1">
{% include "public/lang_select.html" %}
</button>
{% if user.is_superuser %}
<a role="button" class="btn btn btn-secondary d-flex"
href="{% url 'admin:index' %}"
bs-data-toggle="button">
<span class="align-self-center">{% translate "Admin" %}</span>
</a>
<a role="button" class="btn btn btn-secondary d-flex" href="{% url 'admin:index' %}">
<span class="align-self-center">{% translate "Admin" %}</span>
</a>
{% endif %}
</div>
<div class="btn-group m-2">
<a role="button" class="btn btn-info" href="{% url 'authentication:token_management' %}" alt="Token Management"><i class="fa-solid fa-user-lock fa-fw"></i></a>
{% if user.is_superuser %}
<a role="button" class="btn btn-info" href="https://allianceauth.readthedocs.io/" alt="Alliance Auth Documentation"><i class="fa-solid fa-book fa-fw"></i></a>
<a role="button" class="btn btn-info" href="https://discord.gg/fjnHAmk" alt="Alliance Auth Discord"><i class="fa-brands fa-discord fa-fw"></i></a>
<a role="button" class="btn btn-info" href="https://gitlab.com/allianceauth/allianceauth" alt="Alliance Auth Git"><i class="fa-brands fa-gitlab fa-fw"></i></a>
{% endif %}
{% if user.is_authenticated %}
<a role="button" class="btn btn-danger" href="{% url 'logout' %}" alt="{% translate 'Sign Out' %}"><i class="fa-solid fa-right-from-bracket fa-fw"></i></a>
{% else %}
<a role="button" class="btn btn-success" href="{% url 'authentication:login' %}" alt="{% translate 'Sign In' %}"> <i class="fa-solid fa-right-to-bracket fa-fw"></i></a>
{% endif %}
{% if user.is_authenticated %}
<a role="button" class="btn btn-info" href="{% url 'authentication:token_management' %}" title="Token Management"><i class="fa-solid fa-user-lock fa-fw"></i></a>
{% endif %}
{% if user.is_superuser %}
<a role="button" class="btn btn-info" href="https://allianceauth.readthedocs.io/" title="Alliance Auth Documentation"><i class="fa-solid fa-book fa-fw"></i></a>
<a role="button" class="btn btn-info" href="https://discord.gg/fjnHAmk" title="Alliance Auth Discord"><i class="fa-brands fa-discord fa-fw"></i></a>
<a role="button" class="btn btn-info" href="https://gitlab.com/allianceauth/allianceauth" title="Alliance Auth Git"><i class="fa-brands fa-gitlab fa-fw"></i></a>
{% endif %}
{% if user.is_authenticated %}
<a role="button" class="btn btn-danger" href="{% url 'logout' %}" title="{% translate 'Sign Out' %}"><i class="fa-solid fa-right-from-bracket fa-fw"></i></a>
{% else %}
<a role="button" class="btn btn-success" href="{% url 'authentication:login' %}" title="{% translate 'Sign In' %}"> <i class="fa-solid fa-right-to-bracket fa-fw"></i></a>
{% endif %}
</div>
</div>

View File

@@ -1,19 +1,23 @@
{% load i18n %}
{% load navactive %}
{% load menu_items %}
{% load menu_menu_items %}
<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 auth-logo" >
<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">
<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' %}">
{% translate "Dashboard" %}
</a>
</li>
{% sorted_menu_items %}
</ul>
{% 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">
<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' %}">
{% translate "Dashboard" %}
</a>
</li>
{% sorted_menu_items %}
</ul>
{% endif %}
{% include 'menu/menu-user.html' %}
</div>
</div>

View File

@@ -29,7 +29,7 @@ def menu_items(context):
@register.inclusion_tag('menu/menu-block.html', takes_context=True)
def sorted_menu_items(context):
request = context['request']
manu_items = MenuItem.render_menu(request)
menu_items = MenuItem.render_menu(request)
return {
'menu_items':manu_items
'menu_items':menu_items
}

View File

@@ -5,38 +5,42 @@
{% block page_title %}
{% translate "Notifications" %}
{% endblock page_title %}
{% block header_nav_brand %}
{% translate "Notifications" %}
{% endblock header_nav_brand %}
{% block header_nav_collapse_left %}
<li class="nav-item">
<a class="nav-link active" id="unread-tab" data-bs-toggle="tab" data-bs-target="#unread" type="button" role="tab" aria-controls="unread" aria-selected="true">
{% translate "Unread" %}
<span class="badge bg-secondary">{{ unread|length }}</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="read-tab" data-bs-toggle="tab" data-bs-target="#read" type="button" role="tab" aria-controls="read" aria-selected="false">
{% translate "Read" %}
<span class="badge bg-secondary">{{ read|length }}</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link active" id="unread-tab" data-bs-toggle="tab" data-bs-target="#unread" type="button" role="tab" aria-controls="unread" aria-selected="true">
{% translate "Unread" %}
<span class="badge bg-secondary">{{ unread|length }}</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" id="read-tab" data-bs-toggle="tab" data-bs-target="#read" type="button" role="tab" aria-controls="read" aria-selected="false">
{% translate "Read" %}
<span class="badge bg-secondary">{{ read|length }}</span>
</a>
</li>
{% endblock %}
{% block header_nav_collapse_right %}
<li class="nav-item">
<a href="{% url 'notifications:mark_all_read' %}" class="nav-link">
<i class="fas fa-check-double"></i>
</a>
</li>
<li class="nav-item">
<a href="{% url 'notifications:delete_all_read' %}" class="nav-link">
<i class="fas fa-trash"></i>
</a>
</li>
<li class="nav-item">
<a href="{% url 'notifications:mark_all_read' %}" class="nav-link" title="{% translate 'Mark all notifications as read' %}">
<i class="fas fa-check-double"></i>
</a>
</li>
<li class="nav-item">
<a href="{% url 'notifications:delete_all_read' %}" class="nav-link" title="{% translate 'Delete all read notifications' %}">
<i class="fas fa-trash"></i>
</a>
</li>
{% endblock %}
{% block content %}
<div class="tab-content">
<div class="tab-pane active" id="unread">
<div class="tab-pane fade active show" id="unread">
{% include "notifications/list_partial.html" with notifications=unread %}
</div>

View File

@@ -3,19 +3,19 @@
{% if notifications %}
<table class="table table-striped">
<tr>
<th class="text-center">{% translate "Timestamp" %}</th>
<th class="text-center">{% translate "Title" %}</th>
<th class="text-center">{% translate "Action" %}</th>
<th>{% translate "Timestamp" %}</th>
<th>{% translate "Title" %}</th>
<th class="text-end">{% translate "Action" %}</th>
</tr>
{% for notif in notifications %}
<tr class="{{ notif.level }}">
<td class="text-center">{{ notif.timestamp }}</td>
<td class="text-center">{{ notif.title }}</td>
<td class="text-center">
<a href="{% url 'notifications:view' notif.id %}" class="btn btn-primary" title="View">
<tr class="table-{{ notif.level }}">
<td>{{ notif.timestamp }}</td>
<td>{{ notif.title }}</td>
<td class="text-end">
<a href="{% url 'notifications:view' notif.id %}" class="btn btn-primary btn-sm" title="View">
<span class="fas fa-eye"></span>
</a>
<a href="{% url 'notifications:remove' notif.id %}" class="btn btn-danger" title="Remove">
<a href="{% url 'notifications:remove' notif.id %}" class="btn btn-danger btn-sm" title="Remove">
<span class="fas fa-trash"></span>
</a>
</td>
@@ -23,5 +23,5 @@
{% endfor %}
</table>
{% else %}
<div class="alert alert-default text-center">{% translate "No notifications." %}</div>
<div class="alert alert-info">{% translate "No notifications." %}</div>
{% endif %}

View File

@@ -1,25 +1,29 @@
{% extends "allianceauth/base.html" %}
{% extends "allianceauth/base-bs5.html" %}
{% load i18n %}
{% block page_title %}{% translate "View Notification" %}{% endblock page_title %}
{% block page_title %}
{% translate "View Notification" %}
{% endblock page_title %}
{% block header_nav_brand %}
{% translate "View Notification" %}
{% endblock %}
{% block content %}
<h1 class="page-header text-center">
{% translate "View Notification" %}
<div class="text-end">
<a href="{% url 'notifications:list' %}" class="btn btn-primary btn-lg">
<span class="glyphicon glyphicon-arrow-left"></span>
</a>
</div>
</h1>
<div class="row">
<div class="col-lg-12">
<div class="panel panel-{{ notif.level }}">
<div class="panel-heading">{{ notif.timestamp }} {{ notif.title }}</div>
<div class="panel-body"><pre>{{ notif.message }}</pre></div>
</div>
</div>
<div class="text-end mb-4">
<a href="{% url 'notifications:list' %}" class="btn btn-primary">
<i class="fa-solid fa-arrow-left"></i>
</a>
</div>
<div class="card border-{{ notif.level }}">
<div class="card-header bg-{{ notif.level }}">
{{ notif.timestamp }}
{{ notif.title }}
</div>
<div class="card-body">
<pre>{{ notif.message }}</pre>
</div>
</div>
{% endblock %}

View File

@@ -6,14 +6,16 @@
<div class="card-body">
<h4 class="card-title text-center">{% translate "Upcoming Fleets" %}</h4>
<div class="card-body">
<div style="height: 300px;overflow:-moz-scrollbars-vertical;overflow-y:auto;">
<table class="table" style="--bs-table-bg: transparent;">
<div style="height: 300px; overflow-y:auto;">
<table class="table">
<thead>
<th class="text-center">{% translate "Operation" %}</th>
<th class="text-center">{% translate "Type" %}</th>
<th class="text-center">{% translate "Form Up System" %}</th>
<th class="text-center">{% translate "Start Time" %}</th>
</thead>
<tr>
<th class="text-center">{% translate "Operation" %}</th>
<th class="text-center">{% translate "Type" %}</th>
<th class="text-center">{% translate "Form Up System" %}</th>
<th class="text-center">{% translate "Start Time" %}</th>
</tr>
</thead>
<tbody>
{% for ops in timers %}
<tr>

View File

@@ -16,10 +16,10 @@
</h1>
<div class="col-lg-12 text-center row">
<div class="badge badge-info text-start">
<div class="badge bg-info text-start">
<b>{% translate "Current Eve Time:" %} </b>
</div>
<strong class="badge badge-info text-start" id="current-time"></strong>
<strong class="badge bg-info text-start" id="current-time"></strong>
<br>
</div>

View File

@@ -3,12 +3,12 @@
<tr>
<td>{{ type }}: {{ name }}</td>
<td class="text-end">
<img src="{{ user.profile.main_character|character_portrait_url:32 }}" class="img-circle" alt="{{ user.profile.main_character.character_name }}"/></td>
<td><strong>{{ user }}<br/></strong>{{ user.profile.main_character.character_name }}</td>
<img src="{{ user.profile.main_character|character_portrait_url:32 }}" class="img-circle" alt="{{ user.profile.main_character.character_name }}"></td>
<td><strong>{{ user }}<br></strong>{{ user.profile.main_character.character_name }}</td>
<td class="text-start">
{% if user.profile.main_character %}
<a href="{{ user.profile.main_character|dotlan_corporation_url }}" target="_blank">{{ user.profile.main_character.corporation_name }}</a>
<br/>
<br>
{{ user.profile.main_character.alliance_name|default_if_none:"" }}
{% else %}
{% translate "(unknown)" %}

View File

@@ -3,7 +3,7 @@ from django import urls
from django.contrib.auth.models import Group, Permission
from allianceauth.tests.auth_utils import AuthUtils
from allianceauth.menu.models import MenuItem
class PermissionsToolViewsTestCase(WebTest):
def setUp(self):
@@ -34,13 +34,19 @@ class PermissionsToolViewsTestCase(WebTest):
self.member.user_permissions.add(self.permission)
AuthUtils.connect_signals()
# TODO find a nicer way to do this later
MenuItem.sync_hook_models()
def test_menu_item(self):
# If we change the side menu again this will fail again.
self.app.set_user(self.member)
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):
self.app.set_user(self.member)

View File

@@ -22,6 +22,7 @@ INSTALLED_APPS = [
'django.contrib.humanize',
'django_celery_beat',
'bootstrapform',
'django_bootstrap5', # https://github.com/zostera/django-bootstrap5
'sortedm2m',
'esi',
'allianceauth.authentication',
@@ -193,7 +194,8 @@ DATABASES = {
SITE_NAME = 'Alliance Auth'
DEFAULT_THEME = "allianceauth.theme.darkly"
DEFAULT_THEME = "allianceauth.theme.flatly.auth_hooks.FlatlyThemeHook"
DEFAULT_THEME_DARK = "allianceauth.theme.darkly.auth_hooks.DarklyThemeHook" # Legacy AAv3 user.profile.night_mode=1
LOGIN_URL = 'auth_login_user' # view that handles login logic

View File

@@ -10,10 +10,11 @@ startsecs=10
priority=998
[program:worker]
command={{ celery }} -A {{ project_name }} worker
command={{ celery }} -A {{ project_name }} worker --pool=threads --concurrency=5 -n %(program_name)s_%(process_num)02d
directory={{ project_directory }}
user=allianceserver
numprocs=1
process_name=%(program_name)s_%(process_num)02d
stdout_logfile={{ project_directory }}/log/worker.log
stderr_logfile={{ project_directory }}/log/worker.log
autostart=true
@@ -35,6 +36,14 @@ autorestart=true
stopsignal=INT
{% endif %}
[eventlistener:memmon]
command={{ memmon }} -p worker_00=256MB -p gunicorn=256MB
directory={{ project_directory }}
events=TICK_60
stdout_logfile={{ project_directory }}/log/memmon.log
stderr_logfile={{ project_directory }}/log/memmon.log
[group:{{ project_name }}]
programs=beat,worker{% if gunicorn %},gunicorn{% endif %}
priority=999

View File

@@ -14,7 +14,7 @@
{% endblock %}
{% block controls %}
<a title="Go To Forums" href="{{ DISCOURSE_URL }}" class="btn btn-success" title="Connect">
<a title="Go To Forums" href="{{ DISCOURSE_URL }}" class="btn btn-success">
<span class="fas fa-arrow-right fa-fw"></span>
</a>
{% endblock %}

View File

@@ -5,17 +5,17 @@
<p class="card-text"><a href="mumble://{{ service_url }}">{{ service_url }}</a></p>
<p class="card-text"><span class="badge {% if username != '' %}bg-success{% else %}bg-warning{% endif %}">{% if username != '' %}Active{% else %}Disabled{% endif %}</span></p>
<p class="card-text">Username: <span class="badge bg-secondary text-end">{{ username }}</span></p>
</div>
</div>
<div class="card-footer">
{% if username == "" %}
<td class="text-center">{{ service_url }}</td>
<td class="text-center">
<div class="text-center">
<a href="{% url 'mumble:activate' %}" title="Activate" class="btn btn-warning">
<span class="fas fa-check fa-fw"></span>
</a>
</td>
</div>
{% else %}
<td class="text-center">
<div class="text-center">
<a href="{% url 'mumble:set_password' %}" title="Set Password" class="btn btn-warning">
<span class="fas fa-edit fa-fw"></span>
</a>
@@ -28,7 +28,7 @@
<a href="mumble://{{ connect_url }}" class="btn btn-success" title="Connect">
<span class="fas fa-arrow-right fa-fw"></span>
</a>
</td>
</div>
{% endif %}
</div>
</div>

View File

@@ -8,11 +8,12 @@
{% block content %}
<div class="d-flex p-2 bd-highlight justify-content-center flex-wrap">
<div class="d-flex py-2 pt-0 bd-highlight justify-content-center flex-wrap">
{% for svc in service_ctrls %}
{{ svc }}
{% endfor %}
</div>
<div class="w-100 text-center">
<h4>Legend</h4>
<div class="d-inline-flex bd-highlight justify-content-center flex-wrap">
@@ -20,29 +21,41 @@
<a title="Activate" class="btn btn-warning">
<span class="fas fa-check fa-fw"></span>
</a>
<p class="m-2 p-0 align-self-center">{% translate "Click to activate the service for your user." %}</p>
<p class="m-2 p-0 align-self-center">
{% translate "Click to activate the service for your user." %}
</p>
</div>
<div class="d-inline-flex m-3">
<a title="Set Password" class="btn btn-warning">
<span class="fas fa-edit fa-fw"></span>
</a>
<p class="m-2 p-0 align-self-center">{% translate "Click to manually set your password." %}</p>
<p class="m-2 p-0 align-self-center">
{% translate "Click to manually set your password." %}
</p>
</div>
<div class="d-inline-flex m-3">
<a title="Reset Password" class="btn btn-primary">
<span class="fas fa-sync fa-fw"></span>
</a>
<p class="m-2 p-0 align-self-center">{% translate "Click to randomly generate your password." %}</p>
<p class="m-2 p-0 align-self-center">
{% translate "Click to randomly generate your password." %}
</p>
</div>
<div class="d-inline-flex m-3">
<a title="Deactivate" class="btn btn-danger">
<span class="fas fa-times fa-fw"></span>
</a>
<p class="m-2 p-0 align-self-center">{% translate "Click to deactivate the service for your user" %}</p>
<p class="m-2 p-0 align-self-center">
{% translate "Click to deactivate the service for your user" %}
</p>
</div>
</div>
<p class="m-2 p-0 align-self-center">{% translate "Some services provide different options. Hover over the buttons to see more." %}</p>
</div>
<p class="m-2 p-0 align-self-center">
{% translate "Some services provide different options. Hover over the buttons to see more." %}
</p>
</div>
{% endblock content %}

View File

@@ -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),
}

View File

@@ -73,7 +73,7 @@ ESC to cancel{% endblocktranslate %}" id="blah"></i></th>
</td>
<td class="text-center">
<a href="{{ srpfleetrequest.killboard_link }}"
target="_blank" class="badge badge-warning">{% translate "Link" %}</a>
target="_blank" class="badge bg-warning">{% translate "Link" %}</a>
</td>
<td class="text-center">{{ srpfleetrequest.additional_info }}</td>
<td class="text-center">{{ srpfleetrequest.srp_ship_name }}</td>
@@ -82,15 +82,15 @@ ESC to cancel{% endblocktranslate %}" id="blah"></i></th>
<td class="text-center" data-sort="{{ srpfleetrequest.post_time | date:"Y-m-d H:i" }}">{{ srpfleetrequest.post_time | date:"Y-M-d H:i" }}</td>
<td class="text-center">
{% if srpfleetrequest.srp_status == "Approved" %}
<div class="badge badge-success">
<div class="badge bg-success">
{% translate "Approved" %}
</div>
{% elif srpfleetrequest.srp_status == "Rejected" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
{% translate "Rejected" %}
</div>
{% else %}
<div class="badge badge-warning">
<div class="badge bg-warning">
{% translate "Pending" %}
</div>
{% endif %}

View File

@@ -46,27 +46,27 @@
{% for srpfleet in srpfleets %}
<tr>
<td class="text-center">
<div class="badge badge-info">
<div class="badge bg-info">
{{ srpfleet.fleet_name }}
</div>
</td>
<td class="text-center">{{ srpfleet.fleet_time | date:"Y-m-d H:i" }}</td>
<td class="text-center">{{ srpfleet.fleet_doctrine }}</td>
<td class="text-center">
<div class="badge badge-success">
<div class="badge bg-success">
{{ srpfleet.fleet_commander.character_name }}
</div>
</td>
<td class="text-center">
{% if srpfleet.fleet_srp_aar_link %}
<a href="{{ srpfleet.fleet_srp_aar_link }}" target="_blank" class="badge badge-primary">{% translate "Link" %}</a>
<a href="{{ srpfleet.fleet_srp_aar_link }}" target="_blank" class="badge bg-primary">{% translate "Link" %}</a>
{% endif %}
</td>
<td class="text-center">
{% if srpfleet.fleet_srp_code %}
<a class="badge badge-warning" href="{% url 'srp:request' srpfleet.fleet_srp_code %}">{{ srpfleet.fleet_srp_code }}</a>
<a class="badge bg-warning" href="{% url 'srp:request' srpfleet.fleet_srp_code %}">{{ srpfleet.fleet_srp_code }}</a>
{% else %}
<div class="badge badge-danger">
<div class="badge bg-danger">
{% translate "Disabled" %}
</div>
{% endif %}
@@ -75,17 +75,17 @@
<td class="text-center">
{% if srpfleet.fleet_srp_status == "" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
{% translate "Pending" %}
</div>
{% else %}
<div class="badge badge-success">
<div class="badge bg-success">
{% translate "Completed" %}
</div>
{% endif %}
</td>
<td class="text-center">
<div class="badge badge-warning">{{ srpfleet.pending_requests }}</div>
<div class="badge bg-warning">{{ srpfleet.pending_requests }}</div>
</td>
<td class="text-center">

View 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);
}
}

View File

@@ -1,101 +1,114 @@
{% load i18n %}
{% load humanize %}
{% if notifications %}
<div class="col-12 align-self-stretch p-2">
<div class="card">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="w-100 align-self-stretch">
<h4 class="ms-auto me-auto">
{% translate "Alliance Auth Notifications" %}
</h4>
<div class="card-body">
<ul class="list-group">
{% for notif in notifications %}
<li class="list-group-item">
{% if notif.state == 'opened' %}
<span class="badge badge-success">{% translate "Open" %}</span>
{% else %}
<span class="badge badge-danger">{% translate "Closed" %}</span>
{% endif %}
<a href="{{ notif.web_url }}" target="_blank">#{{ notif.iid }} {{ notif.title }}</a>
</li>
{% empty %}
<div class="alert alert-primary" role="alert">
{% translate "No notifications at this time" %}
<div class="col-12 align-self-stretch pb-2">
<div class="card">
<div class="card-body">
<div class="d-flex align-items-center">
<div class="w-100 align-self-stretch">
<h4 class="ms-auto me-auto text-center">
{% translate "Alliance Auth Notifications" %}
</h4>
<div class="card-body">
<ul class="list-group">
{% for notif in notifications %}
<li class="list-group-item">
{% if notif.state == 'opened' %}
<span class="badge bg-success">{% translate "Open" %}</span>
{% else %}
<span class="badge bg-danger">{% translate "Closed" %}</span>
{% endif %}
<a href="{{ notif.web_url }}" target="_blank">#{{ notif.iid }} {{ notif.title }}</a>
</li>
{% empty %}
<div class="alert alert-primary" role="alert">
{% translate "No notifications at this time" %}
</div>
{% endfor %}
</ul>
<div class="text-end">
<a href="https://gitlab.com/allianceauth/allianceauth/issues" target="_blank" class="me-1">
<span class="badge" style="background-color: rgb(230 83 40);">
<i class="fab fa-gitlab" aria-hidden="true"></i>
{% translate 'Powered by GitLab' %}
</span>
</a>
<a href="https://discord.com/invite/fjnHAmk" target="_blank">
<span class="badge" style="background-color: rgb(110 133 211);">
<i class="fab fa-discord" aria-hidden="true"></i>
{% translate 'Support Discord' %}
</span>
</a>
</div>
{% endfor %}
</ul>
</div>
<div class="text-end" style="position: absolute; bottom: 5px; right: 5px;">
<a href="https://gitlab.com/allianceauth/allianceauth/issues" target="_blank" style="margin-right: 0.5rem;">
<span class="badge" style="background-color: #e65328;">
<i class="fab fa-gitlab" aria-hidden="true"></i>
{% translate 'Powered by GitLab' %}
</span>
</a>
<a href="https://discord.com/invite/fjnHAmk" target="_blank">
<span class="badge" style="background-color: rgb(110,133,211);">
<i class="fab fa-discord" aria-hidden="true"></i>
{% translate 'Support Discord' %}
</span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
<div class="col-12 align-self-stretch p-2">
<div class="col-12 align-self-stretch py-2">
<div class="card">
<div class="card-body d-flex flex-row flex-wrap">
<div class="col-xl-6 col-lg-12 col-md-12 col-sm-12">
<h4 class="ms-auto me-auto text-center">
{% translate "Software Version" %}
</h4>
<div class="card-body pb-0">
<ul class="list-group list-group-horizontal w-100" role="group" aria-label="Basic example">
<li type="button" class="list-group-item w-100">
<h5 class="list-group-item-heading">{% translate "Current" %}</h5>
<p class="list-group-item-text">
{{ current_version }}
</p>
<div class="card-body">
<ul class="list-group list-group-horizontal w-100" role="group" aria-label="{% translate 'Software Version' %}">
<li class="list-group-item w-100">
<div class="btn w-100 cursor-default">
<h5 class="list-group-item-heading">{% translate "Current" %}</h5>
<p class="list-group-item-text">{{ current_version }}</p>
</div>
</li>
<li class="list-group-item list-group-item-{% if latest_patch %}success{% elif latest_minor %}warning{% else %}danger{% endif %} w-100" href="https://gitlab.com/allianceauth/allianceauth/-/tags/v{{ latest_patch_version }}">
<li class="list-group-item list-group-item-{% if latest_patch %}success{% elif latest_minor %}warning{% else %}danger{% endif %} w-100">
<a class="btn w-100" href="https://gitlab.com/allianceauth/allianceauth/-/releases/v{{ latest_patch_version }}">
<h5 class="list-group-item-heading">{% translate "Latest Stable" %}</h5>
<p class="list-group-item-text">
<i class="fab fa-gitlab hidden-xs" aria-hidden="true"></i>
{{ latest_patch_version }}
{% if not latest_patch %}<br>{% translate "Update available" %}{% endif %}
</p>
</li>
{% if latest_beta %}
<li>
<a type="button" class="btn btn-info w-100" href="https://gitlab.com/allianceauth/allianceauth/-/tags/v{{ latest_beta_version }}">
<h5 class="list-group-item-heading">{% translate "Latest Pre-Release" %}</h5>
<p class="list-group-item-text">
<i class="fab fa-gitlab hidden-xs" aria-hidden="true"></i>
{{ latest_beta_version }}
<br>{% translate "Pre-Release available" %}
{{ latest_patch_version }}
{% if not latest_patch %}<br>{% translate "Update available" %}{% endif %}
</p>
</a>
</li>
{% if latest_beta %}
<li class="list-group-item list-group-item-info w-100">
<a class="btn w-100" href="https://gitlab.com/allianceauth/allianceauth/-/releases/v{{ latest_beta_version }}">
<h5 class="list-group-item-heading">{% translate "Latest Pre-Release" %}</h5>
<p class="list-group-item-text">
<i class="fab fa-gitlab hidden-xs" aria-hidden="true"></i>
{{ latest_beta_version }}
<br>{% translate "Pre-Release available" %}
</p>
</a>
</li>
{% endif %}
</ul>
</div>
</div>
<div class="d-xl-none d-lg-show d-md-show d-sm-show m-2"></div>
<div class="col-xl-6 col-lg-12 col-md-12 col-sm-12">
<h4 class="ms-auto me-auto text-center">
{% translate "Task Queue" %}
</h4>
<div class="card-body pb-0">
<div class="card-body">
<p>
{% blocktranslate with total=tasks_total|intcomma latest=earliest_task|timesince|default:"?" %}
Status of {{ total }} processed tasks • last {{ latest }}
{% endblocktranslate %}
{% blocktranslate with total=tasks_total|intcomma latest=earliest_task|timesince|default:"?" %}
Status of {{ total }} processed tasks • last {{ latest }}
{% endblocktranslate %}
</p>
<div
class="progress"
style="height: 21px;"
@@ -105,6 +118,7 @@
{% include "allianceauth/admin-status/celery_bar_partial.html" with label="retried" level="info" tasks_count=tasks_retried %}
{% include "allianceauth/admin-status/celery_bar_partial.html" with label="failed" level="danger" tasks_count=tasks_failed %}
</div>
<p>
<span id="task-counts">?</span> {% translate 'running' %} |
<span id="queued-tasks-count">?</span> {% translate 'queued' %}

View File

@@ -12,7 +12,7 @@
<!-- End Required meta tags -->
<!-- Meta tags -->
<!-- TODO Bundle all the site specific stuff up into its own template for easy overide -->
<!-- TODO Bundle all the site specific stuff up into its own template for easy override -->
<meta name="description" content="">
<meta name="author" content="">
{% include 'allianceauth/icons.html' %}
@@ -22,14 +22,18 @@
{% theme_css %}
{% include 'bundles/fontawesome.html' %}
{% include 'bundles/auth-framework-css.html' %}
<style>
.navbar-toggler.collapsed{
transform: rotate(180deg);
}
.nav-padding {
padding-top: {% header_padding_size %} !important;
}
{% if user.is_authenticated %}
.nav-padding {
padding-top: {% header_padding_size %} !important;
}
{% endif %}
.auth-logo {
background-position: bottom;
@@ -40,79 +44,93 @@
{% block extra_css %}{% endblock extra_css %}
</head>
<body class="overflow-none">
<body>
{% if user.is_authenticated %}
<!-- Top Menu, Blocks don't work in "include" tagged views -->
<nav class="navbar navbar-expand-lg navbar-dark fixed-top bg-primary">
<div class="container-fluid justify-content-start">
<a class="navbar-brand" data-bs-toggle="collapse" data-bs-target="#sidebar" role="button">
<i class="fas fa-solid fa-bars ms-2 me-2"></i>
</a>
<a class="navbar-brand">{% block header_nav_brand %}{{ SITE_NAME }}{% endblock %}</a>
<div class="collapse navbar-collapse" id="navbarexpand">
<div class="m-2"></div>
<ul id="nav-left" class="navbar-nav nav me-auto">
{% block header_nav_collapse_left %}
{% endblock %}
</ul>
<ul id="nav-right" class="navbar-nav">
{% block header_nav_collapse_right %} <!-- Default to add char and swap main -->
{% include 'allianceauth/top-menu-rh-default.html' %}
{% endblock %}
{% include 'menu/menu-notification-block.html' %}
</ul>
</div>
{% if user.is_authenticated %}
<a class="navbar-brand" data-bs-toggle="collapse" data-bs-target="#sidebar" role="button">
<i class="fas fa-solid fa-bars ms-2 me-2"></i>
</a>
{% endif %}
<a class="navbar-toggler navbar-brand border-0 collapsed" data-bs-toggle="collapse" data-bs-target="#navbarexpand" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation" style="margin-left: auto;">
<i class="fas fa-solid fa-chevron-up"></i>
</a>
<div class="navbar-brand">{% block header_nav_brand %}{{ SITE_NAME }}{% endblock %}</div>
<div class="collapse navbar-collapse" id="navbarexpand">
<div class="m-2"></div>
<ul id="nav-left" class="navbar-nav nav me-auto">
{% block header_nav_collapse_left %}
{% endblock %}
</ul>
<ul id="nav-right" class="navbar-nav">
{% block header_nav_collapse_right %} <!-- Default to add char and swap main -->
{% include 'allianceauth/top-menu-rh-default.html' %}
{% endblock %}
{% include 'menu/menu-notification-block.html' %}
</ul>
</div>
<a class="navbar-toggler navbar-brand border-0 collapsed" data-bs-toggle="collapse" data-bs-target="#navbarexpand" aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation" style="margin-left: auto;">
<i class="fas fa-solid fa-chevron-up"></i>
</a>
</div>
</nav>
<!-- End Top Menu -->
<!-- Body -->
<main class="row flex-nowrap m-0">
{% include 'menu/sortable-side-menu.html' %}
<div class="nav-padding col flex-nowrap px-0 m-0 vh-100 overflow-auto">
<div class="p-2">
{% include 'allianceauth/messages-bs5.html' %}
{% block content %}
{% endblock content %}
</div>
</div>
</main>
<!-- End Body -->
{% endif %}
<!-- End Top Menu -->
<!-- Body -->
<main class="row flex-nowrap m-0">
{% include 'menu/sortable-side-menu.html' %}
<div class="nav-padding col flex-nowrap vh-100 overflow-auto">
<div class="my-4">
{% include 'allianceauth/messages-bs5.html' %}
{% block content %}
{% endblock content %}
</div>
</div>
</main>
<!-- End Body -->
<script>
(function () {
(() => {
// TODO Extend this to the groups in the sidebar too.
// TODO Move to own JS file
var sidebar = document.getElementById('sidebar')
const sidebar = document.getElementById('sidebar');
sidebar.addEventListener("shown.bs.collapse", function () {
sidebar.addEventListener("shown.bs.collapse", () => {
localStorage.removeItem("sidebar_" + sidebar.id);
});
sidebar.addEventListener("hidden.bs.collapse", function () {
sidebar.addEventListener("hidden.bs.collapse", () => {
localStorage.setItem("sidebar_" + sidebar.id, true);
});
if (localStorage.getItem("sidebar_" + sidebar.id) === "true") {
sidebar.classList.remove("show")
}
else {
} else {
sidebar.classList.add("show")
}
})();
</script>
{% include 'bundles/jquery-js.html' %}
{% theme_js %}
<script type="application/javascript">
let notificationUPdateSettings = {
notificationsListViewUrl: "{% url 'notifications:list' %}",
notificationsRefreshTime: "{% notifications_refresh_time %}",
userNotificationsCountViewUrl: "{% url 'notifications:user_notifications_count' request.user.pk %}"
};
</script>
{% if user.is_authenticated %}
<script type="application/javascript">
let notificationUPdateSettings = {
notificationsListViewUrl: "{% url 'notifications:list' %}",
notificationsRefreshTime: "{% notifications_refresh_time %}",
userNotificationsCountViewUrl: "{% url 'notifications:user_notifications_count' request.user.pk %}"
};
</script>
{% endif %}
{% block extra_javascript %}
{% endblock extra_javascript %}
<script>

View File

@@ -22,6 +22,6 @@
/>
</svg>
</div>
<p class="text-center"></p>>{{ error_message }}</p>
<p class="text-center">{{ error_message }}</p>
</div>
{% endblock content %}

View File

@@ -3,7 +3,7 @@
{% for message in messages %}
<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" %}
<i class="fas fa-info-circle"></i>
{% elif message.level_tag == "success" %}
@@ -15,12 +15,11 @@
{% endif %}
</div>
<div class="ms-2" style="">
<div class="ms-2">
{{ message }}
</div>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}

View File

@@ -1,6 +1,6 @@
{% load i18n %}
{% load navactive %}
{% load menu_items %}
{% load menu_menu_items %}
<div class="col-sm-2 auth-side-navbar" role="navigation">
<div class="collapse navbar-collapse auth-menus-collapse auth-side-navbar-collapse">

View File

@@ -12,7 +12,7 @@
</button>
<a class="navbar-brand">
<img src="{% static 'allianceauth/icons/favicon-32x32.png' %}" style="display: inline-block;" height="32" width="32" alt="{{ SITE_NAME }}"/>
<img src="{% static 'allianceauth/icons/favicon-32x32.png' %}" style="display: inline-block;" height="32" width="32" alt="{{ SITE_NAME }}">
{{ SITE_NAME }}
</a>
</div>

View File

@@ -1,3 +1,3 @@
{% load static %}
<link href="{% static 'allianceauth/css/auth-base.css' %}" rel="stylesheet"/>
<link href="{% static 'allianceauth/css/auth-base.css' %}" rel="stylesheet">

View File

@@ -0,0 +1,3 @@
{% load static %}
<link href="{% static 'allianceauth/css/auth-framework.css' %}" rel="stylesheet">

View File

@@ -3,18 +3,18 @@
{% if NIGHT_MODE %}
{% if debug %}
<!-- In template debug, loading less file instead of CSS -->
<link rel="stylesheet/less" href="{% static 'allianceauth/css/themes/darkly/darkly.less' %}"/>
<link rel="stylesheet/less" href="{% static 'allianceauth/css/themes/darkly/darkly.less' %}">
<script src='https://cdnjs.cloudflare.com/ajax/libs/less.js/4.1.3/less.min.js' integrity='sha512-6gUGqd/zBCrEKbJqPI7iINc61jlOfH5A+SluY15IkNO1o4qP1DEYjQBewTB4l0U4ihXZdupg8Mb77VxqE+37dg==' crossorigin='anonymous' referrerpolicy="no-referrer"></script>
{% else %}
<link rel="stylesheet" href="{% static 'allianceauth/css/themes/darkly/darkly.min.css' %}"/>
<link rel="stylesheet" href="{% static 'allianceauth/css/themes/darkly/darkly.min.css' %}">
{% endif %}
{% else %}
{% if debug %}
<!-- In template debug, loading less file instead of CSS -->
<link rel="stylesheet/less" href="{% static 'allianceauth/css/themes/flatly/flatly.less' %}"/>
<link rel="stylesheet/less" href="{% static 'allianceauth/css/themes/flatly/flatly.less' %}">
<script src='https://cdnjs.cloudflare.com/ajax/libs/less.js/4.1.3/less.min.js' integrity='sha512-6gUGqd/zBCrEKbJqPI7iINc61jlOfH5A+SluY15IkNO1o4qP1DEYjQBewTB4l0U4ihXZdupg8Mb77VxqE+37dg==' crossorigin='anonymous' referrerpolicy="no-referrer"></script>
{% else %}
<link rel="stylesheet" href="{% static 'allianceauth/css/themes/flatly/flatly.min.css' %}"/>
<link rel="stylesheet" href="{% static 'allianceauth/css/themes/flatly/flatly.min.css' %}">
{% endif %}
{% endif %}
<!-- End Bootstrap CSS -->

View File

@@ -1,3 +1,3 @@
{% load static %}
<link href="{% static 'allianceauth/css/checkbox.css' %}" rel="stylesheet"/>
<link href="{% static 'allianceauth/css/checkbox.css' %}" rel="stylesheet">

View File

@@ -1,3 +1,3 @@
<!-- Start Datatables-css from cdnjs -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datatables.net-bs5/1.13.4/dataTables.bootstrap5.min.css" integrity="sha512-zY8EbjNubt5sVVeNIxLQuU6lrDn0zYpaxCtS6mBBaqQREH1ZNQLdUxhHZjPaZhrw1CbEZkNdShEbIInJxzs9dQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datatables.net-bs5/1.13.4/dataTables.bootstrap5.min.css" integrity="sha512-zY8EbjNubt5sVVeNIxLQuU6lrDn0zYpaxCtS6mBBaqQREH1ZNQLdUxhHZjPaZhrw1CbEZkNdShEbIInJxzs9dQ==" crossorigin="anonymous" referrerpolicy="no-referrer">
<!-- End Datatables-css from cdnjs -->

View File

@@ -1,3 +1,3 @@
<!-- Start Datatables-css from cdnjs -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datatables.net-bs/1.13.4/dataTables.bootstrap.min.css" integrity="sha512-LNQbjsbyJFucRxb1nbmwGxOlsO3ttrO7sE9mHMsbVCXakH/sUYbvfGveW800lXcbR2GMgpL1dDaY1xBv1jFDZw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datatables.net-bs/1.13.4/dataTables.bootstrap.min.css" integrity="sha512-LNQbjsbyJFucRxb1nbmwGxOlsO3ttrO7sE9mHMsbVCXakH/sUYbvfGveW800lXcbR2GMgpL1dDaY1xBv1jFDZw==" crossorigin="anonymous" referrerpolicy="no-referrer">
<!-- End Datatables-css from cdnjs -->

View File

@@ -1,3 +1,3 @@
<!-- Start FontAwesome CSS from cdnjs -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer">
<!-- End FontAwesome CSS from cdnjs -->

View File

@@ -1,3 +1,3 @@
<!-- Start jQuery-DateTimePicker CSS from cdnjs -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.min.css" integrity="sha512-f0tzWhCwVFS3WeYaofoLWkTP62ObhewQ1EZn65oSYDZUg1+CyywGKkWzm8BxaJj5HGKI72PnMH9jYyIFz+GH7g==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-datetimepicker/2.5.20/jquery.datetimepicker.min.css" integrity="sha512-f0tzWhCwVFS3WeYaofoLWkTP62ObhewQ1EZn65oSYDZUg1+CyywGKkWzm8BxaJj5HGKI72PnMH9jYyIFz+GH7g==" crossorigin="anonymous" referrerpolicy="no-referrer">
<!-- End jQuery-DateTimePicker CSS from cdnjs -->

View File

@@ -1,5 +1,5 @@
{% load static %}
<!-- Start jQuery UI CSS from Alliance Auth -->
<!-- CDNs all contain theme.css, which is not supposed to be in the base CSS, Which is why this is uniquely bundled in not using a CDN -->
<link rel="stylesheet" href="{% static 'allianceauth/js/jquery-ui/1.13.2/css/jquery-ui.min.css' %}" integrity="VEqAhOZvZrx/WaxlpMoLvZDSLeLNYhkL5LU2R4/ihPJb/+qkGoMrA15SqEGtI+PCLgKwCDiby7tgdvdiAZkJGg==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
<link rel="stylesheet" href="{% static 'allianceauth/js/jquery-ui/1.13.2/css/jquery-ui.min.css' %}" integrity="VEqAhOZvZrx/WaxlpMoLvZDSLeLNYhkL5LU2R4/ihPJb/+qkGoMrA15SqEGtI+PCLgKwCDiby7tgdvdiAZkJGg==" crossorigin="anonymous" referrerpolicy="no-referrer">
<!-- End jQuery UI CSS from aa-gdpr -->

View File

@@ -1,5 +1,5 @@
<!-- Start Moment.js from cdnjs -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js" integrity="sha512-CryKbMe7sjSCDPl18jtJI5DR5jtkUWxPXWaLCst6QjH8wxDexfRJic2WRmRXmstr2Y8SxDDWuBO6CQC6IE4KTA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js" integrity="sha512-+H4iLjY3JsKiF2V6N366in5IQHj2uEsGV7Pp/GRcm0fn76aPAk5V8xB6n8fQhhSonTqTXs/klFz4D0GIn6Br9g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
{% if locale and LANGUAGE_CODE != 'en' %}
<!-- Moment.JS Not EN-en -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/locale/{{ LANGUAGE_CODE }}.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

View File

@@ -1,3 +1,3 @@
<!-- Start X-editable CSS from cdnjs -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.1/bootstrap3-editable/css/bootstrap-editable.css" integrity="sha512-e0rbO6UJET0zDdXOHjwc6D44UpeKumn7cU7XR/fa4S0/Jso0bZqcCqlIF6mtvcimMbf846mkv8aSWFnTwABr/g==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/x-editable/1.5.1/bootstrap3-editable/css/bootstrap-editable.css" integrity="sha512-e0rbO6UJET0zDdXOHjwc6D44UpeKumn7cU7XR/fa4S0/Jso0bZqcCqlIF6mtvcimMbf846mkv8aSWFnTwABr/g==" crossorigin="anonymous" referrerpolicy="no-referrer">
<!-- End X-editable CSS from cdnjs -->

View File

@@ -4,7 +4,7 @@
{% include theme.css_template %}
{% else %}
{% for x in theme.css %}
<link rel="stylesheet" href="{{ x.url }}" integrity="{{ x.integrity }}" crossorigin="anonymous" referrerpolicy="no-referrer"/>
<link rel="stylesheet" href="{{ x.url }}" integrity="{{ x.integrity }}" crossorigin="anonymous" referrerpolicy="no-referrer">
{% endfor %}
{% endif %}
<!-- allianceauth.theme.{{ theme.name }} CSS Ends -->

View File

@@ -21,8 +21,11 @@ def get_theme_from_hooks(theme, hooks):
def get_theme(request):
theme = settings.DEFAULT_THEME
hooks = get_hooks('theme_hook')
if request.user:
theme = request.user.profile.theme or theme
try:
theme = request.session.get('THEME', settings.DEFAULT_THEME_DARK if request.session.get('NIGHT_MODE', False) is True else settings.DEFAULT_THEME)
except AttributeError:
pass
theme_hook = get_theme_from_hooks(theme, hooks)

View File

@@ -6,50 +6,52 @@
<div class="card-body">
<h4 class="card-title text-center">{% translate "Upcoming Timers" %}</h4>
<div class="card-body">
<div style="height: 300px;overflow:-moz-scrollbars-vertical;overflow-y:auto;">
<table class="table" style="--bs-table-bg: transparent;">
<div style="height: 300px; overflow-y:auto;">
<table class="table">
<thead>
<th class="text-center">{% translate "Details" %}</th>
<th class="text-center">{% translate "Timer" %}</th>
<th class="text-center">{% translate "Type" %}</th>
<th class="text-center">{% translate "System" %}</th>
<th class="text-center">{% translate "Eve Time" %}</th>
<tr>
<th class="text-center">{% translate "Details" %}</th>
<th class="text-center">{% translate "Timer" %}</th>
<th class="text-center">{% translate "Type" %}</th>
<th class="text-center">{% translate "System" %}</th>
<th class="text-center">{% translate "Eve Time" %}</th>
</tr>
</thead>
<tbody>
{% for timer in timers %}
<tr>
<td style="" class="text-center">
{{ timer.details }}
</td>
<td style="" class="text-center">
{{ timer.get_timer_type_display }}
</td>
<td class="text-center" nowrap>
{% if timer.objective == "Hostile" %}
<div class="badge badge-danger">
{% translate "Hostile" %}
</div>
{% endif %}
{% if timer.objective == "Friendly" %}
<div class="badge badge-primary">
{% translate "Friendly" %}
</div>
{% endif %}
{% if timer.objective == "Neutral" %}
<div class="badge badge-default">
{% translate "Neutral" %}
</div>
{% endif %}
</td>
<td class="text-center"><a href="{{ timer.system|dotlan_solar_system_url }}">
{{ timer.system }} {{ timer.planet_moon }}
</a>
</td>
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
{% for timer in timers %}
<tr>
<td class="text-center">
{{ timer.details }}
</td>
<td class="text-center">
{{ timer.get_timer_type_display }}
</td>
<td class="text-center" nowrap>
{% if timer.objective == "Hostile" %}
<div class="badge bg-danger">
{% translate "Hostile" %}
</div>
{% endif %}
{% if timer.objective == "Friendly" %}
<div class="badge bg-primary">
{% translate "Friendly" %}
</div>
{% endif %}
{% if timer.objective == "Neutral" %}
<div class="badge bg-default">
{% translate "Neutral" %}
</div>
{% endif %}
</td>
<td class="text-center"><a href="{{ timer.system|dotlan_solar_system_url }}">
{{ timer.system }} {{ timer.planet_moon }}
</a>
</td>
<td class="text-center" nowrap>{{ timer.eve_time | date:"Y-m-d H:i" }}</td>
</tr>
{% endfor %}
</tbody>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>

View File

@@ -18,10 +18,10 @@
</div>
</h1>
<div class="col-lg-12 text-center">
<div class="badge badge-info text-start">
<div class="badge bg-info text-start">
<b>{% translate "Current Eve Time:" %} </b>
</div>
<strong class="badge badge-info text-start" id="current-time"></strong>
<strong class="badge bg-info text-start" id="current-time"></strong>
</div>
{% if corp_timers %}
<h4><b>{% translate "Corp Timers" %}</b></h4>
@@ -53,17 +53,17 @@
</td>
<td class="text-center">
{% if timer.objective == "Hostile" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
{% translate "Hostile" %}
</div>
{% endif %}
{% if timer.objective == "Friendly" %}
<div class="badge badge-primary">
<div class="badge bg-primary">
{% translate "Friendly" %}
</div>
{% endif %}
{% if timer.objective == "Neutral" %}
<div class="badge badge-default">
<div class="badge bg-default">
{% translate "Neutral" %}
</div>
{% endif %}
@@ -74,97 +74,97 @@
</td>
<td class="text-center">
{% if timer.structure == "POCO" %}
<div class="badge badge-info">
<div class="badge bg-info">
POCO
</div>
{% endif %}
{% if timer.structure == "I-HUB" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
I-HUB
</div>
{% endif %}
{% if timer.structure == "TCU" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
TCU
</div>
{% endif %}
{% if timer.structure == "POS[S]" %}
<div class="badge badge-info">
<div class="badge bg-info">
POS [S]
</div>
{% endif %}
{% if timer.structure == "POS[M]" %}
<div class="badge badge-info">
<div class="badge bg-info">
POS [M]
</div>
{% endif %}
{% if timer.structure == "POS[L]" %}
<div class="badge badge-info">
<div class="badge bg-info">
POS [L]
</div>
{% endif %}
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
Astrahus
</div>
{% endif %}
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
Fortizar
</div>
{% endif %}
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
Keepstar
</div>
{% endif %}
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Raitaru
</div>
{% endif %}
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Azbel
</div>
{% endif %}
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Sotiyo
</div>
{% endif %}
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Athanor
</div>
{% endif %}
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara"%}
<div class="badge badge-warning">
<div class="badge bg-warning">
Tatara
</div>
{% endif %}
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Cyno Beacon
</div>
{% endif %}
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Tenebrex Cyno Jammer
</div>
{% endif %}
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Ansiblex Jump Gate
</div>
{% endif %}
{% if timer.structure == "Moon Mining Cycle" %}
<div class="badge badge-success">
<div class="badge bg-success">
Moon Mining Cycle
</div>
{% endif %}
{% if timer.structure == "Other" %}
<div class="badge badge-default">
<div class="badge bg-default">
Other
</div>
{% endif %}
@@ -220,17 +220,17 @@
</td>
<td class="text-center">
{% if timer.objective == "Hostile" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
{% translate "Hostile" %}
</div>
{% endif %}
{% if timer.objective == "Friendly" %}
<div class="badge badge-primary">
<div class="badge bg-primary">
{% translate "Friendly" %}
</div>
{% endif %}
{% if timer.objective == "Neutral" %}
<div class="badge badge-default">
<div class="badge bg-default">
{% translate "Neutral" %}
</div>
{% endif %}
@@ -242,97 +242,97 @@
</td>
<td class="text-center">
{% if timer.structure == "POCO" %}
<div class="badge badge-info">
<div class="badge bg-info">
POCO
</div>
{% endif %}
{% if timer.structure == "I-HUB" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
I-HUB
</div>
{% endif %}
{% if timer.structure == "TCU" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
TCU
</div>
{% endif %}
{% if timer.structure == "POS[S]" %}
<div class="badge badge-info">
<div class="badge bg-info">
POS [S]
</div>
{% endif %}
{% if timer.structure == "POS[M]" %}
<div class="badge badge-info">
<div class="badge bg-info">
POS [M]
</div>
{% endif %}
{% if timer.structure == "POS[L]" %}
<div class="badge badge-info">
<div class="badge bg-info">
POS [L]
</div>
{% endif %}
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
Astrahus
</div>
{% endif %}
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
Fortizar
</div>
{% endif %}
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
Keepstar
</div>
{% endif %}
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Raitaru
</div>
{% endif %}
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Azbel
</div>
{% endif %}
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Sotiyo
</div>
{% endif %}
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Athanor
</div>
{% endif %}
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Tatara
</div>
{% endif %}
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Pharolux Cyno Beacon
</div>
{% endif %}
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Tenebrex Cyno Jammer
</div>
{% endif %}
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Ansiblex Jump Gate
</div>
{% endif %}
{% if timer.structure == "Moon Mining Cycle" %}
<div class="badge badge-success">
<div class="badge bg-success">
Moon Mining Cycle
</div>
{% endif %}
{% if timer.structure == "Other" %}
<div class="badge badge-default">
<div class="badge bg-default">
Other
</div>
{% endif %}
@@ -393,17 +393,17 @@
</td>
<td class="text-center">
{% if timer.objective == "Hostile" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
{% translate "Hostile" %}
</div>
{% endif %}
{% if timer.objective == "Friendly" %}
<div class="badge badge-primary">
<div class="badge bg-primary">
{% translate "Friendly" %}
</div>
{% endif %}
{% if timer.objective == "Neutral" %}
<div class="badge badge-default">
<div class="badge bg-default">
{% translate "Neutral" %}
</div>
{% endif %}
@@ -415,97 +415,97 @@
</td>
<td class="text-center">
{% if timer.structure == "POCO" %}
<div class="badge badge-info">
<div class="badge bg-info">
POCO
</div>
{% endif %}
{% if timer.structure == "I-HUB" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
I-HUB
</div>
{% endif %}
{% if timer.structure == "TCU" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
TCU
</div>
{% endif %}
{% if timer.structure == "POS[S]" %}
<div class="badge badge-info">
<div class="badge bg-info">
POS [S]
</div>
{% endif %}
{% if timer.structure == "POS[M]" %}
<div class="badge badge-info">
<div class="badge bg-info">
POS [M]
</div>
{% endif %}
{% if timer.structure == "POS[L]" %}
<div class="badge badge-info">
<div class="badge bg-info">
POS [L]
</div>
{% endif %}
{% if timer.structure == "Citadel[M]" or timer.structure == "Astrahus" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
Astrahus
</div>
{% endif %}
{% if timer.structure == "Citadel[L]" or timer.structure == "Fortizar" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
Fortizar
</div>
{% endif %}
{% if timer.structure == "Citadel[XL]" or timer.structure == "Keepstar" %}
<div class="badge badge-danger">
<div class="badge bg-danger">
Keepstar
</div>
{% endif %}
{% if timer.structure == "Engineering Complex[M]" or timer.structure == "Raitaru" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Raitaru
</div>
{% endif %}
{% if timer.structure == "Engineering Complex[L]" or timer.structure == "Azbel" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Azbel
</div>
{% endif %}
{% if timer.structure == "Engineering Complex[XL]" or timer.structure == "Sotiyo" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Sotiyo
</div>
{% endif %}
{% if timer.structure == "Refinery[M]" or timer.structure == "Athanor" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Athanor
</div>
{% endif %}
{% if timer.structure == "Refinery[L]" or timer.structure == "Tatara" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Tatara
</div>
{% endif %}
{% if timer.structure == "Cyno Beacon" or timer.structure == "Pharolux Cyno Beacon" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Pharolux Cyno Beacon
</div>
{% endif %}
{% if timer.structure == "Cyno Jammer" or timer.structure == "Tenebrex Cyno Jammer" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Tenebrex Cyno Jammer
</div>
{% endif %}
{% if timer.structure == "Jump Gate" or timer.structure == "Ansiblex Jump Gate" %}
<div class="badge badge-warning">
<div class="badge bg-warning">
Ansiblex Jump Gate
</div>
{% endif %}
{% if timer.structure == "Moon Mining Cycle" %}
<div class="badge badge-success">
<div class="badge bg-success">
Moon Mining Cycle
</div>
{% endif %}
{% if timer.structure == "Other" %}
<div class="badge badge-default">
<div class="badge bg-default">
Other
</div>
{% endif %}

View File

@@ -98,7 +98,7 @@ class TimerboardViewsTestCase(WebTest):
response = self.app.get(self.view_url)
context = response.context[-1]
context = response.context
timers = context['timers']
corp_timers = context['corp_timers']

View File

@@ -67,6 +67,7 @@ class AddUpdateMixin:
class AddTimerView(TimerManagementView, AddUpdateMixin, CreateView):
template_name_suffix = '_create_form'
form_class = TimerForm
def form_valid(self, form):
result = super().form_valid(form)
@@ -78,6 +79,7 @@ class AddTimerView(TimerManagementView, AddUpdateMixin, CreateView):
class EditTimerView(TimerManagementView, AddUpdateMixin, UpdateView):
template_name_suffix = '_update_form'
form_class = TimerForm
def form_valid(self, form):
messages.success(self.request, _('Saved changes to the timer.'))
@@ -85,7 +87,7 @@ class EditTimerView(TimerManagementView, AddUpdateMixin, UpdateView):
class RemoveTimerView(TimerManagementView, DeleteView):
pass
form_class = TimerForm
def dashboard_timers(request):

View File

@@ -1,3 +1,4 @@
import warnings
from django.views.generic.base import View
from django.http import HttpResponseRedirect
from django.shortcuts import render, redirect
@@ -33,6 +34,7 @@ class NightModeRedirectView(View):
class ThemeRedirectView(View):
THEME_VAR = "THEME"
def post(self, request, *args, **kwargs):
theme = request.POST.get('theme', settings.DEFAULT_THEME)
@@ -40,6 +42,7 @@ class ThemeRedirectView(View):
try:
request.user.profile.theme = theme
request.user.profile.save()
request.session[self.THEME_VAR] = theme
except Exception as e:
logger.exception(e)

View File

@@ -1,7 +1,7 @@
PROTOCOL=https://
AUTH_SUBDOMAIN=%AUTH_SUBDOMAIN%
DOMAIN=%DOMAIN%
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.0.0a1
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.0.0a2
# Nginx Proxy Manager
PROXY_HTTP_PORT=80

View File

@@ -1,5 +1,5 @@
FROM python:3.11-slim
ARG AUTH_VERSION=v4.0.0a1
ARG AUTH_VERSION=v4.0.0a2
ARG AUTH_PACKAGE=allianceauth==${AUTH_VERSION}
ENV AUTH_USER=allianceauth
ENV AUTH_GROUP=allianceauth

View File

@@ -1,90 +0,0 @@
# Alliance Auth -- Docker
## Prerequesites
You should have the following available on the system you are using to set this up:
* Docker - https://docs.docker.com/get-docker/
* git
* curl
## Setup Guide
1. run `bash <(curl -s https://gitlab.com/allianceauth/allianceauth/-/raw/master/docker/scripts/download.sh)`. This will download all the files you need to install auth and place them in a directory named `aa-docker`. Feel free to rename/move this folder.
1. run `./scripts/prepare-env.sh` to set up your environment
1. (optional) Change `PROTOCOL` to `http://` if not using SSL in `.env`
1. run `docker-compose --env-file=.env up -d` (NOTE: if this command hangs, follow the instructions [here](https://www.digitalocean.com/community/tutorials/how-to-setup-additional-entropy-for-cloud-servers-using-haveged))
1. run `docker-compose exec allianceauth bash` to open up a terminal inside your auth container
1. run `auth migrate`
1. run `auth collectstatic`
1. run `auth createsuperuser`
1. visit http://yourdomain:81 to set up nginx proxy manager (NOTE: if this doesn't work, the machine likely has a firewall. You'll want to open up ports 80,443, and 81. [Instructions for ufw](https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands))
1. login with user `admin@example.com` and password `changeme`, then update your password as requested
1. click on "Proxy Hosts"
1. click "Add Proxy Host", with the following settings for auth. The example uses `auth.localhost` for the domain, but you'll want to use whatever address you have auth configured on
![](./docs/images/nginx-host.png)
1. click "Add Proxy Host", with the following settings for grafana. The example uses `grafana.localhost` for the domain
![](./docs/images/grafana-host.png)
Congrats! You should now see auth running at http://auth.yourdomain and grafana at http://grafana.yourdomain!
## SSL Guide
Unless you're running auth locally in docker for testing, you should be using SSL.
Thankfully, setting up SSL in nginx Proxy Manager takes about three clicks.
1. Edit your existing proxy host, and go to the SSL tab. Select "Request a new SSL Certificate" from the drop down.
1. Now, enable "Force SSL" and "HTTP/2 Support". (NOTE: Do not enable HSTS unless you know what you're doing. This will force your domains to only work with SSL enabled, and is cached extremely hard in browsers. )
![](./docs/images/proxy-manager-ssl.png)
1. (optional) select "Use a DNS Challenge". This is not a required option, but it is recommended if you use a supported DNS provider. You'll then be asked for an API key for the provider you choose. If you use Cloudflare, you'll probably have issues getting SSL certs unless you use a DNS Challenge.
1. The email address here will be used to notify you if there are issues renewing your certificates.
1. Repeat for any other services, like grafana.
That's it! You should now be able to access your auth install at https://auth.yourdomain
## Adding extra packages
There are a handful of ways to add packages:
* Running `pip install` in the container
* Modifying the container's initial command to install packages
* Building a custom Docker image (recommended, and less scary than it sounds!)
### Using a custom docker image
Using a custom docker image is the preferred approach, as it gives you the stability of packages only changing when you tell them to, along with packages not having to be downloaded every time your container restarts
1. Add each additional package that you want to install to a single line in `conf/requirements.txt`. It is recommended, but not required, that you include a version number as well. This will keep your packages from magically updating. You can lookup packages on https://package.wiki, and copy everything after `pip install` from the top of the page to use the most recent version. It should look something like `allianceauth-signal-pings==0.0.7`. Every entry in this file should be on a separate line
1. In `docker-compose.yml`, comment out the `image` line under `allianceauth` (line 36... ish) and uncomment the `build` section
1. run `docker-compose --env-file=.env up -d`, your custom container will be built, and auth will have your new packages. Make sure to follow the package's instructions on config values that go in `local.py`
1. run `docker-compose exec allianceauth bash` to open up a terminal inside your auth container
1. run `allianceauth update myauth`
1. run `auth migrate`
1. run `auth collectstatic`
_NOTE: It is recommended that you put any secret values (API keys, database credentials, etc) in an environment variable instead of hardcoding them into `local.py`. This gives you the ability to track your config in git without committing passwords. To do this, just add it to your `.env` file, and then reference in `local.py` with `os.environ.get("SECRET_NAME")`_
## Updating Auth
### Base Image
Whether you're using a custom image or not, the version of auth is dictated by $AA_DOCKER_TAG in your `.env` file.
1. To update to a new version of auth, update the version number at the end (or replace the whole value with the tag in the release notes).
1. run `docker-compose pull`
1. run `docker-compose --env-file=.env up -d`
1. run `docker-compose exec allianceauth bash` to open up a terminal inside your auth container
1. run `allianceauth update myauth`
1. run `auth migrate`
1. run `auth collectstatic`
_NOTE: If you specify a version of allianceauth in your `requirements.txt` in a custom image it will override the version from the base image. Not recommended unless you know what you're doing_
### Custom Packages
1. Update the versions in your `requirements.txt` file
1. Run `docker-compose build`
1. Run `docker-compose --env-file=.env up -d`
## Notes
### Apple M1 Support
If you want to run locally on an M1 powered Apple device, you'll need to add `platform: linux/x86_64` under each container in `docker-compose.yml` as the auth container is not compiled for ARM (other containers may work without this, but it's known to work if added to all containers).
Example:
```yaml
redis:
platform: linux/x86_64
image: redis:6.2
```

View File

@@ -85,7 +85,7 @@ services:
]
allianceauth_beat:
container_name: auth_worker_beat
container_name: allianceauth_worker_beat
<<: [*allianceauth-base]
entrypoint: [
"/opt/venv/bin/celery",

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,49 @@
# Code Style
## Pre-Commit
Alliance Auth is a team effort with developers of various skill levels and background. To avoid significant drift or formatting changes between developers we use [pre-commit](https://pre-commit.com/) to apply a very minimal set of formatting checks to code contributed to the project.
Pre-commit is also very popular with our Community Apps and may be significantly more opinionated or looser depending on the project.
To get started, `pip install pre-commit`, then `pre-commit install` to add the git hooks.
Before any code is "git push"-ed, pre-commit will check it for uniformity and correct it if possible
```bash
check python ast.....................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
check json...........................................(no files to check)Skipped
check toml...........................................(no files to check)Skipped
check xml............................................(no files to check)Skipped
check for merge conflicts............................(no files to check)Skipped
check for added large files..........................(no files to check)Skipped
detect private key...................................(no files to check)Skipped
check for case conflicts.............................(no files to check)Skipped
debug statements (python)............................(no files to check)Skipped
fix python encoding pragma...........................(no files to check)Skipped
fix utf-8 byte order marker..........................(no files to check)Skipped
mixed line ending....................................(no files to check)Skipped
trim trailing whitespace.............................(no files to check)Skipped
check that executables have shebangs.................(no files to check)Skipped
fix end of files.....................................(no files to check)Skipped
Check .editorconfig rules............................(no files to check)Skipped
django-upgrade.......................................(no files to check)Skipped
pyupgrade............................................(no files to check)Skipped
```
## Editorconfig
[Editorconfig](https://editorconfig.org/) is supported my most IDE's to streamline the most common editor disparities. While checked by our pre-commit file, using this in your IDE (Either automatically or via a plugin) will minimize the corrections that may need to be made.
## Doc Strings
We prefer either [PEP-287](https://peps.python.org/pep-0287/)/[reStructuredText](https://docutils.sourceforge.io/rst.html) or [Google](https://google.github.io/styleguide/pyguide.html#381-docstrings) Docstrings.
These can be used to automatically generate our Sphinx documentation in either format.
## Best Practice
It is advisable to avoid wide formatting changes on code that is not being modified by an MR. Further to this, automated code formatting should be kept to a minimal when modifying sections of existing files.
If you are contributing whole modules or rewriting large sections of code you may use any legible code formatting valid under Python.

View File

@@ -7,4 +7,5 @@ This section contains important information on how to develop Alliance Auth itse
:maxdepth: 1
documentation
code-style
```

View 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".
![Alliance Auth Framework: Callout Boxes](/_static/images/development/css-framework/callout-boxes.png "Alliance Auth Framework: Callout Boxes")
### 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>
```

View File

@@ -11,4 +11,5 @@ This section describes how to extend **Alliance Auth** with custom apps, service
menu-hooks
url-hooks
logging
css-framework
```

View File

@@ -13,7 +13,7 @@ Welcome to the official documentation for **Alliance Auth**!
:caption: Contents
installation/index
installation containerized/index
installation-containerized/index
features/index
maintenance/index
support/index

View File

@@ -1,4 +1,4 @@
# Installation -- Docker
# Docker
## Prerequisites
@@ -22,9 +22,9 @@ You should have the following available on the system you are using to set this
1. login with user `admin@example.com` and password `changeme`, then update your password as requested
1. click on "Proxy Hosts"
1. click "Add Proxy Host", with the following settings for auth. The example uses `auth.localhost` for the domain, but you'll want to use whatever address you have auth configured on
![nginx-host](/_static/images/installation/dokcer/nginx-host.png)
![nginx-host](/_static/images/installation/docker/nginx-host.png)
1. click "Add Proxy Host", with the following settings for grafana. The example uses `grafana.localhost` for the domain
![grafana-host](/_static/images/installation/dokcer/grafana-host.png))
![grafana-host](/_static/images/installation/docker/grafana-host.png))
Congrats! You should now see auth running at <http://auth.yourdomain> and grafana at <http://grafana.yourdomain>!
@@ -35,7 +35,7 @@ Thankfully, setting up SSL in nginx Proxy Manager takes about three clicks.
1. Edit your existing proxy host, and go to the SSL tab. Select "Request a new SSL Certificate" from the drop down.
1. Now, enable "Force SSL" and "HTTP/2 Support". (NOTE: Do not enable HSTS unless you know what you're doing. This will force your domains to only work with SSL enabled, and is cached extremely hard in browsers. )
![proxy-manager-ssl](/_static/images/installation/dokcer/proxy-manager-ssl.png)
![proxy-manager-ssl](/_static/images/installation/docker/proxy-manager-ssl.png)
1. (optional) select "Use a DNS Challenge". This is not a required option, but it is recommended if you use a supported DNS provider. You'll then be asked for an API key for the provider you choose. If you use Cloudflare, you'll probably have issues getting SSL certs unless you use a DNS Challenge.
1. The email address here will be used to notify you if there are issues renewing your certificates.
1. Repeat for any other services, like grafana.
@@ -57,7 +57,7 @@ Using a custom docker image is the preferred approach, as it gives you the stabi
1. Add each additional package that you want to install to a single line in `conf/requirements.txt`. It is recommended, but not required, that you include a version number as well. This will keep your packages from magically updating. You can lookup packages on <https://package.wiki>, and copy everything after `pip install` from the top of the page to use the most recent version. It should look something like `allianceauth-signal-pings==0.0.7`. Every entry in this file should be on a separate line
1. In `docker-compose.yml`, comment out the `image` line under `allianceauth` (line 36... ish) and uncomment the `build` section
1. run `docker-compose --env-file=.env up -d`, your custom container will be built, and auth will have your new packages. Make sure to follow the package's instructions on config values that go in `local.py`
1. run `docker-compose exec allianceauth bash` to open up a terminal inside your auth container
1. run `docker-compose exec allianceauth_gunicorn bash` to open up a terminal inside your auth container
1. run `allianceauth update myauth`
1. run `auth migrate`
1. run `auth collectstatic`
@@ -85,17 +85,3 @@ _NOTE: If you specify a version of allianceauth in your `requirements.txt` in a
1. Update the versions in your `requirements.txt` file
1. Run `docker-compose build`
1. Run `docker-compose --env-file=.env up -d`
## Notes
### Apple M1 Support
If you want to run locally on an M1 powered Apple device, you'll need to add `platform: linux/x86_64` under each container in `docker-compose.yml` as the auth container is not compiled for ARM (other containers may work without this, but it's known to work if added to all containers).
Example:
```yaml
redis:
platform: linux/x86_64
image: redis:6.2
```

View File

@@ -1,4 +1,4 @@
# Installation
# Installation - Containerized
This document describes how to install **Alliance Auth** using various Containerization techniques.

View File

@@ -399,16 +399,10 @@ Update & install basic tools before installing further Python packages:
pip install -U pip setuptools wheel
```
You can install **Alliance Auth** with the following command. This will install AA and all its Python dependencies.
You can install **Alliance Auth** with the following command. This will install AA, AA's Python dependencies, superlance for memory monitoring and gunicorn as a wsgi server
```bash
pip install allianceauth
```
You should also install Gunicorn now unless you want to use another WSGI server (see [Gunicorn](#gunicorn) for details):
```bash
pip install gunicorn
pip install allianceauth superlance gunicorn
```
#### Create Alliance Auth project

View File

@@ -1,4 +1,4 @@
# Installation
# Installation - Bare Metal
This chapter contains the main installation guides for **Alliance Auth**.

View File

@@ -28,43 +28,11 @@ command=/home/allianceserver/venv/auth/bin/celery -A myauth worker -l info
Celery workers often have memory leaks and will therefore grow in size over time. While the Alliance Auth team is working hard to ensure Auth is free of memory leaks some may still be cause by bugs in different versions of libraries or community apps. It is therefore good practice to enable features that protect against potential memory leaks.
There are two ways to protect against memory leaks:
- Worker
- Supervisor
### Worker
Celery workers can be configured to automatically restart if they grow above a defined memory threshold. Restarts will be graceful, so current tasks will be allowed to complete before the restart happens.
To add protection against memory leaks add the following to the command configuration of your worker in the `supervisor.conf` file. This sets the upper limit to 256MB.
```text
--max-memory-per-child 262144
```
Full example:
```text
command=/home/allianceserver/venv/auth/bin/celery -A myauth worker --max-memory-per-child 262144
```
```eval_rst
.. hint::
The 256 MB limit is just an example and should be adjusted to your system configuration. We would suggest to not go below 128MB though, since new workers start with around 80 MB already. Also take into consideration that this value is per worker and that you properly have more than one worker running in your system (if your workers run as processes, which is the default).
The 256 MB limit is just an example and should be adjusted to your system configuration. We would suggest to not go below 128MB though, since new workers start with around 80 MB already. Also take into consideration that this value is per worker and that you may have more than one worker running in your system.
```
```eval_rst
.. warning::
The ``max-memory-per-child`` parameter only works when workers run as processes (which is the default). It does not work for threads.
```
```eval_rst
.. note::
Alternatively, you can also limit the number of runs per worker until a restart is performed with the worker parameter ``max-tasks-per-child``. This can also protect against memory leaks if you set the threshold is low enough. However, it is less precise since than using ``max-memory-per-child``.
```
See also the [official Celery documentation](https://docs.celeryproject.org/en/stable/userguide/workers.html#max-memory-per-child-setting) for more information about these two worker parameters.
### Supervisor
@@ -78,35 +46,68 @@ To setup install superlance into your venv with:
pip install superlance
```
You can then add `memmon` to your `supervisor.conf`. Here is an example setup with a worker that runs with gevent:
You can then add `memmon` to your `supervisor.conf`:
```text
[eventlistener:memmon]
command=/home/allianceserver/venv/auth/bin/memmon -p worker=512MB
command=/home/allianceserver/venv/auth/bin/memmon -p worker=256MB
directory=/home/allianceserver/myauth
events=TICK_60
```
This setup will check the memory consumption of the program "worker" every 60 secs and automatically restart it if is goes above 512 MB. Note that it will use the stop signal configured in supervisor, which is `TERM` by default. `TERM` will cause a "warm shutdown" of your worker, so all currently running tasks are completed before the restart.
This setup will check the memory consumption of the program "worker" every 60 secs and automatically restart it if is goes above 256 MB. Note that it will use the stop signal configured in supervisor, which is `TERM` by default. `TERM` will cause a "warm shutdown" of your worker, so all currently running tasks are completed before the restart.
Again, the 512 MB is just an example and should be adjusted to fit your system configuration.
Again, the 256 MB is just an example and should be adjusted to fit your system configuration.
## Increasing task throughput
Celery tasks are designed to run concurrently, so one obvious way to increase task throughput is run more tasks in parallel.
Celery tasks are designed to run concurrently, so one obvious way to increase task throughput is run more tasks in parallel. The default celery worker configuration will allow either of these options to be configured out of the box.
### Extra Worker Threads
The easiest way to increate throughput can be achieved by increasing the `numprocs` parameter of the suprvisor process. For example:
```text
[program:worker]
...
numprocs=2
process_name=%(program_name)s_%(process_num)02d
...
```
This number will be multiplied by your concurrency setting,
```
numprocs * concurency = workers
```
increasing this number will require a modification to the memmon settings as each `numproc` worker will get a unique name for example with `numproc=3`
```text
[eventlistener:memmon]
...
command=... -p worker_00=256MB -p worker_01=256MB -p worker_02=256MB
...
```
```eval_rst
.. hint::
You will want to experiment with different settings to find the optimal. One way to generate task load and verify your configuration is to run a model update with the following command:
::
celery -A myauth call allianceauth.eveonline.tasks.run_model_update
```
### Concurrency
This can be achieved by the setting the concurrency parameter of the celery worker to a higher number. For example:
```text
--concurrency=4
--concurrency=10
```
However, there is a catch: In the default configuration each worker will spawn as it's own process. So increasing the number of workers will increase both CPU load and memory consumption in your system.
The recommended number of workers is one per core, which is what you get automatically with the default configuration. Going beyond that can quickly reduce you overall system performance. i.e. the response time for Alliance Auth or other apps running on the same system may take a hit while many tasks are running.
```eval_rst
.. hint::
The optimal number will hugely depend on your individual system configuration and you may want to experiment with different settings to find the optimal. One way to generate task load and verify your configuration is to run a model update with the following command:
@@ -117,43 +118,6 @@ The recommended number of workers is one per core, which is what you get automat
```
### Processes vs. Threads
A better way to increase concurrency without impacting is to switch from processes to threads for celery workers. In general celery workers perform better with processes when tasks are primarily CPU bound. And they perform better with threads when tasks that are primarily I/O bound.
Alliance Auth tasks are primarily I/O bound (most tasks are fetching data from ESI and/or updating the local database), so threads are clearly the better choice for Alliance Auth. However, there is a catch. Celery's out-of-the-box support for threads is limited and additional packages and configurations is required to make it work. Nonetheless, the performance gain - especially in smaller systems - is significant, so it may well be worth the additional configuration complexity.
```eval_rst
.. warning::
One important feature that no longer works with threads is the worker parameter ``--max-memory-per-child`` that protects against memory leaks. But you can alternatively use supervisor_ to monitor and restart your workers.
```
See also the also [this guide](https://www.distributedpython.com/2018/10/26/celery-execution-pool/) on more information about how to configure the execution pool for workers.
### Setting up for threads
First, you need to install a threads packages. Celery supports both gevent and eventlet. We will go with gevent, since it's newer and better supported. Should you encounter any issues with gevent, you may want to try eventlet.
To install gevent make sure you are in your venv and install the following:
```bash
pip install gevent
```
Next we need to reconfigure the workers to use gevent threads. For that add the following parameters to your worker config:
```text
--pool=gevent --concurrency=10
```
Full example:
```text
command=/home/allianceserver/venv/auth/bin/celery -A myauth worker --pool=gevent --concurrency=10
```
Make sure to restart supervisor to activate the changes.
```eval_rst
.. hint::
The optimal number of concurrent workers will be different for every system and we recommend experimenting with different figures to find the optimal for your system. Note, that the example of 10 threads is conservative and should work even with smaller systems.

View File

@@ -1,20 +0,0 @@
# Docs Specific Packages
sphinx>=4.4.0,<5.0.0
sphinx_rtd_theme>=1.0.0,<2.0.0
recommonmark==0.7.1
Jinja2<3.1
docutils==0.16
sphinxcontrib-django2
sphinx-copybutton
# Autodoc dependencies
celery>=5.2.0,<6.0.0
celery_once>=3.0.1
django>=4.0.6,<4.1.0
django-bootstrap-form
django-celery-beat>=2.3.0
django-esi>=4.0.1
django-redis>=5.2.0,<6.0.0
django-sortedm2m
passlib
redis>=4.0.0,<5.0.0

View File

@@ -35,13 +35,14 @@ dependencies = [
"beautifulsoup4",
"celery-once>=3.0.1",
"celery>=5.2.0,<6",
'django-bootstrap5>=23.3',
"django-bootstrap-form",
"django-celery-beat>=2.3.0",
"django-esi>=4.0.1",
"django-esi>=5.0.0",
"django-redis>=5.2.0",
"django-registration>=3.3,<3.4",
"django-sortedm2m",
"django>=4.0.9,<4.1.0",
"django>=4.2,<5",
"dnspython",
"mysqlclient>=2.1.0",
"openfire-restapi",
@@ -62,6 +63,15 @@ test = [
"django-webtest",
"requests-mock>=1.2.0",
]
docs = [
"sphinx>=4.4.0,<5.0.0",
"sphinx_rtd_theme>=1.0.0,<2.0.0",
"recommonmark==0.7.1",
"Jinja2<3.1",
"docutils==0.16",
"sphinxcontrib-django2",
"sphinx-copybutton"
]
[project.scripts]
allianceauth = "allianceauth.bin.allianceauth:main"

View File

@@ -1,13 +0,0 @@
[program:auth-mumble]
command=python authenticator.py
directory=/home/allianceserver/allianceauth/thirdparty/Mumble
user=allianceserver
numprocs=1
stdout_logfile=/home/allianceserver/allianceauth/log/authenticator.log
stderr_logfile=/home/allianceserver/allianceauth/log/authenticator.log
autostart=true
autorestart=true
startsecs=10
stopwaitsecs = 600
killasgroup=true
priority=500

View File

@@ -1,28 +0,0 @@
[program:celerybeat]
command=celery -A alliance_auth beat
directory=/home/allianceserver/allianceauth
user=allianceserver
stdout_logfile=/home/allianceserver/allianceauth/log/beat.log
stderr_logfile=/home/allianceserver/allianceauth/log/beat.log
autostart=true
autorestart=true
startsecs=10
priority=998
[program:celeryd]
command=celery -A alliance_auth worker
directory=/home/allianceserver/allianceauth
user=allianceserver
numprocs=1
stdout_logfile=/home/allianceserver/allianceauth/log/worker.log
stderr_logfile=/home/allianceserver/allianceauth/log/worker.log
autostart=true
autorestart=true
startsecs=10
stopwaitsecs = 600
killasgroup=true
priority=998
[group:auth]
programs=celerybeat,celeryd
priority=999

View File

@@ -28,7 +28,7 @@ commands =
description = invoke sphinx-build to build the HTML docs
basepython = python3.11
skip_install = True
deps = -r{toxinidir}/docs/requirements.txt
deps = .[docs]
install_command = python -I -m pip install {opts} {packages}
commands =
sphinx-build -T -E -b html -d "{toxworkdir}/docs_doctree" -D language=en docs "{toxworkdir}/docs_out" {posargs}