Features: 1) Added icons, divider titles, priorities, and hide settings to apps; 2) Introduced Daisy settings file for customizable UI configuration; 3) Implemented new CSS styles for paginator component with hover and active states.
Fixes: 1) Updated AutoSlugField to enhance slug generation logic in core models. Extra: 1) Removed redundant Daisy settings from base configurations; 2) Minor code cleanup and organization.
This commit is contained in:
parent
3cb6576258
commit
3ab95e9b56
9 changed files with 83 additions and 67 deletions
|
|
@ -6,6 +6,10 @@ class BlogConfig(AppConfig):
|
||||||
default_auto_field = "django.db.models.BigAutoField"
|
default_auto_field = "django.db.models.BigAutoField"
|
||||||
name = "blog"
|
name = "blog"
|
||||||
verbose_name = _("blog")
|
verbose_name = _("blog")
|
||||||
|
icon = "fa fa-solid fa-book"
|
||||||
|
divider_title = _("eVibes Engine")
|
||||||
|
priority = 86
|
||||||
|
hide = False
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
def ready(self):
|
def ready(self):
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ class CoreConfig(AppConfig):
|
||||||
default_auto_field = "django.db.models.BigAutoField"
|
default_auto_field = "django.db.models.BigAutoField"
|
||||||
name = "core"
|
name = "core"
|
||||||
verbose_name = _("core")
|
verbose_name = _("core")
|
||||||
|
icon = "fa fa-solid fa-star"
|
||||||
|
divider_title = _("eVibes Engine")
|
||||||
|
priority = 88
|
||||||
|
hide = False
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
def ready(self):
|
def ready(self):
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ class Category(ExportModelOperationsMixin("category"), NiceModel, MPTTModel):
|
||||||
)
|
)
|
||||||
|
|
||||||
slug: str = AutoSlugField( # type: ignore
|
slug: str = AutoSlugField( # type: ignore
|
||||||
populate_from=("name",),
|
populate_from=("name", "parent__slug"),
|
||||||
allow_unicode=True,
|
allow_unicode=True,
|
||||||
unique=True,
|
unique=True,
|
||||||
editable=False,
|
editable=False,
|
||||||
|
|
@ -355,7 +355,7 @@ class Product(ExportModelOperationsMixin("product"), NiceModel):
|
||||||
verbose_name=_("part number"),
|
verbose_name=_("part number"),
|
||||||
)
|
)
|
||||||
slug: str | None = AutoSlugField( # type: ignore
|
slug: str | None = AutoSlugField( # type: ignore
|
||||||
populate_from=("category__slug", "brand__slug", "name", "uuid"),
|
populate_from=("uuid", "category__slug", "brand__slug", "name"),
|
||||||
allow_unicode=True,
|
allow_unicode=True,
|
||||||
unique=True,
|
unique=True,
|
||||||
editable=False,
|
editable=False,
|
||||||
|
|
|
||||||
23
core/static/css/constance.css
Normal file
23
core/static/css/constance.css
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.paginator.sticky-footer input.default {
|
||||||
|
@apply btn btn-primary;
|
||||||
|
@apply shadow-md;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
border-radius: 0.375rem;
|
||||||
|
transition: background-color 0.2s, transform 0.1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginator.sticky-footer input.default:hover {
|
||||||
|
@apply btn-primary;
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginator.sticky-footer input.default:active {
|
||||||
|
transform: translateY(0);
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ from .caches import * # noqa: F403
|
||||||
from .celery import * # noqa: F403
|
from .celery import * # noqa: F403
|
||||||
from .constance import * # noqa: F403
|
from .constance import * # noqa: F403
|
||||||
from .csp import * # noqa: F403
|
from .csp import * # noqa: F403
|
||||||
|
from .daisy import * # noqa: F403
|
||||||
from .database import * # noqa: F403
|
from .database import * # noqa: F403
|
||||||
from .dbbackup import * # noqa: F403
|
from .dbbackup import * # noqa: F403
|
||||||
from .drf import * # noqa: F403
|
from .drf import * # noqa: F403
|
||||||
|
|
|
||||||
|
|
@ -274,71 +274,6 @@ INTERNAL_IPS: list[str] = [
|
||||||
"127.0.0.1",
|
"127.0.0.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
DAISY_SETTINGS: dict = {
|
|
||||||
"SITE_LOGO": "/static/favicon.ico",
|
|
||||||
"EXTRA_STYLES": [],
|
|
||||||
"EXTRA_SCRIPTS": [],
|
|
||||||
"LOAD_FULL_STYLES": True,
|
|
||||||
"SHOW_CHANGELIST_FILTER": True,
|
|
||||||
"DONT_SUPPORT_ME": True,
|
|
||||||
"SIDEBAR_FOOTNOTE": "eVibes by Wiseless",
|
|
||||||
"APPS_REORDER": {
|
|
||||||
"django_celery_results": {
|
|
||||||
"hide": True,
|
|
||||||
"app": "django_celery_results",
|
|
||||||
},
|
|
||||||
"django_celery_beat": {
|
|
||||||
"icon": "fa fa-solid fa-timeline",
|
|
||||||
"hide": False,
|
|
||||||
"app": "django_celery_beat",
|
|
||||||
"priority": 0,
|
|
||||||
"apps": "",
|
|
||||||
},
|
|
||||||
"django_mailbox": {
|
|
||||||
"icon": "fa fa-solid fa-envelope",
|
|
||||||
"hide": False,
|
|
||||||
"app": "django_mailbox",
|
|
||||||
"priority": 1,
|
|
||||||
"apps": "",
|
|
||||||
},
|
|
||||||
"payments": {
|
|
||||||
"icon": "fa fa-solid fa-wallet",
|
|
||||||
"hide": False,
|
|
||||||
"app": "payments",
|
|
||||||
"priority": 2,
|
|
||||||
"apps": "",
|
|
||||||
},
|
|
||||||
"django_summernote": {
|
|
||||||
"icon": "fa fa-solid fa-note-sticky",
|
|
||||||
"hide": False,
|
|
||||||
"app": "payments",
|
|
||||||
"priority": 3,
|
|
||||||
"apps": "",
|
|
||||||
},
|
|
||||||
"blog": {
|
|
||||||
"icon": "fa fa-solid fa-book",
|
|
||||||
"hide": False,
|
|
||||||
"app": "blog",
|
|
||||||
"priority": 4,
|
|
||||||
"apps": "",
|
|
||||||
},
|
|
||||||
"core": {
|
|
||||||
"icon": "fa fa-solid fa-house",
|
|
||||||
"hide": False,
|
|
||||||
"app": "core",
|
|
||||||
"priority": 5,
|
|
||||||
"apps": "",
|
|
||||||
},
|
|
||||||
"vibes_auth": {
|
|
||||||
"icon": "fa fa-solid fa-user",
|
|
||||||
"hide": False,
|
|
||||||
"app": "vibes_auth",
|
|
||||||
"priority": 6,
|
|
||||||
"apps": "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
if getenv("SENTRY_DSN"):
|
if getenv("SENTRY_DSN"):
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
from sentry_sdk.integrations.celery import CeleryIntegration
|
from sentry_sdk.integrations.celery import CeleryIntegration
|
||||||
|
|
|
||||||
41
evibes/settings/daisy.py
Normal file
41
evibes/settings/daisy.py
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
DAISY_SETTINGS: dict = {
|
||||||
|
"SITE_LOGO": "/static/favicon.ico",
|
||||||
|
"EXTRA_STYLES": [
|
||||||
|
"core/css/constance.css",
|
||||||
|
],
|
||||||
|
"EXTRA_SCRIPTS": [],
|
||||||
|
"SHOW_CHANGELIST_FILTER": True,
|
||||||
|
"DONT_SUPPORT_ME": True,
|
||||||
|
"SIDEBAR_FOOTNOTE": "eVibes by Wiseless",
|
||||||
|
"LOAD_FULL_STYLES": True,
|
||||||
|
"APPS_REORDER": {
|
||||||
|
"django_celery_results": {
|
||||||
|
"hide": True,
|
||||||
|
"app": "django_celery_results",
|
||||||
|
"divider_title": _("eVibes System"),
|
||||||
|
},
|
||||||
|
"django_celery_beat": {
|
||||||
|
"icon": "fa fa-solid fa-timeline",
|
||||||
|
"hide": False,
|
||||||
|
"app": "django_celery_beat",
|
||||||
|
"priority": 0,
|
||||||
|
"divider_title": _("eVibes System"),
|
||||||
|
},
|
||||||
|
"django_mailbox": {
|
||||||
|
"icon": "fa fa-solid fa-envelope",
|
||||||
|
"hide": False,
|
||||||
|
"app": "django_mailbox",
|
||||||
|
"priority": 1,
|
||||||
|
"divider_title": _("eVibes System"),
|
||||||
|
},
|
||||||
|
"django_summernote": {
|
||||||
|
"icon": "fa fa-solid fa-note-sticky",
|
||||||
|
"hide": False,
|
||||||
|
"app": "django_summernote",
|
||||||
|
"priority": 2,
|
||||||
|
"divider_title": _("eVibes System"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,10 @@ class PaymentsConfig(AppConfig):
|
||||||
default_auto_field = "django.db.models.BigAutoField"
|
default_auto_field = "django.db.models.BigAutoField"
|
||||||
name = "payments"
|
name = "payments"
|
||||||
verbose_name = _("payments")
|
verbose_name = _("payments")
|
||||||
|
icon = "fa fa-solid fa-star"
|
||||||
|
divider_title = _("eVibes Engine")
|
||||||
|
priority = 87
|
||||||
|
hide = False
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
import payments.signals # noqa: F401
|
import payments.signals # noqa: F401
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,10 @@ class VibesAuthConfig(AppConfig):
|
||||||
default_auto_field = "django.db.models.BigAutoField"
|
default_auto_field = "django.db.models.BigAutoField"
|
||||||
name = "vibes_auth"
|
name = "vibes_auth"
|
||||||
verbose_name = _("authentication")
|
verbose_name = _("authentication")
|
||||||
|
icon = "fa fa-solid fa-user"
|
||||||
|
divider_title = _("eVibes Auth")
|
||||||
|
priority = 89
|
||||||
|
hide = False
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
import vibes_auth.signals # noqa: F401
|
import vibes_auth.signals # noqa: F401
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue