django-smartbase-admin 1.0.16__py3-none-any.whl → 1.0.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_smartbase_admin/admin/admin_base.py +2 -0
- django_smartbase_admin/engine/admin_base_view.py +2 -2
- django_smartbase_admin/engine/configuration.py +4 -0
- django_smartbase_admin/services/configuration.py +4 -1
- django_smartbase_admin/static/sb_admin/dist/main.js +1 -1
- django_smartbase_admin/static/sb_admin/dist/table.js +1 -1
- django_smartbase_admin/static/sb_admin/src/js/datepicker_plugins.js +1 -1
- django_smartbase_admin/templates/sb_admin/inlines/stacked_inline.html +7 -2
- {django_smartbase_admin-1.0.16.dist-info → django_smartbase_admin-1.0.18.dist-info}/METADATA +1 -1
- {django_smartbase_admin-1.0.16.dist-info → django_smartbase_admin-1.0.18.dist-info}/RECORD +12 -12
- {django_smartbase_admin-1.0.16.dist-info → django_smartbase_admin-1.0.18.dist-info}/LICENSE.md +0 -0
- {django_smartbase_admin-1.0.16.dist-info → django_smartbase_admin-1.0.18.dist-info}/WHEEL +0 -0
|
@@ -1150,11 +1150,13 @@ class SBAdminGenericTableInlinePaginated(SBAdminGenericTableInline):
|
|
|
1150
1150
|
class SBAdminStackedInline(SBAdminInline, NestedStackedInline):
|
|
1151
1151
|
template = "sb_admin/inlines/stacked_inline.html"
|
|
1152
1152
|
fieldset_template = "sb_admin/includes/inline_fieldset.html"
|
|
1153
|
+
formset = SBAdminNestedInlineFormSet
|
|
1153
1154
|
|
|
1154
1155
|
|
|
1155
1156
|
class SBAdminGenericStackedInline(SBAdminInline, NestedGenericStackedInline):
|
|
1156
1157
|
template = "sb_admin/inlines/stacked_inline.html"
|
|
1157
1158
|
fieldset_template = "sb_admin/includes/inline_fieldset.html"
|
|
1159
|
+
formset = SBAdminGenericInlineFormSet
|
|
1158
1160
|
|
|
1159
1161
|
|
|
1160
1162
|
if parler_enabled:
|
|
@@ -4,6 +4,7 @@ from collections import defaultdict
|
|
|
4
4
|
from collections.abc import Iterable
|
|
5
5
|
from typing import Any, TYPE_CHECKING
|
|
6
6
|
|
|
7
|
+
from django.conf import settings
|
|
7
8
|
from django.contrib import messages
|
|
8
9
|
from django.contrib.admin.actions import delete_selected
|
|
9
10
|
from django.core.exceptions import PermissionDenied
|
|
@@ -11,7 +12,6 @@ from django.db.models import F
|
|
|
11
12
|
from django.http import HttpResponse, Http404, JsonResponse
|
|
12
13
|
from django.shortcuts import redirect
|
|
13
14
|
from django.template.response import TemplateResponse
|
|
14
|
-
from django.templatetags.static import static
|
|
15
15
|
from django.urls import reverse
|
|
16
16
|
from django.utils.translation import gettext_lazy as _
|
|
17
17
|
|
|
@@ -244,7 +244,7 @@ class SBAdminBaseView(object):
|
|
|
244
244
|
"TABLE_UPDATE_ROW_DATA_EVENT_NAME": TABLE_UPDATE_ROW_DATA_EVENT_NAME,
|
|
245
245
|
"SELECT_ALL_KEYWORD": SELECT_ALL_KEYWORD,
|
|
246
246
|
"SUPPORTED_FILE_TYPE_ICONS": SUPPORTED_FILE_TYPE_ICONS,
|
|
247
|
-
"STATIC_BASE_PATH":
|
|
247
|
+
"STATIC_BASE_PATH": f"{settings.STATIC_URL}sb_admin",
|
|
248
248
|
}
|
|
249
249
|
),
|
|
250
250
|
**self.get_color_scheme_context(request),
|
|
@@ -8,6 +8,7 @@ from django_smartbase_admin.engine.const import (
|
|
|
8
8
|
FilterVersions,
|
|
9
9
|
Action,
|
|
10
10
|
)
|
|
11
|
+
from django_smartbase_admin.models import ColorScheme
|
|
11
12
|
from django_smartbase_admin.utils import to_list, is_modal
|
|
12
13
|
|
|
13
14
|
|
|
@@ -39,6 +40,7 @@ class SBAdminRoleConfiguration(metaclass=Singleton):
|
|
|
39
40
|
menu_items = None
|
|
40
41
|
global_filter_form = None
|
|
41
42
|
filters_version = FilterVersions.FILTERS_VERSION_1
|
|
43
|
+
default_color_scheme = ColorScheme.AUTO
|
|
42
44
|
|
|
43
45
|
def __init__(
|
|
44
46
|
self,
|
|
@@ -47,6 +49,7 @@ class SBAdminRoleConfiguration(metaclass=Singleton):
|
|
|
47
49
|
menu_items=None,
|
|
48
50
|
global_filter_form=None,
|
|
49
51
|
filters_version=None,
|
|
52
|
+
default_color_scheme=None,
|
|
50
53
|
) -> None:
|
|
51
54
|
super().__init__()
|
|
52
55
|
self.default_view = default_view or self.default_view or []
|
|
@@ -56,6 +59,7 @@ class SBAdminRoleConfiguration(metaclass=Singleton):
|
|
|
56
59
|
self.init_configuration_static()
|
|
57
60
|
self.autocomplete_map = {}
|
|
58
61
|
self.filters_version = filters_version or self.filters_version
|
|
62
|
+
self.default_color_scheme = default_color_scheme or self.default_color_scheme
|
|
59
63
|
|
|
60
64
|
def init_registered_views(self):
|
|
61
65
|
registered_views = []
|
|
@@ -30,6 +30,9 @@ class SBAdminUserConfigurationService(object):
|
|
|
30
30
|
from django_smartbase_admin.models import SBAdminUserConfiguration
|
|
31
31
|
|
|
32
32
|
user_config, created = SBAdminUserConfiguration.objects.get_or_create(
|
|
33
|
-
|
|
33
|
+
defaults={
|
|
34
|
+
"color_scheme": request.request_data.configuration.default_color_scheme
|
|
35
|
+
},
|
|
36
|
+
user_id=request.user.id,
|
|
34
37
|
)
|
|
35
38
|
return user_config
|