Compare commits

..

1 Commits

Author SHA1 Message Date
T'rahk Rokym
ea321c1e97 Merge branch 'timerboard-skyhooks' into 'master'
Add a new `theft` timer type for skyhooks

See merge request allianceauth/allianceauth!1708
2025-03-26 21:11:55 +00:00
43 changed files with 33 additions and 154 deletions

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class AnalyticsConfig(AppConfig):
name = 'allianceauth.analytics'
label = 'analytics'
verbose_name = _('Analytics')

View File

@ -1,12 +1,10 @@
from django.apps import AppConfig
from django.core.checks import register, Tags
from django.utils.translation import gettext_lazy as _
class AuthenticationConfig(AppConfig):
name = "allianceauth.authentication"
label = "authentication"
verbose_name = _("Authentication")
def ready(self):
from allianceauth.authentication import checks, signals # noqa: F401

View File

@ -1,5 +1,4 @@
import logging
from typing import ClassVar
from django.contrib.auth.models import User, Permission
from django.db import models, transaction
@ -28,7 +27,7 @@ class State(models.Model):
help_text="Factions to whose members this state is available.")
public = models.BooleanField(default=False, help_text="Make this state available to any character.")
objects: ClassVar[StateManager] = StateManager()
objects = StateManager()
class Meta:
ordering = ['-priority']
@ -138,10 +137,8 @@ class UserProfile(models.Model):
sender=self.__class__, user=self.user, state=self.state
)
def __str__(self) -> str:
def __str__(self):
return str(self.user)
class CharacterOwnership(models.Model):
class Meta:
default_permissions = ('change', 'delete')
@ -151,7 +148,7 @@ class CharacterOwnership(models.Model):
owner_hash = models.CharField(max_length=28, unique=True)
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='character_ownerships')
objects: ClassVar[CharacterOwnershipManager] = CharacterOwnershipManager()
objects = CharacterOwnershipManager()
def __str__(self):
return f"{self.user}: {self.character}"

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class CorpUtilsConfig(AppConfig):
name = 'allianceauth.corputils'
label = 'corputils'
verbose_name = _('Corporation Stats')

View File

@ -1,6 +1,5 @@
import logging
import os
from typing import ClassVar
from allianceauth.authentication.models import CharacterOwnership, UserProfile
from bravado.exception import HTTPForbidden
@ -41,9 +40,9 @@ class CorpStats(models.Model):
verbose_name = "corp stats"
verbose_name_plural = "corp stats"
objects: ClassVar[CorpStatsManager] = CorpStatsManager()
objects = CorpStatsManager()
def __str__(self) -> str:
def __str__(self):
return f"{self.__class__.__name__} for {self.corp}"
def update(self):

View File

