django-smartbase-admin 0.2.100__py3-none-any.whl → 1.0.0__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.
@@ -49,6 +49,20 @@ class Main {
49
49
  window.open(e.detail.url, e.detail?.target || '_blank')
50
50
  })
51
51
 
52
+ if(window.htmx){
53
+ window.htmx.on("htmx:afterSwap", (detail) => {
54
+ const requestEl = detail.detail.requestConfig.elt.closest('[hx-swap]')
55
+ if(requestEl && requestEl.getAttribute('hx-swap') === "none") {
56
+ // do not process afterSwap if none swap is performed
57
+ // this should prevent double processing of afterSwap for first oob-swapped element
58
+ // which in case of hx-swap=none is returned here in the detail.target
59
+ return
60
+ }
61
+ this.initFileInputs(detail.target)
62
+ this.initDropdowns(detail.target)
63
+ })
64
+ }
65
+
52
66
  new Sidebar()
53
67
  this.datepicker = new Datepicker()
54
68
  this.range = new Range()
@@ -16,7 +16,7 @@
16
16
  </div>
17
17
  <div class="modal-body">
18
18
  {% block modal_body %}
19
- <form id="sb-admin-modal-form" hx-indicator=".sb-admin-modal-loading" hx-target="#sb-admin-modal" hx-post="{{ request.get_full_path }}" action="{{ request.get_full_path }}" method="post">
19
+ <form id="sb-admin-modal-form" enctype="multipart/form-data" hx-indicator=".sb-admin-modal-loading" hx-target="#sb-admin-modal" hx-post="{{ request.get_full_path }}" action="{{ request.get_full_path }}" method="post">
20
20
  {% if form.errors %}
21
21
  <div class="alert bg-negative-50 border border-negative-100 text-negative-900 mb-24">
