django-smartbase-admin 0.2.47__py3-none-any.whl → 1.0.38__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/actions/admin_action_list.py +80 -51
- django_smartbase_admin/actions/advanced_filters.py +55 -20
- django_smartbase_admin/admin/admin_base.py +477 -89
- django_smartbase_admin/admin/site.py +104 -34
- django_smartbase_admin/admin/widgets.py +598 -26
- django_smartbase_admin/apps.py +2 -0
- django_smartbase_admin/engine/actions.py +34 -16
- django_smartbase_admin/engine/admin_base_view.py +253 -115
- django_smartbase_admin/engine/configuration.py +186 -4
- django_smartbase_admin/engine/const.py +7 -0
- django_smartbase_admin/engine/dashboard.py +44 -23
- django_smartbase_admin/engine/fake_inline.py +44 -7
- django_smartbase_admin/engine/field.py +54 -10
- django_smartbase_admin/engine/field_formatter.py +32 -9
- django_smartbase_admin/engine/filter_widgets.py +356 -21
- django_smartbase_admin/engine/menu_item.py +8 -5
- django_smartbase_admin/engine/modal_view.py +12 -7
- django_smartbase_admin/engine/request.py +2 -0
- django_smartbase_admin/integration/__init__.py +0 -0
- django_smartbase_admin/integration/django_cms.py +43 -0
- django_smartbase_admin/locale/sk/LC_MESSAGES/django.mo +0 -0
- django_smartbase_admin/locale/sk/LC_MESSAGES/django.po +268 -37
- django_smartbase_admin/migrations/0005_sbadminuserconfiguration.py +26 -0
- django_smartbase_admin/migrations/0006_alter_sbadminuserconfiguration_color_scheme.py +18 -0
- django_smartbase_admin/models.py +22 -0
- django_smartbase_admin/monkeypatch/admin_readonly_field_monkeypatch.py +96 -0
- django_smartbase_admin/monkeypatch/fake_inline_monkeypatch.py +1 -1
- django_smartbase_admin/querysets.py +3 -0
- django_smartbase_admin/services/configuration.py +30 -0
- django_smartbase_admin/services/thread_local.py +6 -19
- django_smartbase_admin/services/views.py +82 -27
- django_smartbase_admin/services/xlsx_export.py +6 -0
- django_smartbase_admin/static/sb_admin/build/tailwind.config.js +1 -0
- django_smartbase_admin/static/sb_admin/build/tailwind_config_partials/colors.js +4 -0
- django_smartbase_admin/static/sb_admin/build/tailwind_config_partials/spacing.js +1 -0
- django_smartbase_admin/static/sb_admin/build/webpack.common.js +11 -8
- django_smartbase_admin/static/sb_admin/css/ckeditor/ckeditor_content_dark.css +208 -0
- django_smartbase_admin/static/sb_admin/css/coloris/coloris.min.css +1 -0
- django_smartbase_admin/static/sb_admin/dist/calendar.js +1 -0
- django_smartbase_admin/static/sb_admin/dist/calendar_style.css +1 -0
- django_smartbase_admin/static/sb_admin/dist/calendar_style.js +0 -0
- django_smartbase_admin/static/sb_admin/dist/chart.js +1 -1
- django_smartbase_admin/static/sb_admin/dist/main.js +1 -1
- django_smartbase_admin/static/sb_admin/dist/main_style.css +1 -1
- django_smartbase_admin/static/sb_admin/dist/table.js +1 -1
- django_smartbase_admin/static/sb_admin/dist/table.js.LICENSE.txt +9 -0
- django_smartbase_admin/static/sb_admin/dist/tree_widget.js +1 -0
- django_smartbase_admin/static/sb_admin/dist/tree_widget_style.css +1 -0
- django_smartbase_admin/static/sb_admin/dist/tree_widget_style.js +0 -0
- django_smartbase_admin/static/sb_admin/fancytree/jquery.fancytree-all-deps.min.js +1 -0
- django_smartbase_admin/static/sb_admin/images/file_types/file-csv.svg +11 -0
- django_smartbase_admin/static/sb_admin/images/file_types/file-doc.svg +11 -0
- django_smartbase_admin/static/sb_admin/images/file_types/file-docx.svg +11 -0
- django_smartbase_admin/static/sb_admin/images/file_types/file-other.svg +13 -0
- django_smartbase_admin/static/sb_admin/images/file_types/file-pdf.svg +11 -0
- django_smartbase_admin/static/sb_admin/images/file_types/file-ppt.svg +11 -0
- django_smartbase_admin/static/sb_admin/images/file_types/file-xls.svg +11 -0
- django_smartbase_admin/static/sb_admin/images/file_types/file-xlsx.svg +11 -0
- django_smartbase_admin/static/sb_admin/images/file_types/file-zip.svg +18 -0
- django_smartbase_admin/static/sb_admin/images/flags/de-at.png +0 -0
- django_smartbase_admin/static/sb_admin/images/flags/de-ch.png +0 -0
- django_smartbase_admin/static/sb_admin/images/logo_light.svg +21 -0
- django_smartbase_admin/static/sb_admin/js/coloris/coloris.min.js +6 -0
- django_smartbase_admin/static/sb_admin/js/fullcalendar.min.js +14804 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Bolt-one.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Calendar.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Caution.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Electric-drill.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Fire-extinguisher.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Gas.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Lightning-fill.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Moon.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Phone-telephone.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Printer.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Pull.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Sun-one.svg +3 -0
- django_smartbase_admin/static/sb_admin/sprites/sb_admin/Time.svg +3 -0
- django_smartbase_admin/static/sb_admin/src/css/_base.css +5 -1
- django_smartbase_admin/static/sb_admin/src/css/_colors.css +257 -82
- django_smartbase_admin/static/sb_admin/src/css/_components.css +66 -13
- django_smartbase_admin/static/sb_admin/src/css/_datepicker.css +8 -1
- django_smartbase_admin/static/sb_admin/src/css/_filer.css +60 -0
- django_smartbase_admin/static/sb_admin/src/css/_inlines.css +51 -10
- django_smartbase_admin/static/sb_admin/src/css/_tabulator.css +8 -2
- django_smartbase_admin/static/sb_admin/src/css/calendar.css +162 -0
- django_smartbase_admin/static/sb_admin/src/css/components/_button.css +41 -1
- django_smartbase_admin/static/sb_admin/src/css/components/_dropdown.css +26 -8
- django_smartbase_admin/static/sb_admin/src/css/components/_input.css +62 -20
- django_smartbase_admin/static/sb_admin/src/css/components/_modal.css +1 -1
- django_smartbase_admin/static/sb_admin/src/css/components/_query-builder.css +21 -2
- django_smartbase_admin/static/sb_admin/src/css/components/_toggle.css +12 -1
- django_smartbase_admin/static/sb_admin/src/css/components/_tooltip.css +8 -22
- django_smartbase_admin/static/sb_admin/src/css/style.css +17 -0
- django_smartbase_admin/static/sb_admin/src/css/tree_widget.css +411 -0
- django_smartbase_admin/static/sb_admin/src/js/autocomplete.js +63 -5
- django_smartbase_admin/static/sb_admin/src/js/calendar.js +56 -0
- django_smartbase_admin/static/sb_admin/src/js/chart.js +8 -22
- django_smartbase_admin/static/sb_admin/src/js/choices.js +18 -8
- django_smartbase_admin/static/sb_admin/src/js/datepicker.js +97 -336
- django_smartbase_admin/static/sb_admin/src/js/datepicker_plugins.js +357 -0
- django_smartbase_admin/static/sb_admin/src/js/main.js +307 -26
- django_smartbase_admin/static/sb_admin/src/js/multiselect.js +50 -41
- django_smartbase_admin/static/sb_admin/src/js/range.js +3 -2
- django_smartbase_admin/static/sb_admin/src/js/sb_ajax_params_tabulator_modifier.js +21 -0
- django_smartbase_admin/static/sb_admin/src/js/table.js +38 -13
- django_smartbase_admin/static/sb_admin/src/js/table_modules/advanced_filter_module.js +43 -20
- django_smartbase_admin/static/sb_admin/src/js/table_modules/data_edit_module.js +8 -10
- django_smartbase_admin/static/sb_admin/src/js/table_modules/filter_module.js +3 -3
- django_smartbase_admin/static/sb_admin/src/js/table_modules/header_tabs_module.js +11 -11
- django_smartbase_admin/static/sb_admin/src/js/table_modules/selection_module.js +28 -8
- django_smartbase_admin/static/sb_admin/src/js/table_modules/table_params_module.js +6 -0
- django_smartbase_admin/static/sb_admin/src/js/table_modules/views_module.js +19 -3
- django_smartbase_admin/static/sb_admin/src/js/tree_widget.js +406 -0
- django_smartbase_admin/static/sb_admin/src/js/utils.js +56 -21
- django_smartbase_admin/templates/sb_admin/actions/change_form.html +169 -117
- django_smartbase_admin/templates/sb_admin/actions/dashboard.html +2 -2
- django_smartbase_admin/templates/sb_admin/actions/delete_selected_confirmation.html +56 -32
- django_smartbase_admin/templates/sb_admin/actions/list.html +79 -42
- django_smartbase_admin/templates/sb_admin/actions/object_history.html +2 -2
- django_smartbase_admin/templates/sb_admin/actions/partials/action_link.html +14 -0
- django_smartbase_admin/templates/sb_admin/actions/partials/selected_rows_actions.html +2 -2
- django_smartbase_admin/templates/sb_admin/actions/partials/tabulator_header_v2.html +2 -2
- django_smartbase_admin/templates/sb_admin/actions/tree_list.html +63 -0
- django_smartbase_admin/templates/sb_admin/authentification/login_base.html +5 -1
- django_smartbase_admin/templates/sb_admin/components/columns.html +1 -1
- django_smartbase_admin/templates/sb_admin/components/filters_v2.html +99 -85
- django_smartbase_admin/templates/sb_admin/config/view.html +0 -1
- django_smartbase_admin/templates/sb_admin/dashboard/calendar_widget.html +69 -0
- django_smartbase_admin/templates/sb_admin/dashboard/chart_widget.html +21 -2
- django_smartbase_admin/templates/sb_admin/dashboard/list_widget.html +6 -0
- django_smartbase_admin/templates/sb_admin/dashboard/widget_base.html +1 -1
- django_smartbase_admin/templates/sb_admin/filter_widgets/advanced_filters/date_field.html +18 -8
- django_smartbase_admin/templates/sb_admin/filter_widgets/advanced_filters/multiple_choice_field.html +1 -1
- django_smartbase_admin/templates/sb_admin/filter_widgets/advanced_filters/tree_select_filter.html +2 -0
- django_smartbase_admin/templates/sb_admin/filter_widgets/date_field.html +18 -4
- django_smartbase_admin/templates/sb_admin/filter_widgets/multiple_choice_field.html +14 -0
- django_smartbase_admin/templates/sb_admin/filter_widgets/partials/clear.html +10 -5
- django_smartbase_admin/templates/sb_admin/filter_widgets/radio_choice_field.html +2 -2
- django_smartbase_admin/templates/sb_admin/filter_widgets/tree_select_filter.html +16 -0
- django_smartbase_admin/templates/sb_admin/includes/change_form_title.html +3 -1
- django_smartbase_admin/templates/sb_admin/includes/components.html +5 -1
- django_smartbase_admin/templates/sb_admin/includes/inline_fieldset.html +48 -39
- django_smartbase_admin/templates/sb_admin/includes/notifications.html +2 -1
- django_smartbase_admin/templates/sb_admin/includes/readonly_boolean_field.html +9 -0
- django_smartbase_admin/templates/sb_admin/includes/readonly_field.html +12 -0
- django_smartbase_admin/templates/sb_admin/includes/table_inline_delete_button.html +4 -5
- django_smartbase_admin/templates/sb_admin/inlines/stacked_inline.html +68 -40
- django_smartbase_admin/templates/sb_admin/inlines/table_inline.html +78 -36
- django_smartbase_admin/templates/sb_admin/integrations/filer/folder_list.html +18 -0
- django_smartbase_admin/templates/sb_admin/navigation.html +166 -158
- django_smartbase_admin/templates/sb_admin/partials/modal/modal_content.html +2 -6
- django_smartbase_admin/templates/sb_admin/sb_admin_base.html +49 -4
- django_smartbase_admin/templates/sb_admin/sb_admin_base_no_sidebar.html +35 -11
- django_smartbase_admin/templates/sb_admin/sb_admin_js_trans.html +3 -0
- django_smartbase_admin/templates/sb_admin/sprites/sb_admin.svg +1 -1
- django_smartbase_admin/templates/sb_admin/tailwind_whitelist.html +6 -3
- django_smartbase_admin/templates/sb_admin/widgets/array.html +0 -1
- django_smartbase_admin/templates/sb_admin/widgets/attributes.html +68 -0
- django_smartbase_admin/templates/sb_admin/widgets/autocomplete.html +13 -2
- django_smartbase_admin/templates/sb_admin/widgets/{checkbox_select.html → checkbox_dropdown.html} +2 -2
- django_smartbase_admin/templates/sb_admin/widgets/checkbox_group.html +15 -0
- django_smartbase_admin/templates/sb_admin/widgets/clearable_file_input.html +2 -2
- django_smartbase_admin/templates/sb_admin/widgets/color_field.html +30 -0
- django_smartbase_admin/templates/sb_admin/widgets/date.html +8 -1
- django_smartbase_admin/templates/sb_admin/widgets/filer_file.html +84 -0
- django_smartbase_admin/templates/sb_admin/widgets/html_read_only.html +1 -0
- django_smartbase_admin/templates/sb_admin/widgets/includes/related_item_buttons.html +38 -0
- django_smartbase_admin/templates/sb_admin/widgets/multiwidget.html +1 -1
- django_smartbase_admin/templates/sb_admin/widgets/radio.html +3 -2
- django_smartbase_admin/templates/sb_admin/widgets/radio_dropdown.html +30 -0
- django_smartbase_admin/templates/sb_admin/widgets/read_only_password_hash.html +3 -0
- django_smartbase_admin/templates/sb_admin/widgets/time.html +8 -1
- django_smartbase_admin/templates/sb_admin/widgets/toggle.html +1 -1
- django_smartbase_admin/templates/sb_admin/widgets/tree_base.html +59 -0
- django_smartbase_admin/templates/sb_admin/widgets/tree_select.html +24 -0
- django_smartbase_admin/templates/sb_admin/widgets/tree_select_inline.html +12 -0
- django_smartbase_admin/templatetags/sb_admin_tags.py +163 -4
- django_smartbase_admin/utils.py +22 -3
- django_smartbase_admin/views/dashboard_view.py +6 -0
- django_smartbase_admin/views/global_filter_view.py +8 -2
- django_smartbase_admin/views/translations_view.py +12 -5
- django_smartbase_admin/views/user_config_view.py +52 -0
- django_smartbase_admin-1.0.38.dist-info/METADATA +166 -0
- {django_smartbase_admin-0.2.47.dist-info → django_smartbase_admin-1.0.38.dist-info}/RECORD +186 -121
- {django_smartbase_admin-0.2.47.dist-info → django_smartbase_admin-1.0.38.dist-info}/WHEEL +1 -1
- django_smartbase_admin/templates/sb_admin/integrations/sorting/change_list.html +0 -401
- django_smartbase_admin-0.2.47.dist-info/METADATA +0 -25
- {django_smartbase_admin-0.2.47.dist-info → django_smartbase_admin-1.0.38.dist-info}/LICENSE.md +0 -0
|
@@ -9,6 +9,7 @@ from django.forms import modelform_factory
|
|
|
9
9
|
from django.http import HttpResponse, HttpResponseRedirect
|
|
10
10
|
from django.template.response import TemplateResponse
|
|
11
11
|
from django.utils.html import format_html
|
|
12
|
+
from django.utils.safestring import mark_safe
|
|
12
13
|
from django.utils.translation import gettext_lazy as _
|
|
13
14
|
|
|
14
15
|
from django_smartbase_admin.actions.admin_action_list import SBAdminListAction
|
|
@@ -125,7 +126,7 @@ class ModelTranslationView(SBAdminView, SBAdminBaseListView):
|
|
|
125
126
|
lang_codes.extend(selected_lang_codes)
|
|
126
127
|
return lang_codes
|
|
127
128
|
|
|
128
|
-
def init_fields_cache(self, fields_source=None, configuration=None):
|
|
129
|
+
def init_fields_cache(self, fields_source=None, configuration=None, force=False):
|
|
129
130
|
return
|
|
130
131
|
|
|
131
132
|
def get_field_map(self, request):
|
|
@@ -161,7 +162,7 @@ class ModelTranslationView(SBAdminView, SBAdminBaseListView):
|
|
|
161
162
|
annotate=Case(
|
|
162
163
|
When(
|
|
163
164
|
**{
|
|
164
|
-
f"{annotate_name}
|
|
165
|
+
f"{annotate_name}_count__gte": F(
|
|
165
166
|
f"{main_lang_annotate_name}_count"
|
|
166
167
|
),
|
|
167
168
|
"then": Value(self.TRANSLATION_TRANSLATED),
|
|
@@ -207,11 +208,17 @@ class ModelTranslationView(SBAdminView, SBAdminBaseListView):
|
|
|
207
208
|
|
|
208
209
|
def format_translation_status(self, object_id, value):
|
|
209
210
|
if value == self.TRANSLATION_NOT_TRANSLATED:
|
|
210
|
-
return
|
|
211
|
+
return mark_safe(
|
|
212
|
+
f'<span class="badge badge-simple badge-neutral"><svg class="w-16 h-16 mr-4 text-invisible"><use xlink:href="#Add-one"></use></svg>{_("Not Translated")}</span>'
|
|
213
|
+
)
|
|
211
214
|
if value == self.TRANSLATION_INCOMPLETE:
|
|
212
|
-
return
|
|
215
|
+
return mark_safe(
|
|
216
|
+
f'<span class="badge badge-simple badge-warning"><svg class="w-16 h-16 mr-4 text-warning"><use xlink:href="#Attention"></use></svg>{_("Incomplete")}</span>'
|
|
217
|
+
)
|
|
213
218
|
if value == self.TRANSLATION_TRANSLATED:
|
|
214
|
-
return
|
|
219
|
+
return mark_safe(
|
|
220
|
+
f'<span class="badge badge-simple badge-positive"><svg class="w-16 h-16 mr-4 text-success"><use xlink:href="#Check"></use></svg>{_("Translated")}</span>'
|
|
221
|
+
)
|
|
215
222
|
|
|
216
223
|
def get_translated_fields(self):
|
|
217
224
|
return SBAdminTranslationsService.get_translated_fields_for_model(self.model)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from django import forms
|
|
2
|
+
from django.http import HttpResponse
|
|
3
|
+
from django.utils.html import format_html
|
|
4
|
+
from django.views.generic import FormView
|
|
5
|
+
|
|
6
|
+
from django_smartbase_admin.admin.admin_base import SBAdminBaseFormInit
|
|
7
|
+
from django_smartbase_admin.admin.widgets import (
|
|
8
|
+
SBAdminRadioDropdownWidget,
|
|
9
|
+
)
|
|
10
|
+
from django_smartbase_admin.models import SBAdminUserConfiguration, ColorScheme
|
|
11
|
+
from django_smartbase_admin.services.configuration import (
|
|
12
|
+
SBAdminUserConfigurationService,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ColorSchemeForm(SBAdminBaseFormInit, forms.ModelForm):
|
|
17
|
+
color_scheme_icons = {
|
|
18
|
+
ColorScheme.AUTO.value: "Translation",
|
|
19
|
+
ColorScheme.DARK.value: "Moon",
|
|
20
|
+
ColorScheme.LIGHT.value: "Sun-one",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class Meta:
|
|
24
|
+
model = SBAdminUserConfiguration
|
|
25
|
+
fields = ("color_scheme",)
|
|
26
|
+
widgets = {
|
|
27
|
+
"color_scheme": SBAdminRadioDropdownWidget(),
|
|
28
|
+
}
|
|
29
|
+
required = []
|
|
30
|
+
|
|
31
|
+
def __init__(self, *args, **kwargs):
|
|
32
|
+
super().__init__(*args, **kwargs)
|
|
33
|
+
choices_formatted = []
|
|
34
|
+
for choice in self.fields["color_scheme"].choices:
|
|
35
|
+
choice_label = format_html(
|
|
36
|
+
f'<span class="flex gap-8"><svg class="w-20 h-20"><use href="#{self.color_scheme_icons.get(choice[0])}"></use></svg><span>{choice[1]}</span></span>'
|
|
37
|
+
)
|
|
38
|
+
choices_formatted.append((choice[0], choice_label))
|
|
39
|
+
self.fields["color_scheme"].choices = choices_formatted
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class ColorSchemeView(FormView):
|
|
43
|
+
form_class = ColorSchemeForm
|
|
44
|
+
|
|
45
|
+
def form_valid(self, form):
|
|
46
|
+
instance = form.save(commit=False)
|
|
47
|
+
sb_admin_user_config = SBAdminUserConfigurationService.get_user_config(
|
|
48
|
+
self.request
|
|
49
|
+
)
|
|
50
|
+
sb_admin_user_config.color_scheme = instance.color_scheme
|
|
51
|
+
sb_admin_user_config.save(update_fields=["color_scheme"])
|
|
52
|
+
return HttpResponse(status=200)
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: django-smartbase-admin
|
|
3
|
+
Version: 1.0.38
|
|
4
|
+
Summary:
|
|
5
|
+
Home-page: https://smartbase-sk.github.io/django-smartbase-admin-docs/
|
|
6
|
+
License: MIT
|
|
7
|
+
Author: SmartBase
|
|
8
|
+
Author-email: info@smartbase.sk
|
|
9
|
+
Requires-Python: >=3.10,<4.0
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Environment :: Web Environment
|
|
12
|
+
Classifier: Framework :: Django
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Requires-Dist: django (>=4.1,<6.0)
|
|
22
|
+
Requires-Dist: django-admin-inline-paginator (>=0.4.0,<0.5.0)
|
|
23
|
+
Requires-Dist: django-ckeditor (>=6.7.1,<7.0.0)
|
|
24
|
+
Requires-Dist: django-filer (>=3.1.1,<4.0.0)
|
|
25
|
+
Requires-Dist: django-htmx (>=1.17.3,<2.0.0)
|
|
26
|
+
Requires-Dist: django-nested-admin (>=4.1.1,<5.0.0)
|
|
27
|
+
Requires-Dist: django-widget-tweaks (>=1.5.0,<2.0.0)
|
|
28
|
+
Requires-Dist: easy-thumbnails[svg] (>=2.8.5,<3.0.0)
|
|
29
|
+
Requires-Dist: setuptools (>=67.0.0,<68.0.0)
|
|
30
|
+
Requires-Dist: xlsxwriter (>=3.2.0,<4.0.0)
|
|
31
|
+
Project-URL: Repository, https://github.com/SmartBase-SK/django-smartbase-admin
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
<img alt="image" src="https://github.com/user-attachments/assets/b0d5537f-29c4-46ca-b514-9862b26cb000"/>
|
|
35
|
+
|
|
36
|
+
# Django SmartBase Admin
|
|
37
|
+
|
|
38
|
+
A modern, modular, and developer-friendly admin interface for Django.
|
|
39
|
+
Built to **speed up development** of internal tools and admin panels — beautifully and efficiently.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## ✨ Features
|
|
44
|
+
- Fast integration with any Django project
|
|
45
|
+
- Improved performance of Django List Admin using `SBAdminField`, database `annotate()` and `values()` to avoid direct object access
|
|
46
|
+
- Simple configuration of menu structure, dashboard components, and permissions per user role
|
|
47
|
+
- Enhanced Django List Admin filters: autocomplete support for related fields and filtering across all model fields
|
|
48
|
+
- Ability for users to save and reuse custom filters in Django List Admin
|
|
49
|
+
- Improved Django Detail Admin with autocomplete for relational fields
|
|
50
|
+
- Support for "FakeInlines" – define inline-like blocks without requiring a direct model relationship
|
|
51
|
+
- Easy extension of list and detail views with custom actions and corresponding views
|
|
52
|
+
- Beautiful modern UI (Tailwind CSS)
|
|
53
|
+
- Responsive & mobile-friendly
|
|
54
|
+
- End-user ready for building SaaS or similar projects with global queryset configuration
|
|
55
|
+
<img alt="image" src="https://github.com/user-attachments/assets/ebbcacea-9052-409e-99bb-9f9e0804bbc5" />
|
|
56
|
+
<img alt="image" src="https://github.com/user-attachments/assets/8003df6a-e035-4c8f-8e90-0e710818d33e" />
|
|
57
|
+
<img alt="image" src="https://github.com/user-attachments/assets/29e116de-a8c6-4f22-8485-3e0eba5ed564" />
|
|
58
|
+
<img alt="image" src="https://github.com/user-attachments/assets/46aefe59-e49c-4483-ba1f-eb18397db6ae" />
|
|
59
|
+
<img alt="image" src="https://github.com/user-attachments/assets/ea354dcb-b4a9-47af-8046-ba0d55d72746" />
|
|
60
|
+
<img alt="image" src="https://github.com/user-attachments/assets/10a5d75c-ae3e-4e2b-aeb2-e943e6363a2f" />
|
|
61
|
+
<img alt="image" src="https://github.com/user-attachments/assets/3e6bfdbb-0c07-4fad-96f0-552cbcc9d4ae" />
|
|
62
|
+
<img alt="image" src="https://github.com/user-attachments/assets/b3acd00b-c425-4e5f-b113-97215bb85157" />
|
|
63
|
+
<img alt="image" src="https://github.com/user-attachments/assets/dc5f3f80-3325-4f5d-acec-236d6b241a7f" />
|
|
64
|
+
<img alt="image" src="https://github.com/user-attachments/assets/216d4e50-5af4-4e57-8649-1211a82f493e" />
|
|
65
|
+
<img alt="image" src="https://github.com/user-attachments/assets/167461dd-ec2e-4327-a208-4014f42100f9" />
|
|
66
|
+
<img alt="image" src="https://github.com/user-attachments/assets/3871e505-1bc9-4a6c-8457-4ad363a582af" />
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## 📚 Full Documentation (in progress)
|
|
70
|
+
|
|
71
|
+
🗂 [View Full Docs](https://smartbase-sk.github.io/django-smartbase-admin-docs/docs/installation)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 🌐 Live Demo
|
|
75
|
+
|
|
76
|
+
Want to see it in action?
|
|
77
|
+
👉 [Check out the live demo](https://sbadmin.sbdev.sk/)
|
|
78
|
+
|
|
79
|
+
**Login credentials:**
|
|
80
|
+
- **Admin role**: `admin / admin`
|
|
81
|
+
- **Editor role**: `editor / editor`
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
## ⚡ Quick Start
|
|
86
|
+
|
|
87
|
+
### 1. Install Smartbase Admin
|
|
88
|
+
|
|
89
|
+
Begin by installing the Smartbase Admin package using `pip`:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install django-smartbase-admin
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Ensure that django-smartbase-admin and its dependencies are included in your Django settings. Open your `settings.py` file and add the following to `INSTALLED_APPS`:
|
|
96
|
+
```python
|
|
97
|
+
INSTALLED_APPS = [
|
|
98
|
+
# other apps
|
|
99
|
+
"django_smartbase_admin",
|
|
100
|
+
"easy_thumbnails",
|
|
101
|
+
"widget_tweaks",
|
|
102
|
+
"ckeditor",
|
|
103
|
+
"ckeditor_uploader",
|
|
104
|
+
]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 2. Add Admin URL Configuration
|
|
108
|
+
In your project’s `urls.py`, register the Smartbase Admin site by importing sb_admin_site and adding the path:
|
|
109
|
+
```python
|
|
110
|
+
from django_smartbase_admin.admin.site import sb_admin_site
|
|
111
|
+
|
|
112
|
+
urlpatterns = [
|
|
113
|
+
path("sb-admin/", sb_admin_site.urls),
|
|
114
|
+
# other paths
|
|
115
|
+
]
|
|
116
|
+
```
|
|
117
|
+
This makes the Smartbase Admin interface accessible at `/sb-admin/`
|
|
118
|
+
|
|
119
|
+
### 3. Define the SmartBase Admin Configuration
|
|
120
|
+
In your project, for example in `config` package create a file called `sbadmin_config.py` with the following content:
|
|
121
|
+
```python
|
|
122
|
+
from django_smartbase_admin.engine.configuration import SBAdminConfigurationBase, SBAdminRoleConfiguration
|
|
123
|
+
from django_smartbase_admin.views.dashboard_view import SBAdminDashboardView
|
|
124
|
+
from django_smartbase_admin.engine.menu_item import SBAdminMenuItem
|
|
125
|
+
|
|
126
|
+
config = SBAdminRoleConfiguration(
|
|
127
|
+
default_view=SBAdminMenuItem(view_id="dashboard"),
|
|
128
|
+
menu_items=[
|
|
129
|
+
SBAdminMenuItem(view_id="dashboard", icon="All-application"),
|
|
130
|
+
],
|
|
131
|
+
registered_views=[
|
|
132
|
+
SBAdminDashboardView(widgets=[], title="Dashboard"),
|
|
133
|
+
],
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
class SBAdminConfiguration(SBAdminConfigurationBase):
|
|
137
|
+
def get_configuration_for_roles(self, user_roles):
|
|
138
|
+
return config
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 4. Reference the Configuration in `settings.py`
|
|
142
|
+
```python
|
|
143
|
+
SB_ADMIN_CONFIGURATION = "config.sbadmin_config.SBAdminConfiguration"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 5. Add Locale Middleware
|
|
147
|
+
Add the following middleware to support internationalization:
|
|
148
|
+
```python
|
|
149
|
+
MIDDLEWARE = [
|
|
150
|
+
# Other middleware...
|
|
151
|
+
'django.middleware.locale.LocaleMiddleware',
|
|
152
|
+
]
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## 🤖 AI/Developer Reference
|
|
156
|
+
|
|
157
|
+
See [AGENTS.md](./AGENTS.md) for development patterns, gotchas, and AI assistant instructions.
|
|
158
|
+
|
|
159
|
+
## 🤝 Need Help with Development?
|
|
160
|
+
We at SmartBase are experts in Django and custom software.
|
|
161
|
+
|
|
162
|
+
Whether you're building a new platform or modernizing an internal tool —
|
|
163
|
+
💡 We can help you design, build, and scale it.
|
|
164
|
+
|
|
165
|
+
📬 [Let's talk](https://en.smartbase.sk/contact-us/) — We'd love to work with you.
|
|
166
|
+
|