Compare commits

...

85 Commits

Author SHA1 Message Date
Ariel Rin
5de19c43df Version Bump 4.0.0a4 2023-11-09 00:13:45 +10:00
Ariel Rin
6a0ddc9a83 Merge branch 'docker-superlance' into 'v4.x'
Add superlance/memmon path to the project bootstrap

See merge request allianceauth/allianceauth!1560
2023-11-08 13:39:11 +00:00
Ariel Rin
03be66d11f multilines dont work in our yaml 2023-11-08 23:26:12 +10:00
Ariel Rin
7e312bb95f four args now 2023-11-08 20:25:24 +10:00
Ariel Rin
c92fee78e2 add superlance/memmon path to the bootstrap 2023-11-08 20:01:07 +10:00
Ariel Rin
658a8cd6ce Merge branch 'task-queue-progressbar-background' into 'v4.x'
[FIX] Celery task status bar background

See merge request allianceauth/allianceauth!1559
2023-11-08 03:31:48 +00:00
Peter Pfeufer
c1dc130766 [FIX] Celery task status bar background 2023-11-07 15:21:44 +01:00
Ariel Rin
35f5573b63 Merge branch 'js-fixes' into 'v4.x'
JS Fixes

See merge request allianceauth/allianceauth!1556
2023-11-06 13:49:31 +00:00
Peter Pfeufer
21f0a96422 [CHANGE] Modernize and convert to ES6+ 2023-10-31 22:00:43 +01:00
Peter Pfeufer
9e47d19337 [ADD] Missing semicolons 2023-10-31 21:48:18 +01:00
Peter Pfeufer
2c5972d0ab [ADD] Refresh notification icon script
Similar to what we have in AAv3 for the notification count
2023-10-31 21:47:40 +01:00
Ariel Rin
ee41d62c13 Merge branch 'quickfix-services-control-template' into 'v4.x'
[REMOVE] Deprecated overrides …

See merge request allianceauth/allianceauth!1555
2023-10-31 13:29:48 +00:00
Peter Pfeufer
346b4014a9 [ADD] Missing semicolon
Just for the sake of it …
2023-10-31 14:13:01 +01:00
Peter Pfeufer
9b56a441ed [REMOVE] Deprecated overrides … 2023-10-31 14:10:26 +01:00
Ariel Rin
068bf1ae7a Merge branch 'services-template-improvements' into 'v4.x'
Services template improvements

See merge request allianceauth/allianceauth!1553
2023-10-31 12:42:08 +00:00
Peter Pfeufer
5be686e3ca [FIX] Username check 2023-10-31 13:28:38 +01:00
Ariel Rin
a215b4411c Merge branch 'v4theme' into 'v4.x'
Missing Import on views

See merge request allianceauth/allianceauth!1554
2023-10-31 12:14:15 +00:00
Ariel Rin
e15cfa0fb1 Missing Import on views 2023-10-31 12:14:14 +00:00
Peter Pfeufer
46d51699f4 [CHANGE] Service delete confirm template converted to BS5 2023-10-31 11:59:12 +01:00
Peter Pfeufer
ff30a136d5 [CHANGE] Service credentials template converted to BS5 2023-10-31 11:56:18 +01:00
Peter Pfeufer
6dcf3304d5 Merge remote-tracking branch 'origin/services-template-improvements' into services-template-improvements 2023-10-31 11:49:49 +01:00
Peter Pfeufer
beddeea338 [CHANGE] Discourse service status badge text 2023-10-31 11:49:18 +01:00
Ariel Rin
69723937f7 Merge branch 'update-project-classifier' into 'v4.x'
[CHANGE] Update project classifier for Django

See merge request allianceauth/allianceauth!1551
2023-10-31 10:01:14 +00:00
Ariel Rin
c541f56ee2 Merge branch 'fix-dashboard-timers' into 'v4.x'
[FIX] EveCorporationInfo matching query does not exist

See merge request allianceauth/allianceauth!1552
2023-10-31 10:01:03 +00:00
Peter Pfeufer
7e887e5e34 [ADD] General template include for username line 2023-10-31 10:47:06 +01:00
Peter Pfeufer
072327c79f [CHANGE] Comment active section for nor for Discourse service
The Discourse service doesn't seem to have anything to determine weather it's active or not.
2023-10-31 10:38:01 +01:00
Peter Pfeufer
28af3ff11e [CHANGE] Sort service card information to be a bit more uniform in apperance 2023-10-31 10:27:49 +01:00
Peter Pfeufer
e3b151f2fb [CHANGE] Use BS5 forms 2023-10-31 10:25:04 +01:00
Peter Pfeufer
f87d7dbdf8 [FIX] Normalization of TeamSpeak3 service name 2023-10-31 10:12:02 +01:00
Peter Pfeufer
a04e6ae3d0 [FIX] Normalization of IPSuite4 service name 2023-10-31 10:09:43 +01:00
Peter Pfeufer
15042f5e77 [FIX] Capitalization of Discord service name 2023-10-31 10:07:47 +01:00
Peter Pfeufer
6e25361d5e [FIX] Capitalization of XenForo service name 2023-10-31 10:06:36 +01:00
Peter Pfeufer
9e639a0eeb [FIX] Capitalization of SMF service name 2023-10-31 10:04:55 +01:00
Peter Pfeufer
257fbdef36 [FIX] Capitalization of Jabber service name 2023-10-31 10:03:06 +01:00
Peter Pfeufer
df003c8ec5 [CHANGE] TS³ service template 2023-10-31 09:57:54 +01:00
Peter Pfeufer
ba22685eb8 [CHANGE] Discourse service template 2023-10-31 09:53:09 +01:00
Peter Pfeufer
773288072a [CHANGE] Discord service 2023-10-31 09:48:29 +01:00
Peter Pfeufer
63afb13d25 [CHANGE] Mumble service template 2023-10-31 09:48:07 +01:00
Peter Pfeufer
5dd286bbe7 [CHANGE] Set a default via status template 2023-10-31 09:47:22 +01:00
Peter Pfeufer
8aaa8172ca [CHANGE] Only show username when there is a username 2023-10-31 08:58:30 +01:00
Peter Pfeufer
b68b401146 [FIX] EveCorporationInfo matching query does not exist 2023-10-29 11:55:42 +01:00
Peter Pfeufer
a6526d6f78 [CHANGE] Update project classifier for Django 2023-10-28 00:12:40 +02:00
Ariel Rin
7898594909 Version Bump 4.0.0a3 2023-10-27 23:23:48 +10:00
Ariel Rin
cfd12ee3cc Merge branch 'v4theme' into 'v4.x'
remove rogue span tag

