schon/schon/settings/unfold.py
Egor fureunoir Gorbunov b6d5409fa0 fix(settings): update health check link to correct URL path
Updated the `health_check` menu link to use the correct URL path, ensuring navigation works as expected.
2026-02-21 22:33:08 +03:00

184 lines
5.8 KiB
Python

from typing import Any
from django.templatetags.static import static
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
from schon.settings.base import (
LANGUAGES as BASE_LANGUAGES,
)
from schon.settings.base import (
LANGUAGES_FLAGS,
PROJECT_NAME,
STOREFRONT_DOMAIN,
SUPPORT_CONTACT,
TASKBOARD_URL,
)
UNFOLD: dict[str, Any] = {
"COLORS": {
"primary": {
"50": "#f4f6f7",
"100": "#e2e7ea",
"200": "#c8d1d7",
"300": "#a1b0bb",
"400": "#7f909e",
"500": "#5c7182",
"600": "#4e5f6f",
"700": "#44515d",
"800": "#3c464f",
"900": "#353d44",
"950": "#22282d",
},
},
"SITE_URL": STOREFRONT_DOMAIN,
"SITE_TITLE": f"{PROJECT_NAME} Dashboard",
"SITE_HEADER": PROJECT_NAME,
"SITE_LOGO": "favicon.png",
"SITE_ICON": "favicon.ico",
"SITE_SYMBOL": "money",
"SITE_DROPDOWN": [
{
"icon": "diamond",
"title": _("My site"),
"link": f"https://{STOREFRONT_DOMAIN}",
"attrs": {
"target": "_blank",
},
},
{
"icon": "health_metrics",
"title": _("Health"),
"link": reverse_lazy("health_check"),
},
{
"title": _("Support"),
"icon": "contact_support",
"link": SUPPORT_CONTACT,
},
],
"SHOW_LANGUAGES": True,
"SHOW_VIEW_ON_SITE": False,
"LOGIN": {
"image": lambda request: static("favicon.png"),
},
"COMMAND": {
"search_models": True,
"show_history": True,
},
"DASHBOARD_CALLBACK": "engine.core.views.dashboard_callback",
"LANGUAGES": {
"navigation": [
{
"bidi": code.split("-")[0] in {"ar", "he", "fa", "ur"},
"code": code,
"name": LANGUAGES_FLAGS.get(code),
"name_local": name,
"name_translated": _(name),
}
for code, name in BASE_LANGUAGES
],
},
"EXTENSIONS": {
"modeltranslation": {
"flags": LANGUAGES_FLAGS,
},
},
"SIDEBAR": {
"show_search": True,
"show_all_applications": True,
"navigation": [
{
"title": _("Menu"),
"separator": True,
"collapsible": False,
"items": [
{
"title": _("Dashboard"),
"icon": "dashboard",
"link": reverse_lazy("admin:index"),
},
{
"title": _("Config"),
"icon": "construction",
"link": reverse_lazy("admin:core_config_changelist"),
},
{
"title": _("Periodic Tasks"),
"icon": "event_list",
"link": reverse_lazy(
"admin:django_celery_beat_periodictask_changelist"
),
},
{
"title": "Sitemap",
"icon": "rss_feed",
"link": reverse_lazy("core:sitemap-index"),
},
{
"title": "API Docs",
"icon": "api",
"link": reverse_lazy("rapidoc-platform"),
},
{
"title": "GraphQL",
"icon": "graph_5",
"link": reverse_lazy("graphql-platform"),
},
{
"title": _("Taskboard"),
"icon": "view_kanban",
"link": TASKBOARD_URL,
},
{
"title": "Documentation",
"icon": "book_2",
"link": reverse_lazy("django-admindocs-docroot"),
},
],
},
{
"title": _("Quick Links"),
"separator": True,
"collapsible": False,
"items": [
{
"title": _("Users"),
"icon": "person",
"link": reverse_lazy("admin:vibes_auth_user_changelist"),
},
{
"title": _("Groups"),
"icon": "people",
"link": reverse_lazy("admin:vibes_auth_group_changelist"),
},
{
"title": _("Orders"),
"icon": "package",
"link": reverse_lazy("admin:core_order_changelist"),
},
{
"title": _("Products"),
"icon": "storefront",
"link": reverse_lazy("admin:core_product_changelist"),
},
{
"title": _("Categories"),
"icon": "category",
"link": reverse_lazy("admin:core_category_changelist"),
},
{
"title": _("Brands"),
"icon": "copyright",
"link": reverse_lazy("admin:core_brand_changelist"),
},
{
"title": _("Blogposts"),
"icon": "newspaper",
"link": reverse_lazy("admin:blog_post_changelist"),
},
],
},
],
},
}