django-smartbase-admin 1.0.23__py3-none-any.whl → 1.0.25__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/static/sb_admin/dist/main.js +1 -1
- django_smartbase_admin/static/sb_admin/src/js/main.js +3 -0
- django_smartbase_admin/templatetags/sb_admin_tags.py +14 -8
- django_smartbase_admin/views/user_config_view.py +18 -1
- {django_smartbase_admin-1.0.23.dist-info → django_smartbase_admin-1.0.25.dist-info}/METADATA +15 -3
- {django_smartbase_admin-1.0.23.dist-info → django_smartbase_admin-1.0.25.dist-info}/RECORD +8 -8
- {django_smartbase_admin-1.0.23.dist-info → django_smartbase_admin-1.0.25.dist-info}/LICENSE.md +0 -0
- {django_smartbase_admin-1.0.23.dist-info → django_smartbase_admin-1.0.25.dist-info}/WHEEL +0 -0
|
@@ -11,6 +11,7 @@ from django.templatetags.static import static
|
|
|
11
11
|
from django.utils.safestring import mark_safe
|
|
12
12
|
from django.utils.text import get_text_list
|
|
13
13
|
from django.utils.translation import gettext
|
|
14
|
+
from easy_thumbnails.exceptions import InvalidImageFormatError
|
|
14
15
|
|
|
15
16
|
from django_smartbase_admin.engine.const import (
|
|
16
17
|
ROW_CLASS_FIELD,
|
|
@@ -263,14 +264,19 @@ def get_file_preview_image(
|
|
|
263
264
|
from easy_thumbnails.files import get_thumbnailer
|
|
264
265
|
|
|
265
266
|
thumbnailer = get_thumbnailer(file)
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
267
|
+
try:
|
|
268
|
+
thumb = thumbnailer.get_thumbnail(
|
|
269
|
+
{
|
|
270
|
+
"size": (thumbnail_width, thumbnail_height),
|
|
271
|
+
"crop": True,
|
|
272
|
+
"replace_alpha": "#fff",
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
return thumb.url
|
|
276
|
+
except ValueError:
|
|
277
|
+
return file.url
|
|
278
|
+
except InvalidImageFormatError:
|
|
279
|
+
return static("sb_admin/images/file_types/file-other.svg")
|
|
274
280
|
if file_extension == "svg" or file_extension == "webp":
|
|
275
281
|
return file.url
|
|
276
282
|
for extension in SUPPORTED_FILE_TYPE_ICONS:
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
from django import forms
|
|
2
2
|
from django.http import HttpResponse
|
|
3
|
+
from django.utils.html import format_html
|
|
3
4
|
from django.views.generic import FormView
|
|
4
5
|
|
|
5
6
|
from django_smartbase_admin.admin.admin_base import SBAdminBaseFormInit
|
|
6
7
|
from django_smartbase_admin.admin.widgets import (
|
|
7
8
|
SBAdminRadioDropdownWidget,
|
|
8
9
|
)
|
|
9
|
-
from django_smartbase_admin.models import SBAdminUserConfiguration
|
|
10
|
+
from django_smartbase_admin.models import SBAdminUserConfiguration, ColorScheme
|
|
10
11
|
from django_smartbase_admin.services.configuration import (
|
|
11
12
|
SBAdminUserConfigurationService,
|
|
12
13
|
)
|
|
13
14
|
|
|
14
15
|
|
|
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
|
+
|
|
16
23
|
class Meta:
|
|
17
24
|
model = SBAdminUserConfiguration
|
|
18
25
|
fields = ("color_scheme",)
|
|
@@ -21,6 +28,16 @@ class ColorSchemeForm(SBAdminBaseFormInit, forms.ModelForm):
|
|
|
21
28
|
}
|
|
22
29
|
required = []
|
|
23
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
|
+
|
|
24
41
|
|
|
25
42
|
class ColorSchemeView(FormView):
|
|
26
43
|
form_class = ColorSchemeForm
|
{django_smartbase_admin-1.0.23.dist-info → django_smartbase_admin-1.0.25.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-smartbase-admin
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.25
|
|
4
4
|
Summary:
|
|
5
5
|
Home-page: https://smartbase-sk.github.io/django-smartbase-admin-docs/
|
|
6
6
|
License: MIT
|
|
@@ -31,6 +31,8 @@ Requires-Dist: xlsxwriter (>=3.2.0,<4.0.0)
|
|
|
31
31
|
Project-URL: Repository, https://github.com/SmartBase-SK/django-smartbase-admin
|
|
32
32
|
Description-Content-Type: text/markdown
|
|
33
33
|
|
|
34
|
+
<img width="1660" height="520" alt="image" src="https://github.com/user-attachments/assets/b0d5537f-29c4-46ca-b514-9862b26cb000" />
|
|
35
|
+
|
|
34
36
|
# Django SmartBase Admin
|
|
35
37
|
|
|
36
38
|
A modern, modular, and developer-friendly admin interface for Django.
|
|
@@ -50,8 +52,18 @@ Built to **speed up development** of internal tools and admin panels — beautif
|
|
|
50
52
|
- Beautiful modern UI (Tailwind CSS)
|
|
51
53
|
- Responsive & mobile-friendly
|
|
52
54
|
- End-user ready for building SaaS or similar projects with global queryset configuration
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/ebbcacea-9052-409e-99bb-9f9e0804bbc5" />
|
|
56
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/8003df6a-e035-4c8f-8e90-0e710818d33e" />
|
|
57
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/29e116de-a8c6-4f22-8485-3e0eba5ed564" />
|
|
58
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/46aefe59-e49c-4483-ba1f-eb18397db6ae" />
|
|
59
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/ea354dcb-b4a9-47af-8046-ba0d55d72746" />
|
|
60
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/10a5d75c-ae3e-4e2b-aeb2-e943e6363a2f" />
|
|
61
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/3e6bfdbb-0c07-4fad-96f0-552cbcc9d4ae" />
|
|
62
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/b3acd00b-c425-4e5f-b113-97215bb85157" />
|
|
63
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/dc5f3f80-3325-4f5d-acec-236d6b241a7f" />
|
|
64
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/216d4e50-5af4-4e57-8649-1211a82f493e" />
|
|
65
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/167461dd-ec2e-4327-a208-4014f42100f9" />
|
|
66
|
+
<img width="2880" height="1720" alt="image" src="https://github.com/user-attachments/assets/3871e505-1bc9-4a6c-8457-4ad363a582af" />
|
|
55
67
|
|
|
56
68
|
|
|
57
69
|
## 📚 Full Documentation (in progress)
|
|
@@ -68,7 +68,7 @@ django_smartbase_admin/static/sb_admin/dist/calendar_style.js,sha256=47DEQpj8HBS
|
|
|
68
68
|
django_smartbase_admin/static/sb_admin/dist/chart.js,sha256=nBru0P3RvzaNeQch6qkuL1Wi_c9ICz94HXLXmyYTMW8,205022
|
|
69
69
|
django_smartbase_admin/static/sb_admin/dist/chart.js.LICENSE.txt,sha256=m7M__mzLlrKDz-hky_AC848p_HzYWhziwCLIpXMsj4I,257
|
|
70
70
|
django_smartbase_admin/static/sb_admin/dist/confirmation_modal.js,sha256=glK-x4oxSAHqiabqXmNFE3FRtzMbpg7TgZiKcPle9_o,1745
|
|
71
|
-
django_smartbase_admin/static/sb_admin/dist/main.js,sha256=
|
|
71
|
+
django_smartbase_admin/static/sb_admin/dist/main.js,sha256=bXOY37fH210zR-QnfJh3S0rWn08LTnMozqmU-D4sahE,383000
|
|
72
72
|
django_smartbase_admin/static/sb_admin/dist/main.js.LICENSE.txt,sha256=Z8-1IrzhOFV3eE_WGR7SRfbzN9GRXsvfiU7_E_BkX-k,5600
|
|
73
73
|
django_smartbase_admin/static/sb_admin/dist/main_style.css,sha256=Z1TXgv-meax_fdZoNqRZqCjaDal89hik4lqFSa_KUtY,178358
|
|
74
74
|
django_smartbase_admin/static/sb_admin/dist/main_style.js,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -539,7 +539,7 @@ django_smartbase_admin/static/sb_admin/src/js/code.js,sha256=Q1jKpTsUZhxhaGDRrqH
|
|
|
539
539
|
django_smartbase_admin/static/sb_admin/src/js/confirmation_modal.js,sha256=9xycy0sYJfT0SxeDucbOmvg9gHSrBo3KngZjCAHkVMM,3610
|
|
540
540
|
django_smartbase_admin/static/sb_admin/src/js/datepicker.js,sha256=Nnc28kngTOnb8d2q6NOFGismUVp6l-sTVeBu3M1DgJY,6704
|
|
541
541
|
django_smartbase_admin/static/sb_admin/src/js/datepicker_plugins.js,sha256=DVIyCJpxn8Gx1mx3QHxbRN4nlpJRlilKix6BK_zcUVc,12382
|
|
542
|
-
django_smartbase_admin/static/sb_admin/src/js/main.js,sha256=
|
|
542
|
+
django_smartbase_admin/static/sb_admin/src/js/main.js,sha256=Rjlg0YWhiqHsstv1KuWioopb03kLulT97Q3WIkkncA0,15847
|
|
543
543
|
django_smartbase_admin/static/sb_admin/src/js/multiselect.js,sha256=GuWjIpdkfvXi-oBNdK3gImjrzef4550MKMy71iYrywk,4066
|
|
544
544
|
django_smartbase_admin/static/sb_admin/src/js/range.js,sha256=k_1EIK0R-mrg3ScopUm2UDuYeaCg_VLTjtdJoN-8MXc,1794
|
|
545
545
|
django_smartbase_admin/static/sb_admin/src/js/sb_ajax_params_tabulator_modifier.js,sha256=vJsAfRlXYeUH-hXLyVukim-UBRUHhv2J9UZHKAALOKo,650
|
|
@@ -707,7 +707,7 @@ django_smartbase_admin/templates/sb_admin/widgets/tree_select_inline.html,sha256
|
|
|
707
707
|
django_smartbase_admin/templates/sb_admin/widgets/url.html,sha256=piw2218tiWPfOwncIvSGAW14Gc5FIzkL_YllirK4yTs,160
|
|
708
708
|
django_smartbase_admin/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
709
709
|
django_smartbase_admin/templatetags/base.py,sha256=XF1wUQxUjULXfdlV-PeHvITfbw65LTHjlDzRikJa_F4,1520
|
|
710
|
-
django_smartbase_admin/templatetags/sb_admin_tags.py,sha256=
|
|
710
|
+
django_smartbase_admin/templatetags/sb_admin_tags.py,sha256=Xd5Y3zPBTr7Rkg-V2-X47YH8YoqCGr831SudZrHKYb8,9656
|
|
711
711
|
django_smartbase_admin/urls.py,sha256=Bjdewssljt0LIefjixBem9JN0kkghPvmrIETj3GdXbY,17
|
|
712
712
|
django_smartbase_admin/utils.py,sha256=1SHuRAeEvXsPOHdE525o9iHTLY7DT6auUCx2mBa_w2Q,3400
|
|
713
713
|
django_smartbase_admin/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -715,8 +715,8 @@ django_smartbase_admin/views/dashboard_view.py,sha256=Rgdq3r3JoAGfi2oUC1N_8ZE5KX
|
|
|
715
715
|
django_smartbase_admin/views/global_filter_view.py,sha256=eYo1moJGyi7jc2cPDA5ZBiEgA7Hmc-DxbQvbqUpDkg8,1127
|
|
716
716
|
django_smartbase_admin/views/media_view.py,sha256=5BLWXuzynF7nM34t-mf2BQSRN5ojY8HxpLIqt7Jiq9g,292
|
|
717
717
|
django_smartbase_admin/views/translations_view.py,sha256=hktmkJIZ0EJxgnzjHLIoRDY0ckFa5wkbaoFZg32UWYw,20441
|
|
718
|
-
django_smartbase_admin/views/user_config_view.py,sha256=
|
|
719
|
-
django_smartbase_admin-1.0.
|
|
720
|
-
django_smartbase_admin-1.0.
|
|
721
|
-
django_smartbase_admin-1.0.
|
|
722
|
-
django_smartbase_admin-1.0.
|
|
718
|
+
django_smartbase_admin/views/user_config_view.py,sha256=hUSmwxgGXJog7vhiD-zGpm6smo31sLNzW2VoXapHIjc,1865
|
|
719
|
+
django_smartbase_admin-1.0.25.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
|
|
720
|
+
django_smartbase_admin-1.0.25.dist-info/METADATA,sha256=7qYTCnFsx-UWdYsInkUY1rLBFiu1XqJNMY4TjoSJgME,6924
|
|
721
|
+
django_smartbase_admin-1.0.25.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
722
|
+
django_smartbase_admin-1.0.25.dist-info/RECORD,,
|
{django_smartbase_admin-1.0.23.dist-info → django_smartbase_admin-1.0.25.dist-info}/LICENSE.md
RENAMED
|
File without changes
|
|
File without changes
|