schon/evibes/settings/unfold.py
Egor fureunoir Gorbunov 376c73ba26 Features: 1) Add tab support for inline admin classes; 2) Introduce new settings for taskboard URL and support contact;
Fixes: 1) Remove redundant imports from admin.py;

Extra: 1) Update inline classes to inherit from TabularInline; 2) Add unfold.contrib modules to INSTALLED_APPS; 3) Reorder imports in admin.py for consistency.
2025-11-15 02:29:23 +03:00

114 lines
3.6 KiB
Python

from django.templatetags.static import static
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
from evibes.settings.base import PROJECT_NAME, SUPPORT_CONTACT, TASKBOARD_URL
UNFOLD = {
"SITE_TITLE": f"{PROJECT_NAME} Dashboard",
"SITE_HEADER": PROJECT_NAME,
"SITE_LOGO": "logo.png",
"SITE_ICON": "favicon.ico",
"SHOW_LANGUAGES": True,
"LOGIN": {
"image": lambda request: static("logo.png"),
},
"COMMAND": {
"search_models": True,
"show_history": True,
},
"EXTENSIONS": {
"modeltranslation": {
"flags": {
"ar-ar": "🇸🇦",
"cs-cz": "🇨🇿",
"da-dk": "🇩🇰",
"de-de": "🇩🇪",
"en-gb": "🇬🇧",
"en-us": "🇺🇸",
"es-es": "🇪🇸",
"fa-ir": "🇮🇷",
"fr-fr": "🇫🇷",
"he-il": "🇮🇱",
"hi-in": "🇮🇳",
"hr-hr": "🇭🇷",
"id-id": "🇮🇩",
"it-it": "🇮🇹",
"ja-jp": "🇯🇵",
"kk-kz": "🇰🇿",
"ko-kr": "🇰🇷",
"nl-nl": "🇳🇱",
"no-no": "🇳🇴",
"pl-pl": "🇵🇱",
"pt-br": "🇧🇷",
"ro-ro": "🇷🇴",
"ru-ru": "🇷🇺",
"sv-se": "🇸🇪",
"th-th": "🇹🇭",
"tr-tr": "🇹🇷",
"vi-vn": "🇻🇳",
"zh-hans": "🇨🇳",
},
},
},
"SIDEBAR": {
"show_search": True,
"navigation": [
{
"title": _("Menu"),
"separator": True,
"collapsible": True,
"items": [
{
"title": _("Dashboard"),
"icon": "dashboard",
"link": reverse_lazy("admin:index"),
},
{
"title": _("Health"),
"icon": "health_metrics",
"link": reverse_lazy("health_check:health_check_home"),
},
{
"title": _("Swagger"),
"icon": "integration_instructions",
"link": reverse_lazy("swagger-ui-platform"),
},
{
"title": _("Redoc"),
"icon": "integration_instructions",
"link": reverse_lazy("redoc-ui-platform"),
},
{
"title": _("GraphQL"),
"icon": "graph_5",
"link": reverse_lazy("graphql-platform"),
},
{
"title": _("Taskboard"),
"icon": "view_kanban",
"link": TASKBOARD_URL,
},
{
"title": _("Support"),
"icon": "contact_support",
"link": SUPPORT_CONTACT,
},
],
},
],
},
"TABS": [
{
"models": [
"core.product",
],
"items": [
{
"title": _("Your custom title"),
"link": reverse_lazy("admin:core_product_changelist"),
},
],
},
],
}