diff --git a/app/apps/accounts/migrations/0006_erasure_request.py b/app/apps/accounts/migrations/0006_erasure_request.py index 2e69f04..523befd 100644 --- a/app/apps/accounts/migrations/0006_erasure_request.py +++ b/app/apps/accounts/migrations/0006_erasure_request.py @@ -70,6 +70,6 @@ class Migration(migrations.Migration): ), migrations.AddIndex( model_name="erasurerequest", - index=models.Index(fields=["user", "status"], name="accounts_erasure_user_status_idx"), + index=models.Index(fields=["user", "status"], name="accounts_er_user_status_idx"), ), ] diff --git a/app/apps/accounts/models.py b/app/apps/accounts/models.py index 4df62d9..4aae593 100644 --- a/app/apps/accounts/models.py +++ b/app/apps/accounts/models.py @@ -45,7 +45,7 @@ class ErasureRequest(models.Model): ordering = ["-requested_at"] indexes = [ models.Index(fields=["status", "requested_at"], name="accounts_erasure_status_idx"), - models.Index(fields=["user", "status"], name="accounts_erasure_user_status_idx"), + models.Index(fields=["user", "status"], name="accounts_er_user_status_idx"), ] def __str__(self) -> str: diff --git a/app/keywarden/settings/base.py b/app/keywarden/settings/base.py index 9ffcae5..711b5fd 100644 --- a/app/keywarden/settings/base.py +++ b/app/keywarden/settings/base.py @@ -3,6 +3,7 @@ from pathlib import Path from dotenv import load_dotenv from django.urls import reverse_lazy +from django.templatetags.static import static from django.utils.translation import gettext_lazy as _ load_dotenv() @@ -46,7 +47,8 @@ INSTALLED_APPS = [ "ninja", # Django Ninja API "mozilla_django_oidc", # OIDC Client "tailwind", - "theme" + "theme", + "keywarden" ] MIDDLEWARE = [ @@ -141,8 +143,25 @@ TEMPLATES = [ # AUTHENTICATION_BACKENDS is configured dynamically below based on KEYWARDEN_AUTH_MODE UNFOLD = { - "SITE_TITLE": "Keywarden Admin", + "SITE_ICON": lambda request: static("branding/keywarden-favicon.svg"), + "SITE_LOGO": lambda request: static("branding/keywarden-favicon.svg"), + "SITE_TITLE": "Admin - Keywarden", "SITE_HEADER": "Keywarden", + "SITE_FAVICONS": [ + { + "rel": "icon", + "sizes": "32x32", + "type": "image/svg+xml", + "href": lambda request: static("branding/keywarden-favicon.svg"), + }, + ], + "SITE_DROPDOWN": [ + { + "icon": "diamond", + "title": _("Gitea"), + "link": "https://git.ntbx.io/boris/keywarden", + }, + ], "SHOW_HISTORY": True, "SITE_URL": "/", "LOGIN_REDIRECT_URL": "/admin/", @@ -170,39 +189,39 @@ UNFOLD = { "STYLES": [ "/static/unfold/css/styles.css", "/static/unfold/css/simplebar.css", - (lambda request: "/static/unfold/css/keywarden.css"), + #(lambda request: "/static/unfold/css/keywarden.css"), ], - "TABS": [ - { - "models": [ - "auth.User", - ], - "items": [ - { - "title": _("Logs"), - "link": reverse_lazy("admin:audit_auditlog_changelist"), - "attrs": {"hx-boost": "true"}, - }, - { - "title": _("Event Types"), - "link": reverse_lazy("admin:audit_auditeventtype_changelist"), - "attrs": {"hx-boost": "true"}, - }, - ], - }, - { - "models": [ - "servers.Server", - ], - "items": [ - { - "title": _("Servers"), - "link": reverse_lazy("admin:servers_server_changelist"), - "attrs": {"hx-boost": "true"}, - }, - ], - }, - ], + # "TABS": [ + # { + # "models": [ + # "auth.User", + # ], + # "items": [ + # { + # "title": _("Logs"), + # "link": reverse_lazy("admin:audit_auditlog_changelist"), + # "attrs": {"hx-boost": "true"}, + # }, + # { + # "title": _("Event Types"), + # "link": reverse_lazy("admin:audit_auditeventtype_changelist"), + # "attrs": {"hx-boost": "true"}, + # }, + # ], + # }, + # { + # "models": [ + # "servers.Server", + # ], + # "items": [ + # { + # "title": _("Servers"), + # "link": reverse_lazy("admin:servers_server_changelist"), + # "attrs": {"hx-boost": "true"}, + # }, + # ], + # }, + # ], } MEDIA_URL = "/media/" MEDIA_ROOT = BASE_DIR/"media" diff --git a/app/static/branding/keywarden-favicon.svg b/app/static/branding/keywarden-favicon.svg new file mode 100644 index 0000000..87fd7ab --- /dev/null +++ b/app/static/branding/keywarden-favicon.svg @@ -0,0 +1,27 @@ + diff --git a/app/templates/base.html b/app/templates/base.html index 4fefd9a..ca631c4 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -6,16 +6,21 @@