See merge request allianceauth/allianceauth!1546
2023-10-27 13:22:38 +00:00
Ariel Rin
2c9177b19f remove rogue span tag 2023-10-27 13:22:38 +00:00
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
117 changed files with 1409 additions and 1178 deletions

View File

@@ -223,7 +223,7 @@ test-docs:
<<: *only-default
image: python:3.11-bullseye
script:
- tox -e docs
- tox -e docs
deploy_production:
stage: deploy
@@ -259,7 +259,7 @@ 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 +279,7 @@ 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 +300,7 @@ 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.0a4'
__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

@@ -12,13 +12,14 @@ class StartProject(BaseStartProject):
parser.add_argument('--python', help='The path to the python executable.')
parser.add_argument('--celery', help='The path to the celery executable.')
parser.add_argument('--gunicorn', help='The path to the gunicorn executable.')
parser.add_argument('--memmon', help='The path to the memmon executable.')
def create_project(parser, options, args):
# Validate args
if len(args) < 2:
parser.error("Please specify a name for your Alliance Auth installation.")
elif len(args) > 3:
elif len(args) > 4:
parser.error("Too many arguments.")
# First find the path to Alliance Auth
@@ -32,6 +33,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

@@ -70,22 +70,21 @@ class DiscordService(ServicesHook):
discord_username = self.get_discord_username(
username=username, discriminator=discriminator
)
# if username and discriminator:
# discord_username = f'{username}#{discriminator}'
#
# # New Discord user name format
# if discriminator == '0':
# discord_username = f'@{username}'
# else:
# discord_username = ''
else:
discord_username = ''
user_has_account = False
urls = self.Urls()
urls.auth_activate = 'discord:activate'
urls.auth_deactivate = 'discord:deactivate'
urls.auth_reset = 'discord:reset'
urls.auth_add_bot = 'discord:add_bot'
return render_to_string(
self.service_ctrl_template,
{
'service_name': self.title,
'urls': urls,
'server_name': server_name(),
'user_has_account': user_has_account,
'discord_username': discord_username

View File

@@ -1,34 +1,49 @@
{% extends "services/services_ctrl_base.html" %}
{% load i18n %}
<div class="card text-center m-4" style="min-width: 18rem; min-height: 18rem;">
<div class="card-body ">
<h5 class="card-title ">{% translate "Discord" %}</h5>
<p class="card-text">{% if server_name %}{{ server_name }}{% else %}{% translate "Unlinked Server" %}{% endif %}</p>
<p class="card-text"><span class="badge {% if user_has_account %}bg-success{% else %}bg-warning{% endif %}">{% if user_has_account %}{% translate "Active" %}{% else %}{% translate "Disabled" %}{% endif %}</span></p>
<p class="card-text">
{% if not user_has_account %}
{% translate "(not activated)" %}
{% else %}
{{ discord_username }}
{% endif %}
</p>
</div>
<div class="card-footer">
{% if not user_has_account %}
<a href="{% url 'discord:activate' %}" title="{% translate 'Join the Discord server' %}" class="btn btn-primary">
{% block title %}
{{ service_name }}
{% endblock %}
{% block url %}
{{ server_name }}
{% endblock %}
{% block active %}
{% include "services/service_status.html" with username=discord_username %}
{% endblock %}
{% block user %}
{% if discord_username %}
{{ discord_username }}
{% endif %}
{% endblock %}
{% block controls %}
{% if not user_has_account %}
{% if urls.auth_activate %}
<a class="btn btn-warning" href="{% url urls.auth_activate %}" title="{% translate 'Activate' %}">
<span class="fas fa-check fa-fw"></span>
</a>
{% else %}
<a href="{% url 'discord:reset' %}" title="{% translate 'Leave- and rejoin the Discord Server (Reset)' %}" class="btn btn-warning">
{% endif %}
{% else %}
{% if urls.auth_reset %}
<a class="btn btn-primary" href="{% url urls.auth_reset %}" title="{% translate 'Reset Password' %}">
<span class="fas fa-sync fa-fw"></span>
</a>
<a href="{% url 'discord:deactivate' %}" title="{% translate 'Leave the Discord server' %}" class="btn btn-danger">
{% endif %}
{% if urls.auth_deactivate %}
<a class="btn btn-danger" href="{% url urls.auth_deactivate %}" title="{% translate 'Deactivate' %}">
<span class="fas fa-times fa-fw"></span>
</a>
{% endif %}
{% if request.user.is_superuser %}
<a type="button" id="btnLinkDiscordServer" class="btn btn-primary" href="{% url 'discord:add_bot' %}">
<span class="fas fa-link fa-fw"></span>
</a>
{% endif %}
</div>
</div>
{% endif %}
{% if request.user.is_superuser %}
<a class="btn btn-primary" type="button" id="btnLinkDiscordServer" href="{% url urls.auth_add_bot %}" title="{% translate 'Link Discord Server' %}">
<span class="fas fa-link fa-fw"></span>
</a>
{% endif %}
{% endblock %}

View File

@@ -26,11 +26,11 @@ def deactivate_discord(request):
if request.user.discord.delete_user(
is_rate_limited=False, handle_api_exceptions=True
):
logger.info("Successfully deactivated discord for user %s", request.user)
logger.info("Successfully deactivated Discord for user %s", request.user)
messages.success(request, _('Deactivated Discord account.'))
else:
logger.error(
"Unsuccessful attempt to deactivate discord for user %s", request.user
"Unsuccessful attempt to deactivate Discord for user %s", request.user
)
messages.error(
request, _('An error occurred while processing your Discord account.')
@@ -46,14 +46,14 @@ def reset_discord(request):
is_rate_limited=False, handle_api_exceptions=True
):
logger.info(
"Successfully deleted discord user for user %s - "
"forwarding to discord activation.",
"Successfully deleted Discord user for user %s - "
"forwarding to Discord activation.",
request.user
)
return redirect("discord:activate")
logger.error(
"Unsuccessful attempt to reset discord for user %s", request.user
"Unsuccessful attempt to reset Discord for user %s", request.user
)
messages.error(
request, _('An error occurred while processing your Discord account.')

View File

@@ -10,11 +10,17 @@
{% endblock %}
{% block user %}
Username: {{ char.character_name }}
{% include "services/service_username.html" with username=char.character_name %}
{% endblock %}
{% block active %}
<span class="badge bg-success">
{% translate "SSO login active" %}
</span>
{% endblock %}
{% block controls %}
<a title="Go To Forums" href="{{ DISCOURSE_URL }}" class="btn btn-success" title="Connect">
<a class="btn btn-success" href="{{ DISCOURSE_URL }}" title="{% translate 'Go to forums' %}">
<span class="fas fa-arrow-right fa-fw"></span>
</a>
{% endblock %}

View File

@@ -25,9 +25,9 @@ def activate_ips4(request):
# if empty we failed
if result[0] != "" and not Ips4Tasks.has_account(request.user):
ips_user = Ips4User.objects.create(user=request.user, id=result[2], username=result[0])
logger.debug("Updated authserviceinfo for user %s with IPS4 credentials." % request.user)
logger.debug("Updated authserviceinfo for user %s with IPSuite4 credentials." % request.user)
# update_ips4_groups.delay(request.user.pk)
logger.info("Successfully activated IPS4 for user %s" % request.user)
logger.info("Successfully activated IPSuite4 for user %s" % request.user)
messages.success(request, _('Activated IPSuite4 account.'))
credentials = {
'username': result[0],
@@ -35,7 +35,7 @@ def activate_ips4(request):
}
return render(request, 'services/service_credentials.html', context={'credentials': credentials, 'service': 'IPSuite4'})
else:
logger.error("Unsuccessful attempt to activate IPS4 for user %s" % request.user)
logger.error("Unsuccessful attempt to activate IPSuite4 for user %s" % request.user)
messages.error(request, _('An error occurred while processing your IPSuite4 account.'))
return redirect("services:services")
@@ -48,7 +48,7 @@ def reset_ips4_password(request):
result = Ips4Manager.update_user_password(request.user.ips4.username)
# false we failed
if result != "":
logger.info("Successfully reset IPS4 password for user %s" % request.user)
logger.info("Successfully reset IPSuite4 password for user %s" % request.user)
messages.success(request, _('Reset IPSuite4 password.'))
credentials = {
'username': request.user.ips4.username,
@@ -56,7 +56,7 @@ def reset_ips4_password(request):
}
return render(request, 'services/service_credentials.html', context={'credentials': credentials, 'service': 'IPSuite4'})
logger.error("Unsuccessful attempt to reset IPS4 password for user %s" % request.user)
logger.error("Unsuccessful attempt to reset IPSuite4 password for user %s" % request.user)
messages.error(request, _('An error occurred while processing your IPSuite4 account.'))
return redirect("services:services")
@@ -74,10 +74,10 @@ def set_ips4_password(request):
logger.debug("Form contains password of length %s" % len(password))
result = Ips4Manager.update_custom_password(request.user.ips4.username, plain_password=password)
if result != "":
logger.info("Successfully set IPS4 password for user %s" % request.user)
logger.info("Successfully set IPSuite4 password for user %s" % request.user)
messages.success(request, _('Set IPSuite4 password.'))
else:
logger.error("Failed to install custom IPS4 password for user %s" % request.user)
logger.error("Failed to install custom IPSuite4 password for user %s" % request.user)
messages.error(request, _('An error occurred while processing your IPSuite4 account.'))
return redirect('services:services')
else:
@@ -94,9 +94,9 @@ def set_ips4_password(request):
def deactivate_ips4(request):
logger.debug("deactivate_ips4 called by user %s" % request.user)
if Ips4Tasks.delete_user(request.user):
logger.info("Successfully deactivated IPS4 for user %s" % request.user)
logger.info("Successfully deactivated IPSuite4 for user %s" % request.user)
messages.success(request, _('Deactivated IPSuite4 account.'))
else:
logger.error("Unsuccessful attempt to deactivate IPS4 for user %s" % request.user)
logger.error("Unsuccessful attempt to deactivate IPSuite4 for user %s" % request.user)
messages.error(request, _('An error occurred while processing your IPSuite4 account.'))
return redirect("services:services")

View File

@@ -1,34 +1,49 @@
{% extends "services/services_ctrl_base.html" %}
{% load i18n %}
<div class="card text-center m-4" style="min-width: 18rem; min-height: 18rem;">
<div class="card-body ">
<h5 class="card-title ">{{ service_name }}</h5>
<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 class="card-footer">
{% if username == "" %}
<td class="text-center">{{ service_url }}</td>
<td class="text-center">
<a href="{% url 'mumble:activate' %}" title="Activate" class="btn btn-warning">
<span class="fas fa-check fa-fw"></span>
</a>
</td>
{% else %}
<td 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>
<a href="{% url 'mumble:reset_password' %}" title="Reset Password" class="btn btn-primary">
<span class="fas fa-sync fa-fw"></span>
</a>
<a href="{% url 'mumble:deactivate' %}" title="Deactivate" class="btn btn-danger">
<span class="fas fa-times fa-fw"></span>
</a>
<a href="mumble://{{ connect_url }}" class="btn btn-success" title="Connect">
<span class="fas fa-arrow-right fa-fw"></span>
</a>
</td>
{% block title %}
{{ service_name }}
{% endblock %}
{% block url %}
<a href="{{ service_url }}">{{ service_url }}</a>
{% endblock %}
{% block user %}
{% include "services/service_username.html" with username=username %}
{% endblock %}
{% block controls %}
{% if username == "" %}
{% if urls.auth_activate %}
<a class="btn btn-warning" href="{% url urls.auth_activate %}" title="{% translate 'Activate' %}">
<span class="fas fa-check fa-fw"></span>
</a>
{% endif %}
</div>
</div>
{% else %}
{% if urls.auth_set_password %}
<a class="btn btn-warning" href="{% url urls.auth_set_password %}" title="{% translate 'Set Password' %}">
<span class="fas fa-edit fa-fw"></span>
</a>
{% endif %}
{% if urls.auth_reset_password %}
<a class="btn btn-primary" href="{% url urls.auth_reset_password %}" title="{% translate 'Reset Password' %}">
<span class="fas fa-sync fa-fw"></span>
</a>
{% endif %}
{% if urls.auth_deactivate %}
<a class="btn btn-danger" href="{% url urls.auth_deactivate %}" title="{% translate 'Deactivate' %}">
<span class="fas fa-times fa-fw"></span>
</a>
{% endif %}
{% if connect_url %}
<a class="btn btn-success" href="mumble://{{ connect_url }}" title="{% translate 'Connect' %}">
<span class="fas fa-arrow-right fa-fw"></span>
</a>
{% endif %}
{% endif %}
{% endblock %}

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% load django_bootstrap5 %}
{% load i18n %}
{% block page_title %}{% translate "Jabber Broadcast" %}{% endblock page_title %}
@@ -17,7 +17,7 @@
{% endif %}
<form class="form-signin" role="form" action="" method="POST" onsubmit="submitbutton.disabled = true; return true;">
{% csrf_token %}
{{ form|bootstrap }}
{% bootstrap_form form %}
<br>
<button class="btn btn-lg btn-primary btn-block" name="submitbutton" type="submit">{% translate "Broadcast" %}
</button>

View File

@@ -24,23 +24,23 @@ ACCESS_PERM = 'openfire.access_openfire'
def activate_jabber(request):
logger.debug("activate_jabber called by user %s" % request.user)
character = request.user.profile.main_character
logger.debug(f"Adding jabber user for user {request.user} with main character {character}")
logger.debug(f"Adding Jabber user for user {request.user} with main character {character}")
info = OpenfireManager.add_user(OpenfireTasks.get_username(request.user))
# If our username is blank means we already had a user
if info[0] != "":
OpenfireUser.objects.update_or_create(user=request.user, defaults={'username': info[0]})
logger.debug("Updated authserviceinfo for user %s with jabber credentials. Updating groups." % request.user)
logger.debug("Updated authserviceinfo for user %s with Jabber credentials. Updating groups." % request.user)
OpenfireTasks.update_groups.delay(request.user.pk)
logger.info("Successfully activated jabber for user %s" % request.user)
messages.success(request, _('Activated jabber account.'))
logger.info("Successfully activated Jabber for user %s" % request.user)
messages.success(request, _('Activated Jabber account.'))
credentials = {
'username': info[0],
'password': info[1],
}
return render(request, 'services/service_credentials.html', context={'credentials': credentials, 'service': 'Jabber'})
else:
logger.error("Unsuccessful attempt to activate jabber for user %s" % request.user)
messages.error(request, _('An error occurred while processing your jabber account.'))
logger.error("Unsuccessful attempt to activate Jabber for user %s" % request.user)
messages.error(request, _('An error occurred while processing your Jabber account.'))
return redirect("services:services")
@@ -49,11 +49,11 @@ def activate_jabber(request):
def deactivate_jabber(request):
logger.debug("deactivate_jabber called by user %s" % request.user)
if OpenfireTasks.has_account(request.user) and OpenfireTasks.delete_user(request.user):
logger.info("Successfully deactivated jabber for user %s" % request.user)
messages.success(request, 'Deactivated jabber account.')
logger.info("Successfully deactivated Jabber for user %s" % request.user)
messages.success(request, 'Deactivated Jabber account.')
else:
logger.error("Unsuccessful attempt to deactivate jabber for user %s" % request.user)
messages.error(request, _('An error occurred while processing your jabber account.'))
logger.error("Unsuccessful attempt to deactivate Jabber for user %s" % request.user)
messages.error(request, _('An error occurred while processing your Jabber account.'))
return redirect("services:services")
@@ -65,15 +65,15 @@ def reset_jabber_password(request):
result = OpenfireManager.update_user_pass(request.user.openfire.username)
# If our username is blank means we failed
if result != "":
logger.info("Successfully reset jabber password for user %s" % request.user)
messages.success(request, _('Reset jabber password.'))
logger.info("Successfully reset Jabber password for user %s" % request.user)
messages.success(request, _('Reset Jabber password.'))
credentials = {
'username': request.user.openfire.username,
'password': result,
}
return render(request, 'services/service_credentials.html', context={'credentials': credentials, 'service': 'Jabber'})
logger.error("Unsuccessful attempt to reset jabber for user %s" % request.user)
messages.error(request, _('An error occurred while processing your jabber account.'))
logger.error("Unsuccessful attempt to reset Jabber for user %s" % request.user)
messages.error(request, _('An error occurred while processing your Jabber account.'))
return redirect("services:services")
@@ -95,7 +95,7 @@ def jabber_broadcast_view(request):
logger.debug("Received POST request containing form, valid: %s" % form.is_valid())
if form.is_valid():
main_char = request.user.profile.main_character
logger.debug(f"Processing jabber broadcast for user {request.user} with main character {main_char}")
logger.debug(f"Processing Jabber broadcast for user {request.user} with main character {main_char}")
try:
if main_char is not None:
message_to_send = form.cleaned_data['message'] + "\n##### SENT BY: " + "[" + main_char.corporation_ticker + "]" + \
@@ -112,8 +112,8 @@ def jabber_broadcast_view(request):
OpenfireManager.send_broadcast_message(group_to_send, message_to_send)
messages.success(request, _('Sent jabber broadcast to %s' % group_to_send))
logger.info("Sent jabber broadcast on behalf of user %s" % request.user)
messages.success(request, _('Sent Jabber broadcast to %s' % group_to_send))
logger.info("Sent Jabber broadcast on behalf of user %s" % request.user)
except PingBotException as e:
messages.error(request, e)
@@ -140,11 +140,11 @@ def set_jabber_password(request):
logger.debug("Form contains password of length %s" % len(password))
result = OpenfireManager.update_user_pass(request.user.openfire.username, password=password)
if result != "":
logger.info("Successfully set jabber password for user %s" % request.user)
logger.info("Successfully set Jabber password for user %s" % request.user)
messages.success(request, _('Set jabber password.'))
else:
logger.error("Failed to install custom jabber password for user %s" % request.user)
messages.error(request, _('An error occurred while processing your jabber account.'))
logger.error("Failed to install custom Jabber password for user %s" % request.user)
messages.error(request, _('An error occurred while processing your Jabber account.'))
return redirect("services:services")
else:
logger.debug("Request is not type POST - providing empty form.")

View File

@@ -24,7 +24,7 @@ def activate_smf(request):
main_character = request.user.profile.main_character
logger.debug(
f"Adding smf user for user {request.user} with main character {main_character}"
f"Adding SMF user for user {request.user} with main character {main_character}"
)
result = SmfManager.add_user(
@@ -42,12 +42,12 @@ def activate_smf(request):
logger.debug(
f"Updated authserviceinfo for user {request.user} "
f"with smf credentials. Updating groups."
f"with SMF credentials. Updating groups."
)
SmfTasks.update_groups.delay(request.user.pk)
logger.info(f"Successfully activated smf for user {request.user}")
logger.info(f"Successfully activated SMF for user {request.user}")
messages.success(request, _('Activated SMF account.'))
credentials = {
@@ -61,7 +61,7 @@ def activate_smf(request):
context={'credentials': credentials, 'service': 'SMF'},
)
logger.error(f"Unsuccessful attempt to activate smf for user {request.user}")
logger.error(f"Unsuccessful attempt to activate SMF for user {request.user}")
messages.error(request, _('An error occurred while processing your SMF account.'))
return redirect("services:services")
@@ -74,10 +74,10 @@ def deactivate_smf(request):
result = SmfTasks.delete_user(request.user)
# false we failed
if result:
logger.info("Successfully deactivated smf for user %s" % request.user)
logger.info("Successfully deactivated SMF for user %s" % request.user)
messages.success(request, _('Deactivated SMF account.'))
else:
logger.error("Unsuccessful attempt to activate smf for user %s" % request.user)
logger.error("Unsuccessful attempt to activate SMF for user %s" % request.user)
messages.error(request, _('An error occurred while processing your SMF account.'))
return redirect("services:services")
@@ -91,14 +91,14 @@ def reset_smf_password(request):
result = SmfManager.update_user_password(request.user.smf.username, character.character_id)
# false we failed
if result != "":
logger.info("Successfully reset smf password for user %s" % request.user)
logger.info("Successfully reset SMF password for user %s" % request.user)
messages.success(request, _('Reset SMF password.'))
credentials = {
'username': request.user.smf.username,
'password': result,
}
return render(request, 'services/service_credentials.html', context={'credentials': credentials, 'service': 'SMF'})
logger.error("Unsuccessful attempt to reset smf password for user %s" % request.user)
logger.error("Unsuccessful attempt to reset SMF password for user %s" % request.user)
messages.error(request, _('An error occurred while processing your SMF account.'))
return redirect("services:services")
@@ -117,10 +117,10 @@ def set_smf_password(request):
logger.debug("Form contains password of length %s" % len(password))
result = SmfManager.update_user_password(request.user.smf.username, character.character_id, password=password)
if result != "":
logger.info("Successfully set smf password for user %s" % request.user)
logger.info("Successfully set SMF password for user %s" % request.user)
messages.success(request, _('Set SMF password.'))
else:
logger.error("Failed to install custom smf password for user %s" % request.user)
logger.error("Failed to install custom SMF password for user %s" % request.user)
messages.error(request, _('An error occurred while processing your SMF account.'))
return redirect("services:services")
else:

View File

@@ -5,7 +5,7 @@
{{ block.super }}
<li>
<a href="{% url 'teamspeak3:admin_update_ts3_groups' %}" class="btn btn-high">
{% translate "Update TS3 groups" %}
{% translate "Update TeamSpeak3 groups" %}
</a>
</li>
{% endblock %}

View File

@@ -10,11 +10,11 @@
{% endblock %}
{% block active %}
<span class="badge {% if authinfo.teamspeak3_uid != '' %}bg-success{% else %}bg-warning{% endif %}">{% if authinfo.teamspeak3_uid != '' %}Active{% else %}Disabled{% endif %}</span>
{% include "services/service_status.html" with username=authinfo.teamspeak3_uid %}
{% endblock %}
{% block user %}
{{ authinfo.teamspeak3_uid }}
{% include "services/service_username.html" with username=authinfo.teamspeak3_uid %}
{% endblock %}
{% block controls %}

View File

@@ -1,20 +1,20 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% extends "allianceauth/base-bs5.html" %}
{% load django_bootstrap5 %}
{% load i18n %}
{% block page_title %}{% translate "Verify Teamspeak" %}{% endblock page_title %}
{% block page_title %}{% translate "Verify TeamSpeak3" %}{% endblock page_title %}
{% block extra_css %}{% endblock extra_css %}
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">{% translate "Verify Teamspeak Identity" %}</h1>
<h1 class="page-header text-center">{% translate "Verify TeamSpeak3 Identity" %}</h1>
<div class="container-fluid">
<div class="col-md-4 col-md-offset-4">
<a href="ts3server://{{ public_url }}?token={{ authinfo.teamspeak3_perm_key }}&nickname={{ authinfo.teamspeak3_uid }}" class="btn btn-primary btn-block btn-lg" title="Join">{% translate "Join Server" %}</a>
<br>
<form class="form-signin" role="form" action="{% url 'teamspeak3:verify' %}" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
{% bootstrap_form form %}
<br>
<button class="btn btn-lg btn-primary btn-block" type="submit">{% translate "Continue" %}</button>
</form>

View File

@@ -24,17 +24,17 @@ def activate_teamspeak3(request):
character = request.user.profile.main_character
with Teamspeak3Manager() as ts3man:
logger.debug(f"Adding TS3 user for user {request.user} with main character {character}")
logger.debug(f"Adding TeamSpeak3 user for user {request.user} with main character {character}")
result = ts3man.add_user(request.user, Teamspeak3Tasks.get_username(request.user))
# if its empty we failed
if result[0] != "":
Teamspeak3User.objects.update_or_create(user=request.user, defaults={'uid': result[0], 'perm_key': result[1]})
logger.debug("Updated authserviceinfo for user %s with TS3 credentials. Updating groups." % request.user)
logger.info("Successfully activated TS3 for user %s" % request.user)
logger.debug("Updated authserviceinfo for user %s with TeamSpeak3 credentials. Updating groups." % request.user)
logger.info("Successfully activated TeamSpeak3 for user %s" % request.user)
messages.success(request, _('Activated TeamSpeak3 account.'))
return redirect("teamspeak3:verify")
logger.error("Unsuccessful attempt to activate TS3 for user %s" % request.user)
logger.error("Unsuccessful attempt to activate TeamSpeak3 for user %s" % request.user)
messages.error(request, _('An error occurred while processing your TeamSpeak3 account.'))
return redirect("services:services")
@@ -67,10 +67,10 @@ def verify_teamspeak3(request):
def deactivate_teamspeak3(request):
logger.debug("deactivate_teamspeak3 called by user %s" % request.user)
if Teamspeak3Tasks.has_account(request.user) and Teamspeak3Tasks.delete_user(request.user):
logger.info("Successfully deactivated TS3 for user %s" % request.user)
logger.info("Successfully deactivated TeamSpeak3 for user %s" % request.user)
messages.success(request, _('Deactivated TeamSpeak3 account.'))
else:
logger.error("Unsuccessful attempt to deactivate TS3 for user %s" % request.user)
logger.error("Unsuccessful attempt to deactivate TeamSpeak3 for user %s" % request.user)
messages.error(request, _('An error occurred while processing your TeamSpeak3 account.'))
return redirect("services:services")
@@ -81,7 +81,7 @@ def reset_teamspeak3_perm(request):
logger.debug("reset_teamspeak3_perm called by user %s" % request.user)
if not Teamspeak3Tasks.has_account(request.user):
return redirect("services:services")
logger.debug("Deleting TS3 user for user %s" % request.user)
logger.debug("Deleting TeamSpeak3 user for user %s" % request.user)
with Teamspeak3Manager() as ts3man:
ts3man.delete_user(request.user.teamspeak3.uid)
@@ -91,12 +91,12 @@ def reset_teamspeak3_perm(request):
# if blank we failed
if result[0] != "":
Teamspeak3User.objects.update_or_create(user=request.user, defaults={'uid': result[0], 'perm_key': result[1]})
logger.debug("Updated authserviceinfo for user %s with TS3 credentials. Updating groups." % request.user)
logger.debug("Updated authserviceinfo for user %s with TeamSpeak3 credentials. Updating groups." % request.user)
Teamspeak3Tasks.update_groups.delay(request.user.pk)
logger.info("Successfully reset TS3 permission key for user %s" % request.user)
logger.info("Successfully reset TeamSpeak3 permission key for user %s" % request.user)
messages.success(request, _('Reset TeamSpeak3 permission key.'))
else:
logger.error("Unsuccessful attempt to reset TS3 permission key for user %s" % request.user)
logger.error("Unsuccessful attempt to reset TeamSpeak3 permission key for user %s" % request.user)
messages.error(request, _('An error occurred while processing your TeamSpeak3 account.'))
return redirect("services:services")
@@ -105,5 +105,5 @@ def reset_teamspeak3_perm(request):
@staff_member_required
def admin_update_ts3_groups(request):
Teamspeak3Tasks.run_ts3_group_update.delay()
messages.info(request, "Started updating TS3 server groups...")
messages.info(request, "Started updating TeamSpeak3 server groups...")
return redirect("admin:teamspeak3_authts_changelist")

View File

@@ -36,7 +36,7 @@ def activate_xenforo_forum(request):
context={'credentials': credentials, 'service': 'XenForo'})
else:
logger.error("Unsuccessful attempt to activate xenforo for user %s" % request.user)
logger.error("Unsuccessful attempt to activate XenForo for user %s" % request.user)
messages.error(request, _('An error occurred while processing your XenForo account.'))
return redirect("services:services")

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base-bs5.html" %}
{% load bootstrap %}
{% load django_bootstrap5 %}
{% load i18n %}
{% block page_title %}{% translate "Fleet Formatter Tool" %}{% endblock page_title %}
@@ -18,7 +18,7 @@
{% endif %}
<form class="form-signin" role="form" action="" method="POST">
{% csrf_token %}
{{ form|bootstrap }}
{% bootstrap_form form %}
<br>
<button class="btn btn-lg btn-primary btn-block" type="submit">{% translate "Format" %}</button>
<br>

View File

@@ -1,4 +1,4 @@
{% extends "allianceauth/base.html" %}
{% extends "allianceauth/base-bs5.html" %}
{% load i18n %}
@@ -11,9 +11,9 @@
<h1 class="page-header text-center">
{% blocktranslate with service_name=view.service_name|title %}Delete {{ service_name }} Account?{% endblocktranslate %}
</h1>
<div class="container-fluid">
<div class="col-md-2 col-md-offset-5">
<div class="row">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-4 align-self-center">
<form action="" method="post">
{% csrf_token %}
<p>

View File

@@ -1,4 +1,4 @@
{% extends "allianceauth/base.html" %}
{% extends "allianceauth/base-bs5.html" %}
{% load i18n %}
{% block page_title %}{% blocktranslate with service_name=view.service_name|title %}{{ service_name }} Credentials{% endblocktranslate %}{% endblock page_title %}
@@ -6,17 +6,19 @@
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">{% blocktranslate with service_name=view.service_name|title %}{{ service_name }} Credentials{% endblocktranslate %}</h1>
<div class="container-fluid">
<div class="col-lg-4 col-lg-offset-4">
<form class="form-signin">
{% for key, value in credentials.items %}
<div class="form-group">
<label class="control-label" for="id_{{ key }}">{{ key|capfirst }}</label>
<input class="form-control" value="{{ value }}" id="id_{{ key }}" readonly>
</div>
{% endfor %}
</form>
<a href="{% url 'services:services' %}" class="btn btn-lg btn-block btn-primary" title="Continue">{% translate "Continue" %}</a>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-4 align-self-center">
<form class="form-signin">
{% for key, value in credentials.items %}
<div class="mb-3">
<label class="form-label" for="id_{{ key }}">{{ key|capfirst }}</label>
<input class="form-control" value="{{ value }}" id="id_{{ key }}" readonly>
</div>
{% endfor %}
</form>
<a href="{% url 'services:services' %}" class="btn btn-lg btn-block btn-primary" title="Continue">{% translate "Continue" %}</a>
</div>
</div>
</div>
</div>

View File

@@ -1,5 +1,5 @@
{% extends "allianceauth/base.html" %}
{% load bootstrap %}
{% extends "allianceauth/base-bs5.html" %}
{% load django_bootstrap5 %}
{% load i18n %}
{% block page_title %}{% blocktranslate with service_name=view.service_name|title %}{{ service_name }} Password Change{% endblocktranslate %}{% endblock page_title %}
@@ -7,12 +7,12 @@
{% block content %}
<div class="col-lg-12">
<h1 class="page-header text-center">{% blocktranslate with service_name=view.service_name|title %}Set {{service_name}} Password{% endblocktranslate %}</h1>
<div class="container-fluid">
<div class="col-md-4 col-md-offset-4">
<div class="row">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-4 align-self-center">
<form class="form-signin" role="form" action="" method="POST" onsubmit="submitbutton.disabled = true; return true;">
{% csrf_token %}
{{ form|bootstrap }}
{% bootstrap_form form %}
<br>
<button class="btn btn-lg btn-primary btn-block" name="submitbutton" type="submit">{% translate "Set Password" %}</button>
</form>
@@ -20,5 +20,4 @@
</div>
</div>
</div>
{% endblock content %}

View File

@@ -0,0 +1,9 @@
{% load i18n %}
<span class="badge {% if username != '' %}bg-success{% else %}bg-warning{% endif %}">
{% if username != '' %}
{% translate "Enabled" %}
{% else %}
{% translate "Disabled" %}
{% endif %}
</span>

View File

@@ -0,0 +1,5 @@
{% load i18n %}
{% if username != '' %}
{% translate "Username" %}: {{ username }}
{% endif %}

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

@@ -9,14 +9,6 @@
<a href="{{ service_url }}">{{ service_url }}</a>
{% endblock %}
{% block active %}
<span class="badge {% if username != '' %}bg-success{% else %}bg-warning{% endif %}">{% if username != '' %}Active{% else %}Disabled{% endif %}</span>
{% endblock %}
{% block user %}
Username: <span class="badge bg-secondary">{{ username }}</span>
{% endblock %}
{% block controls %}
{% if username == "" %}
{% if urls.auth_activate %}

View File

@@ -1,15 +1,29 @@
{% load i18n %}
<div class="card text-center m-4" style="min-width: 18rem; min-height: 18rem">
<div class="card text-center m-4" style="min-width: 18rem; min-height: 18rem;">
<div class="card-body">
<h5 class="card-title">{% block title %}{% endblock title %}</h5>
<p class="card-text">{% block url %}{% endblock url %}</p>
<p class="card-text">
{% block active %}
<span class="badge bg-success">Active</span>
{% include "services/service_status.html" with username=username %}
{% endblock active %}
</p>
<p class="card-text">{% block user %}{% endblock user %}</p>
<p class="card-text">
{% block url %}{% endblock url %}
</p>
<p class="card-text">
{% block user %}
{% include "services/service_username.html" with username=username %}
{% endblock user %}
</p>
{% block extra %}{% endblock extra %}
</div>
<div class="card-footer">{% block controls %}{% endblock controls %}</div>
<div class="card-footer">
{% block controls %}{% endblock controls %}
</div>
</div>

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

@@ -0,0 +1,81 @@
/* global notificationUpdateSettings */
/**
* This script refreshed the notification icon in the top menu
* on a regular basis so to keep the user apprised about newly arrived
* notifications without having to reload the page.
*
* The refresh rate can be changes via the Django setting NOTIFICATIONS_REFRESH_TIME.
* See documentation for details.
*/
$(() => {
'use strict';
const notificationsRefreshTime = notificationUpdateSettings.refreshTime;
const userNotificationsCountViewUrl = notificationUpdateSettings.userNotificationsCountViewUrl;
const elementNotificationIcon = $('#menu_item_notifications .fa-bell');
/**
* Update the notification icon in the top menu
*/
const updateNotificationIcon = () => {
fetch(userNotificationsCountViewUrl)
.then((response) => {
if (response.ok) {
return response.json();
}
throw new Error('Something went wrong');
})
.then((responseJson) => {
const unreadCount = responseJson.unread_count;
if (unreadCount > 0) {
elementNotificationIcon.addClass('text-danger');
} else {
elementNotificationIcon.removeClass('text-danger');
}
})
.catch((error) => {
console.log(`Failed to load HTMl to render notifications item. Error: ${error.message}`);
});
};
let myInterval;
/**
* Activate automatic refresh every x seconds
*/
const activateIconUpdate = () => {
if (notificationsRefreshTime > 0) {
myInterval = setInterval(
updateNotificationIcon, notificationsRefreshTime * 1000
);
}
};
/**
* Deactivate automatic refresh
*/
const deactivateIconUpdate = () => {
if ((notificationsRefreshTime > 0) && (typeof myInterval !== 'undefined')) {
clearInterval(myInterval);
}
};
/**
* Refresh only on active browser tabs
*/
$(window)
// Tab active
.focus(() => {
activateIconUpdate();
})
// Tab inactive
.blur(function() {
deactivateIconUpdate();
});
// Initial start of refreshing on script loading
activateIconUpdate();
});

View File

@@ -1,28 +1,28 @@
$(document).ready(() => {
'use strict';
const inputAbsoluteTime = $('input#id_absolute_time');
const inputCountdown = $('#id_days_left, #id_hours_left, #id_minutes_left');
//inputAbsoluteTime.prop('disabled', true);
inputAbsoluteTime.parent().hide()
inputAbsoluteTime.parent().prev('label').hide()
inputAbsoluteTime.parent().hide();
inputAbsoluteTime.parent().prev('label').hide();
inputCountdown.prop('required', true);
$('input#id_absolute_checkbox').change(function () {
if ($(this).prop("checked")) {
// check box enabled
inputAbsoluteTime.parent().show()
inputAbsoluteTime.parent().prev('label').show()
inputCountdown.parent().hide()
inputCountdown.parent().prev('label').hide()
$('input#id_absolute_checkbox').change((event) => {
if ($(event.target).prop('checked')) {
// Checkbox is checked
inputAbsoluteTime.parent().show();
inputAbsoluteTime.parent().prev('label').show();
inputCountdown.parent().hide();
inputCountdown.parent().prev('label').hide();
inputAbsoluteTime.prop('required', true);
inputCountdown.prop('required', false);
} else {
// Checkbox is not checked
inputAbsoluteTime.parent().hide()
inputAbsoluteTime.parent().prev('label').hide()
inputCountdown.parent().show()
inputCountdown.parent().prev('label').show()
inputAbsoluteTime.parent().hide();
inputAbsoluteTime.parent().prev('label').hide();
inputCountdown.parent().show();
inputCountdown.parent().prev('label').show();
inputAbsoluteTime.prop('required', false);
inputCountdown.prop('required', true);
}

View File

@@ -2,7 +2,7 @@
{% load admin_status %}
<div
class="progress-bar progress-bar-{{ level }} task-status-progress-bar"
class="progress-bar bg-{{ level }} task-status-progress-bar"
role="progressbar"
aria-valuenow="{% decimal_widthratio tasks_count tasks_total 100 %}"
aria-valuemin="0"

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,94 @@
{% 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>
const notificationUpdateSettings = {
refreshTime: "{% notifications_refresh_time %}",
userNotificationsCountViewUrl: "{% url 'notifications:user_notifications_count' request.user.pk %}"
};
</script>
{% include 'bundles/refresh-notification-icon-js.html' %}
{% 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

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

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

@@ -0,0 +1,3 @@
{% load static %}
<script src="{% static 'allianceauth/js/refresh-notification-icon.js' %}"></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

@@ -13,8 +13,9 @@ from django.template.loader import render_to_string
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from .form import TimerForm
from .models import Timer
from allianceauth.timerboard.form import TimerForm
from allianceauth.timerboard.models import Timer
from allianceauth.eveonline.models import EveCorporationInfo
logger = logging.getLogger(__name__)
@@ -67,6 +68,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 +80,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,16 +88,22 @@ class EditTimerView(TimerManagementView, AddUpdateMixin, UpdateView):
class RemoveTimerView(TimerManagementView, DeleteView):
pass
form_class = TimerForm
def dashboard_timers(request):
corp = request.user.profile.main_character.corporation
try:
corp = request.user.profile.main_character.corporation
except EveCorporationInfo.DoesNotExist:
return ""
timers = Timer.objects.select_related('eve_character').filter((Q(eve_corp__isnull=True) | Q(eve_corp=corp)) ,eve_time__gte=timezone.now())[:5]
if timers.count():
context = {
'timers': timers,
}
return render_to_string('timerboard/dashboard.timers.html', context=context, request=request)
return render_to_string(template_name='timerboard/dashboard.timers.html', context=context, request=request)
else:
return ""

View File

@@ -1,9 +1,12 @@
from django.views.generic.base import View
from django.http import HttpResponseRedirect
from django.shortcuts import render, redirect
from django.contrib import messages
from django.conf import settings
import logging
import warnings
from django.conf import settings
from django.contrib import messages
from django.http import HttpResponseRedirect
from django.shortcuts import redirect, render
from django.utils.translation import gettext_lazy as _
from django.views.generic.base import View
logger = logging.getLogger(__name__)
@@ -33,6 +36,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 +44,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.0a4
# 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.0a4
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
```

Some files were not shown because too many files have changed in this diff Show More