@ -3,7 +3,6 @@ Crontab App Config
"""
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class CrontabConfig(AppConfig):
@ -13,4 +12,3 @@ class CrontabConfig(AppConfig):
name = "allianceauth.crontab"
label = "crontab"
verbose_name = _("Crontab")

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class EveonlineConfig(AppConfig):
name = 'allianceauth.eveonline'
label = 'eveonline'
verbose_name = _('EVE Online')

View File

@ -1,11 +1,9 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class EveAutogroupsConfig(AppConfig):
name = 'allianceauth.eveonline.autogroups'
label = 'eve_autogroups'
verbose_name = _('EVE Online Autogroups')
def ready(self):
import allianceauth.eveonline.autogroups.signals

View File

@ -1,5 +1,4 @@
import logging
from typing import ClassVar
from django.db import models, transaction
from django.contrib.auth.models import Group, User
from django.core.exceptions import ObjectDoesNotExist
@ -79,7 +78,7 @@ class AutogroupsConfig(models.Model):
max_length=10, default='', blank=True,
help_text='Any spaces in the group name will be replaced with this.')
objects: ClassVar[AutogroupsConfigManager] = AutogroupsConfigManager()
objects = AutogroupsConfigManager()
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

View File

@ -14,10 +14,10 @@ class EveCharacterProviderManager:
class EveCharacterManager(models.Manager):
provider = EveCharacterProviderManager()
def create_character(self, character_id) -> models.Model:
def create_character(self, character_id):
return self.create_character_obj(self.provider.get_character(character_id))
def create_character_obj(self, character: providers.Character) -> models.Model:
def create_character_obj(self, character: providers.Character):
return self.create(
character_id=character.id,
character_name=character.name,

View File

@ -1,5 +1,5 @@
import logging
from typing import ClassVar, Union
from typing import Union
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
@ -75,8 +75,8 @@ class EveAllianceInfo(models.Model):
alliance_ticker = models.CharField(max_length=254)
executor_corp_id = models.PositiveIntegerField()
objects: ClassVar[EveAllianceManager] = EveAllianceManager()
provider: ClassVar[EveAllianceProviderManager] = EveAllianceProviderManager()
objects = EveAllianceManager()
provider = EveAllianceProviderManager()
class Meta:
indexes = [models.Index(fields=['executor_corp_id',])]
@ -147,7 +147,7 @@ class EveCorporationInfo(models.Model):
EveAllianceInfo, blank=True, null=True, on_delete=models.SET_NULL
)
objects: ClassVar[EveCorporationManager] = EveCorporationManager()
objects = EveCorporationManager()
provider = EveCorporationProviderManager()
class Meta:
@ -214,7 +214,7 @@ class EveCharacter(models.Model):
faction_id = models.PositiveIntegerField(blank=True, null=True, default=None)
faction_name = models.CharField(max_length=254, blank=True, null=True, default='')
objects: ClassVar[EveCharacterManager] = EveCharacterManager()
objects = EveCharacterManager()
provider = EveCharacterProviderManager()
class Meta:

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class FatConfig(AppConfig):
name = 'allianceauth.fleetactivitytracking'
label = 'fleetactivitytracking'
verbose_name = _('Fleet Activity Tracking')

View File

@ -3,7 +3,6 @@ Framework App Config
"""
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class FrameworkConfig(AppConfig):
@ -13,4 +12,3 @@ class FrameworkConfig(AppConfig):
name = "allianceauth.framework"
label = "framework"
verbose_name = _("Framework")

View File

@ -5,24 +5,6 @@
* to be used throughout Alliance Auth and its Community Apps
*/
/* General
------------------------------------------------------------------------------------- */
@media all {
.navbar-toggler.collapsed {
transform: rotate(180deg);
}
ul#nav-right:has(li) + ul#nav-right-character-control > li:first-child {
display: list-item !important;
}
}
@media all and (max-width: 991px) {
ul#nav-left:has(li) + ul#nav-right + ul#nav-right-character-control > li:first-child {
display: list-item !important;
}
}
/* Bootstrap fixes
------------------------------------------------------------------------------------- */
@media all {

View File

@ -1,11 +1,10 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class GroupManagementConfig(AppConfig):
name = 'allianceauth.groupmanagement'
label = 'groupmanagement'
verbose_name = _('Group Management')
verbose_name = 'Group Management'
def ready(self):
from . import signals # noqa: F401

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class HRApplicationsConfig(AppConfig):
name = 'allianceauth.hrapplications'
label = 'hrapplications'
verbose_name = _('HR Applications')

View File

@ -1,4 +1,3 @@
from typing import ClassVar
from django.contrib.auth.models import User
from django.db import models
from sortedm2m.fields import SortedManyToManyField
@ -41,7 +40,7 @@ class Application(models.Model):
reviewer_character = models.ForeignKey(EveCharacter, on_delete=models.SET_NULL, blank=True, null=True)
created = models.DateTimeField(auto_now_add=True)
objects: ClassVar[ApplicationManager] = ApplicationManager()
objects = ApplicationManager()
def __str__(self):
return str(self.user) + " Application To " + str(self.form)

View File

@ -1,7 +1,6 @@
import logging
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
logger = logging.getLogger(__name__)
@ -13,7 +12,6 @@ logger = logging.getLogger(__name__)
class MenuConfig(AppConfig):
name = "allianceauth.menu"
label = "menu"
verbose_name = _("Menu")
def ready(self):
from allianceauth.menu.core import smart_sync

View File

@ -1,4 +1,3 @@
from typing import ClassVar
from django.db import models
from django.utils.translation import gettext_lazy as _
@ -69,7 +68,7 @@ class MenuItem(models.Model):
help_text=_("External URL this menu items will link to"),
)
objects: ClassVar[MenuItemManager] = MenuItemManager()
objects = MenuItemManager()
def __str__(self) -> str:
return self.text

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class NotificationsConfig(AppConfig):
name = 'allianceauth.notifications'
label = 'notifications'
verbose_name = _('Notifications')