22
22
  <div class="flex">
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.1
2
+ Name: django-smartbase-admin
3
+ Version: 1.0.0
4
+ Summary:
5
+ Author: SmartBase
6
+ Author-email: info@smartbase.sk
7
+ Requires-Python: >=3.10,<4.0
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: django (>=4.1,<6.0)
14
+ Requires-Dist: django-admin-inline-paginator (>=0.4.0,<0.5.0)
15
+ Requires-Dist: django-ckeditor (>=6.7.1,<7.0.0)
16
+ Requires-Dist: django-filer (>=3.1.1,<4.0.0)
17
+ Requires-Dist: django-htmx (>=1.17.3,<2.0.0)
18
+ Requires-Dist: django-nested-admin (>=4.0.2,<5.0.0)
19
+ Requires-Dist: django-widget-tweaks (>=1.5.0,<2.0.0)
20
+ Requires-Dist: easy-thumbnails[svg] (>=2.8.5,<3.0.0)
21
+ Requires-Dist: setuptools (>=67.0.0,<68.0.0)
22
+ Requires-Dist: xlsxwriter (>=3.2.0,<4.0.0)
23
+ Description-Content-Type: text/markdown
24
+
25
+ # Django SmartBase Admin
26
+
27
+ A modern, modular, and developer-friendly admin interface for Django.
28
+ Built to **speed up development** of internal tools and admin panels — beautifully and efficiently.
29
+
30
+ ---
31
+
32
+ ## ✨ Features
33
+ - Fast integration with any Django project
34
+ - Improved performance of Django List Admin using `SBAdminField`, database `annotate()` and `values()` to avoid direct object access
35
+ - Simple configuration of menu structure, dashboard components, and permissions per user role
36
+ - Enhanced Django List Admin filters: autocomplete support for related fields and filtering across all model fields
37
+ - Ability for users to save and reuse custom filters in Django List Admin
38
+ - Improved Django Detail Admin with autocomplete for relational fields
39
+ - Support for "FakeInlines" – define inline-like blocks without requiring a direct model relationship
40
+ - Easy extension of list and detail views with custom actions and corresponding views
41
+ - Beautiful modern UI (Tailwind CSS)
42
+ - Responsive & mobile-friendly
43
+
44
+ ![image](https://github.com/user-attachments/assets/b99a35b0-05fd-45e3-a165-950b0d4750cd)
45
+ ![image](https://github.com/user-attachments/assets/f7719377-eb88-42c4-8fe0-5d4ca0ff29bf)
46
+
47
+
48
+ ## 📚 Full Documentation (in progress)
49
+
50
+ 🗂 [View Full Docs](https://smartbase-sk.github.io/django-smartbase-admin-docs/docs/installation)
51
+
52
+ ## ⚡ Quick Start
53
+
54
+ ### 1. Install Smartbase Admin
55
+
56
+ Begin by installing the Smartbase Admin package using `pip`:
57
+
58
+ ```bash
59
+ pip install django-smartbase-admin
60
+ ```
61
+
62
+ 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`:
63
+ ```python
64
+ INSTALLED_APPS = [
65
+ # other apps
66
+ "django_smartbase_admin",
67
+ "easy_thumbnails",
68
+ "widget_tweaks",
69
+ ]
70
+ ```
71
+
72
+ ### 2. Add Admin URL Configuration
73
+ In your project’s `urls.py`, register the Smartbase Admin site by importing sb_admin_site and adding the path:
74
+ ```python
75
+ from django_smartbase_admin.admin.site import sb_admin_site
76
+
77
+ urlpatterns = [
78
+ path("sb-admin/", sb_admin_site.urls),
79
+ # other paths
80
+ ]
81
+ ```
82
+ This makes the Smartbase Admin interface accessible at `/sb-admin/`
83
+
84
+ ### 3. Define the SmartBase Admin Configuration
85
+ In your project, for example in `config` package create a file called `sbadmin_config.py` with the following content:
86
+ ```python
87
+ from django_smartbase_admin.engine.configuration import SBAdminConfigurationBase, SBAdminRoleConfiguration
88
+ from django_smartbase_admin.views.dashboard_view import SBAdminDashboardView
89
+ from django_smartbase_admin.engine.menu_item import SBAdminMenuItem
90
+
91
+ config = SBAdminRoleConfiguration(
92
+ default_view=SBAdminMenuItem(view_id="dashboard"),
93
+ menu_items=[
94
+ SBAdminMenuItem(view_id="dashboard", icon="All-application"),
95
+ ],
96
+ registered_views=[
97
+ SBAdminDashboardView(widgets=[], title="Dashboard"),
98
+ ],
99
+ )
100
+
101
+ class SBAdminConfiguration(SBAdminConfigurationBase):
102
+ def get_configuration_for_roles(self, user_roles):
103
+ return config
104
+ ```
105
+
106
+ ### 4. Reference the Configuration in `settings.py`
107
+ ```python
108
+ SB_ADMIN_CONFIGURATION = "config.sbadmin_config.SBAdminConfiguration"
109
+ ```
110
+
111
+ ### 5. Add Locale Middleware
112
+ Add the following middleware to support internationalization:
113
+ ```python
114
+ MIDDLEWARE = [
115
+ # Other middleware...
116
+ 'django.middleware.locale.LocaleMiddleware',
117
+ ]
118
+ ```
119
+
120
+ ## 🤝 Need Help with Development?
121
+ We at SmartBase are experts in Django and custom software.
122
+
123
+ Whether you're building a new platform or modernizing an internal tool —
124
+ 💡 We can help you design, build, and scale it.
125
+
126
+ 📬 [Let’s talk](https://en.smartbase.sk/contact-us/) — We’d love to work with you.
127
+
@@ -1,9 +1,9 @@
1
1
  django_smartbase_admin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  django_smartbase_admin/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- django_smartbase_admin/actions/admin_action_list.py,sha256=VXPQU-mDAQytyNDKioyQp1q1F0yOZ2VV1HpX3Ap7A4k,19375
3
+ django_smartbase_admin/actions/admin_action_list.py,sha256=lV-2HBqwip5uyX1FrpXXPxWvqDoP7-j6F1efYEW8KSo,19807
4
4
  django_smartbase_admin/actions/advanced_filters.py,sha256=Vm8b6TAwNehR8INjolFG7pEYL4ADO7XUiVOWpb0btM0,13481
5
5
  django_smartbase_admin/admin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- django_smartbase_admin/admin/admin_base.py,sha256=dInknwstu6miwpJetdHqEJ0FAFr1lzNCF9fX44qWLL4,41535
6
+ django_smartbase_admin/admin/admin_base.py,sha256=Dnql1LQVeJWla3ItuHbVgakUXT3apUfWvWc9MmundsQ,41765
7
7
  django_smartbase_admin/admin/site.py,sha256=VrJBhwgZsLa2GohvjnNL7m4dVR3S4Ou1V1UzfE1qOoQ,6577
8
8
  django_smartbase_admin/admin/widgets.py,sha256=LRrjZC79xfPWQOxwH3aGQB6s8UTvyqFGCXpH9vUwNKw,22730
9
9
  django_smartbase_admin/apps.py,sha256=C1wT1YUEZNKcUJfpD01nIZEFgYEsuav52WFKvEURRDU,545
@@ -17,8 +17,8 @@ django_smartbase_admin/engine/configuration.py,sha256=P3iSiPm9QBl9etTDJIWzo7DzOB
17
17
  django_smartbase_admin/engine/const.py,sha256=0-MZFCce8UnTHaL6tkezMXUf4S2ZoSc5HRGi-T7KcHU,2479
18
18
  django_smartbase_admin/engine/dashboard.py,sha256=wrvX0GI-SII2pG0DX8Kvy4JFaM6h8e6R7KSCFddFC64,23642
19
19
  django_smartbase_admin/engine/fake_inline.py,sha256=9C2_mltg2P9-xa3vuoo5X_RcFaCRpKGNSy7t1_iiasE,5802
20
- django_smartbase_admin/engine/field.py,sha256=BD_W0ekE5tQJxUGpUA8bo4ZyFk0u2F_6UTPH4drj0JU,10286
21
- django_smartbase_admin/engine/field_formatter.py,sha256=eHbXEBwG8jBc9zKpDQ4T64N5J4afF0Cbb8RFeFfgQRg,1950
20
+ django_smartbase_admin/engine/field.py,sha256=CzQN_9mYTsnJ6B1HebrGCWLx3RLUZsGmzRuCa1v0fu4,10173
21
+ django_smartbase_admin/engine/field_formatter.py,sha256=Ma4GoO2DMgCtx-zy_hgyW_095GWwflMdn8uN4GUatgw,2087
22
22
  django_smartbase_admin/engine/filter_widgets.py,sha256=mrygiz55wyJzZZUx3QlbVHb4IQrt5YpYcWkWf9JFN5M,31124
23
23
  django_smartbase_admin/engine/global_filter_form.py,sha256=jlj6e9VYWDPyUNjcgj3gTIkCZXO01NZOWAeU3jFtkoA,249
24
24
  django_smartbase_admin/engine/menu_item.py,sha256=rMJFG5xm1T0wF8lUmiAZHzKtt9C0LdbpRFvaP0PlngM,2936
@@ -62,7 +62,7 @@ django_smartbase_admin/static/sb_admin/css/querybuilder/query-builder.default.mi
62
62
  django_smartbase_admin/static/sb_admin/dist/chart.js,sha256=junrr52JM6iSKJ2jIXKbAG7LzjU83w2GCQgaq2rjGOg,204742
63
63
  django_smartbase_admin/static/sb_admin/dist/chart.js.LICENSE.txt,sha256=m7M__mzLlrKDz-hky_AC848p_HzYWhziwCLIpXMsj4I,257
64
64
  django_smartbase_admin/static/sb_admin/dist/confirmation_modal.js,sha256=glK-x4oxSAHqiabqXmNFE3FRtzMbpg7TgZiKcPle9_o,1745
65
- django_smartbase_admin/static/sb_admin/dist/main.js,sha256=h9Gp8zKnySP7zAAEquL8SFnzBkb6DHlUaCMBuRqpkcI,378255
65
+ django_smartbase_admin/static/sb_admin/dist/main.js,sha256=FzqnGlke_CoBdkYz_BgxDSfcD_7rt35woMg3jzlL2xM,378464
66
66
  django_smartbase_admin/static/sb_admin/dist/main.js.LICENSE.txt,sha256=Z8-1IrzhOFV3eE_WGR7SRfbzN9GRXsvfiU7_E_BkX-k,5600
67
67
  django_smartbase_admin/static/sb_admin/dist/main_style.css,sha256=FLc-wlGbb8gDzc7GBFiCRud2uKaJLiKnSX1smQVblVE,161300
68
68
  django_smartbase_admin/static/sb_admin/dist/main_style.js,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -509,7 +509,7 @@ django_smartbase_admin/static/sb_admin/src/js/code.js,sha256=Q1jKpTsUZhxhaGDRrqH
509
509
  django_smartbase_admin/static/sb_admin/src/js/confirmation_modal.js,sha256=9xycy0sYJfT0SxeDucbOmvg9gHSrBo3KngZjCAHkVMM,3610
510
510
  django_smartbase_admin/static/sb_admin/src/js/datepicker.js,sha256=y9S1N5Gnn6-o1bku3b4RtjnF4v4opKXGokrWMKllNck,6607
511
511
  django_smartbase_admin/static/sb_admin/src/js/datepicker_plugins.js,sha256=d_EkPi0qv_74diVL4inJs8n1os4t1Ss6hp6-gY4_6hU,12368
512
- django_smartbase_admin/static/sb_admin/src/js/main.js,sha256=kr6U6y4cDu2LspsqLsw0EsuvxrbahwK42Br0-3RzSFY,9905
512
+ django_smartbase_admin/static/sb_admin/src/js/main.js,sha256=BEvDzFd3B5N1H5JmMGdzeUQmwPExXvq01P_LHzxxJh0,10597
513
513
  django_smartbase_admin/static/sb_admin/src/js/multiselect.js,sha256=-mTD2CNCQyBfZTbVgj9khbdApBo6G1pfHNm7c082gsM,3500
514
514
  django_smartbase_admin/static/sb_admin/src/js/range.js,sha256=Vc_NZMKAUzwYpTC1jf8eOpoP_JJsH6x0fzsWwhsKdts,1752
515
515
  django_smartbase_admin/static/sb_admin/src/js/sb_ajax_params_tabulator_modifier.js,sha256=vJsAfRlXYeUH-hXLyVukim-UBRUHhv2J9UZHKAALOKo,650
@@ -620,7 +620,7 @@ django_smartbase_admin/templates/sb_admin/partials/messages/alert_info.html,sha2
620
620
  django_smartbase_admin/templates/sb_admin/partials/messages/alert_success.html,sha256=nzLbL72AZAuo-NB6AXfRfBydsfiOyPyskqTViKDHZd4,323
621
621
  django_smartbase_admin/templates/sb_admin/partials/messages/alert_warning.html,sha256=K_mFqhyb54olS2_0IyU8ZRb7_WqA0BMxdRZYCsgHTbg,323
622
622
  django_smartbase_admin/templates/sb_admin/partials/modal/modal.html,sha256=SaJkpGaEa_hSSmfL4yqrXfMOf3rvNsF6G2vOX6ngpJw,1508
623
- django_smartbase_admin/templates/sb_admin/partials/modal/modal_content.html,sha256=WiR_qqGvRwe-GHdfB7PWVQqM2RK3gxKynDtW1Ta4Kxg,3221
623
+ django_smartbase_admin/templates/sb_admin/partials/modal/modal_content.html,sha256=_1wrb2GsCvtwQPDl5CUVRgFdcsor25ceHi8UDsPAWt8,3251
624
624
  django_smartbase_admin/templates/sb_admin/sb_admin_base.html,sha256=wVwA5Gv9c_M6rRXIWglu9jFaEwC0NCprniYuaHO19qA,741
625
625
  django_smartbase_admin/templates/sb_admin/sb_admin_base_no_sidebar.html,sha256=-8NTw-o33FPoJxkyPB12OdRemDLXjwDbhgWHSe009DA,4177
626
626
  django_smartbase_admin/templates/sb_admin/sb_admin_js_trans.html,sha256=9oSkJo6Ngwr5T8zkpn6GLcdXNTMa1A7SmgjTlg9jlzY,926
@@ -681,7 +681,7 @@ django_smartbase_admin/views/dashboard_view.py,sha256=vtz5emYTQ5WDFeLA8HrcmjSOVd
681
681
  django_smartbase_admin/views/global_filter_view.py,sha256=eYo1moJGyi7jc2cPDA5ZBiEgA7Hmc-DxbQvbqUpDkg8,1127
682
682
  django_smartbase_admin/views/media_view.py,sha256=5BLWXuzynF7nM34t-mf2BQSRN5ojY8HxpLIqt7Jiq9g,292
683
683
  django_smartbase_admin/views/translations_view.py,sha256=tkShf5IWyPDjNhcPQsvh8WXs-EMRCfG_oTD9x-LP1No,20272
684
- django_smartbase_admin-0.2.100.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
685
- django_smartbase_admin-0.2.100.dist-info/METADATA,sha256=w-v6rBnOan149diGmmsH3n5Gj1v4R0cLmpkFYqZGbrQ,997
686
- django_smartbase_admin-0.2.100.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
687
- django_smartbase_admin-0.2.100.dist-info/RECORD,,
684
+ django_smartbase_admin-1.0.0.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
685
+ django_smartbase_admin-1.0.0.dist-info/METADATA,sha256=db4oGD5Z2zYbwa3g2udG7KgIlUwRZrS97Ip83N4cNJA,4597
686
+ django_smartbase_admin-1.0.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
687
+ django_smartbase_admin-1.0.0.dist-info/RECORD,,
@@ -1,27 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: django-smartbase-admin
3
- Version: 0.2.100
4
- Summary:
5
- Author: SmartBase
6
- Author-email: info@smartbase.sk
7
- Requires-Python: >=3.10,<4.0
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.10
10
- Classifier: Programming Language :: Python :: 3.11
11
- Classifier: Programming Language :: Python :: 3.12
12
- Classifier: Programming Language :: Python :: 3.13
13
- Requires-Dist: django (>=4.1,<6.0)
14
- Requires-Dist: django-admin-inline-paginator (>=0.4.0,<0.5.0)
15
- Requires-Dist: django-ckeditor (>=6.7.1,<7.0.0)
16
- Requires-Dist: django-filer (>=3.1.1,<4.0.0)
17
- Requires-Dist: django-htmx (>=1.17.3,<2.0.0)
18
- Requires-Dist: django-nested-admin (>=4.0.2,<5.0.0)
19
- Requires-Dist: django-widget-tweaks (>=1.5.0,<2.0.0)
20
- Requires-Dist: easy-thumbnails[svg] (>=2.8.5,<3.0.0)
21
- Requires-Dist: setuptools (>=67.0.0,<68.0.0)
22
- Requires-Dist: xlsxwriter (>=3.2.0,<4.0.0)
23
- Description-Content-Type: text/markdown
24
-
25
- # django-smartbase-admin
26
- SmartBase Admin application for Django.
27
-