View File

@ -1,5 +1,4 @@
import logging
from typing import ClassVar
from django.db import models
from django.contrib.auth.models import User
@ -57,7 +56,7 @@ class Notification(models.Model):
timestamp = models.DateTimeField(auto_now_add=True, db_index=True)
viewed = models.BooleanField(default=False, db_index=True)
objects: ClassVar[NotificationManager] = NotificationManager()
objects = NotificationManager()
def __str__(self) -> str:
return f"{self.user}: {self.title}"

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class OptimerConfig(AppConfig):
name = 'allianceauth.optimer'
label = 'optimer'
verbose_name = _('Fleet Operations')

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class PermissionsToolConfig(AppConfig):
name = 'allianceauth.permissions_tool'
label = 'permissions_tool'
verbose_name = _('Permissions Audit')

View File

@ -61,7 +61,6 @@ CELERYBEAT_SCHEDULE = {
'esi_cleanup_token': {
'task': 'esi.tasks.cleanup_token',
'schedule': crontab(minute='0', hour='0'),
'apply_offset': True,
},
'run_model_update': {
'task': 'allianceauth.eveonline.tasks.run_model_update',

View File

@ -1,11 +1,9 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class ServicesConfig(AppConfig):
name = 'allianceauth.services'
label = 'services'
verbose_name = _('Services')
def ready(self):
from . import signals

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class DiscordServiceConfig(AppConfig):
name = 'allianceauth.services.modules.discord'
label = 'discord'
verbose_name = _('Discord Service')

View File

@ -1,5 +1,5 @@
import logging
from typing import ClassVar, Optional
from typing import Optional
from requests.exceptions import HTTPError
@ -59,7 +59,7 @@ class DiscordUser(models.Model):
help_text='Date & time this service account was activated'
)
objects: ClassVar[DiscordUserManager] = DiscordUserManager()
objects = DiscordUserManager()
class Meta:
permissions = (

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class DiscourseServiceConfig(AppConfig):
name = 'allianceauth.services.modules.discourse'
label = 'discourse'
verbose_name = _('Discourse Service')

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class ExampleServiceConfig(AppConfig):
name = 'allianceauth.services.modules.example'
label = 'example_service'
verbose_name = _('Example Service')

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class Ips4ServiceConfig(AppConfig):
name = 'allianceauth.services.modules.ips4'
label = 'ips4'
verbose_name = _('IPS4 Service')

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class MumbleServiceConfig(AppConfig):
name = 'allianceauth.services.modules.mumble'
label = 'mumble'
verbose_name = _('Mumble Service')

View File

@ -1,6 +1,5 @@
import random
import string
from typing import ClassVar
from passlib.hash import bcrypt_sha256
from django.db import models
@ -117,7 +116,7 @@ class MumbleUser(AbstractServiceModel):
help_text="Timestamp of the users Last Disconnection to Mumble"
)
objects: ClassVar[MumbleManager] = MumbleManager()
objects = MumbleManager()
def __str__(self):
return self.username

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class OpenfireServiceConfig(AppConfig):
name = 'allianceauth.services.modules.openfire'
label = 'openfire'
verbose_name = _('Openfire Service')

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class Phpbb3ServiceConfig(AppConfig):
name = 'allianceauth.services.modules.phpbb3'
label = 'phpbb3'
verbose_name = _('phpBB3 Service')

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class SmfServiceConfig(AppConfig):
name = 'allianceauth.services.modules.smf'
label = 'smf'
verbose_name = _('SMF Service')

View File

@ -1,11 +1,9 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class Teamspeak3ServiceConfig(AppConfig):
name = 'allianceauth.services.modules.teamspeak3'
label = 'teamspeak3'
verbose_name = _('TeamSpeak 3 Service')
def ready(self):
from . import signals

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class XenforoServiceConfig(AppConfig):
name = 'allianceauth.services.modules.xenforo'
label = 'xenforo'
verbose_name = _('Xenforo Service')

View File

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

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class SRPConfig(AppConfig):
name = 'allianceauth.srp'
label = 'srp'
verbose_name = _('Ship Replacement')

View File

@ -12,7 +12,11 @@
<ul class="list-group">
{% for notif in notifications %}
<li class="list-group-item">
<span class="badge bg-success me-2">{% translate "Open" %}</span>
{% if notif.state == 'opened' %}
<span class="badge bg-success me-2">{% translate "Open" %}</span>
{% else %}
<span class="badge bg-danger me-2">{% translate "Closed" %}</span>
{% endif %}
<a href="{{ notif.web_url }}" target="_blank">#{{ notif.iid }} {{ notif.title }}</a>
</li>
{% empty %}

View File

@ -24,11 +24,13 @@
{% include 'bundles/auth-framework-css.html' %}
<style>
@media all {
.nav-padding {
margin-top: {% header_padding_size %} !important;
max-height: calc(100vh - {% header_padding_size %}) !important;
}
.navbar-toggler.collapsed{
transform: rotate(180deg);
}
.nav-padding {
margin-top: {% header_padding_size %} !important;
max-height: calc(100vh - {% header_padding_size %}) !important;
}
</style>
@ -61,11 +63,6 @@
</ul>
<ul id="nav-right-character-control" class="nav navbar-nav">
<li class="nav-item ms-lg-2 py-2 py-lg-1 col-12 col-lg-auto d-none">
<div class="vr d-none d-lg-flex h-100 mx-2 text-white-50"></div>
<hr class="d-lg-none my-2 text-body text-white-50">
</li>
{% block header_nav_user_character_control %} <!-- Default to add char and swap main -->
{% include 'allianceauth/top-menu-rh-default.html' %}
{% endblock %}

View File

@ -67,26 +67,6 @@ def get_datatables_language_static(language: str) -> str:
return static_url
@register.simple_tag
def get_relative_datatables_language_path(language: str) -> str:
"""
Get the correct language code URL for DataTables (relative path to the static folder)
:param language: Django's language code
:type language: str
:return: Mapped language code
:rtype: str
"""
mapped_language = get_datatable_language_code(language)
static_url = (
f"allianceauth/libs/DataTables/Plugins/2.2.1/i18n/{mapped_language}.json"
if mapped_language
else ""
)
return static_url
@register.simple_tag
def get_momentjs_language_static(language: str) -> str:
@ -108,24 +88,3 @@ def get_momentjs_language_static(language: str) -> str:
)
return static_url
@register.simple_tag
def get_relative_momentjs_language_path(language: str) -> str:
"""
Get the correct language code URL for Moment.JS (relative path to the static folder)
:param language: Django's language code
:type language: str
:return: Mapped language code path
:rtype: str
"""
mapped_language = get_momentjs_language_code(language)
static_url = (
f"allianceauth/libs/moment.js/2.29.4/locale/{mapped_language}.js"
if mapped_language
else ""
)
return static_url

View File

@ -1,8 +1,6 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class TimerBoardConfig(AppConfig):
name = 'allianceauth.timerboard'
label = 'timerboard'
verbose_name = _('Structure Timers')