django-smartbase-admin 0.2.100__py3-none-any.whl → 0.2.101__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,123 @@
1
+ Metadata-Version: 2.1
2
+ Name: django-smartbase-admin
3
+ Version: 0.2.101
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
+ ## 📚 Full Documentation
45
+
46
+ 🗂 [View Full Docs](https://smartbase-sk.github.io/django-smartbase-admin-docs/docs/installation)
47
+
48
+ ## ⚡ Quick Start
49
+
50
+ ### 1. Install Smartbase Admin
51
+
52
+ Begin by installing the Smartbase Admin package using `pip`:
53
+
54
+ ```bash
55
+ pip install django-smartbase-admin
56
+ ```
57
+
58
+ 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`:
59
+ ```python
60
+ INSTALLED_APPS = [
61
+ # other apps
62
+ "django_smartbase_admin",
63
+ "easy_thumbnails",
64
+ "widget_tweaks",
65
+ ]
66
+ ```
67
+
68
+ ### 2. Add Admin URL Configuration
69
+ In your project’s `urls.py`, register the Smartbase Admin site by importing sb_admin_site and adding the path:
70
+ ```python
71
+ from django_smartbase_admin.admin.site import sb_admin_site
72
+
73
+ urlpatterns = [
74
+ path("sb-admin/", sb_admin_site.urls),
75
+ # other paths
76
+ ]
77
+ ```
78
+ This makes the Smartbase Admin interface accessible at `/sb-admin/`
79
+
80
+ ### 3. Define the SmartBase Admin Configuration
81
+ In your project, for example in `config` package create a file called `sbadmin_config.py` with the following content:
82
+ ```python
83
+ from django_smartbase_admin.engine.configuration import SBAdminConfigurationBase, SBAdminRoleConfiguration
84
+ from django_smartbase_admin.views.dashboard_view import SBAdminDashboardView
85
+ from django_smartbase_admin.engine.menu_item import SBAdminMenuItem
86
+
87
+ config = SBAdminRoleConfiguration(
88
+ default_view=SBAdminMenuItem(view_id="dashboard"),
89
+ menu_items=[
90
+ SBAdminMenuItem(view_id="dashboard", icon="All-application"),
91
+ ],
92
+ registered_views=[
93
+ SBAdminDashboardView(widgets=[], title="Dashboard"),
94
+ ],
95
+ )
96
+
97
+ class SBAdminConfiguration(SBAdminConfigurationBase):
98
+ def get_configuration_for_roles(self, user_roles):
99
+ return config
100
+ ```
101
+
102
+ ### 4. Reference the Configuration in `settings.py`
103
+ ```python
104
+ SB_ADMIN_CONFIGURATION = "config.sbadmin_config.SBAdminConfiguration"
105
+ ```
106
+
107
+ ### 5. Add Locale Middleware
108
+ Add the following middleware to support internationalization:
109
+ ```python
110
+ MIDDLEWARE = [
111
+ # Other middleware...
112
+ 'django.middleware.locale.LocaleMiddleware',
113
+ ]
114
+ ```
115
+
116
+ ## 🤝 Need Help with Development?
117
+ We at SmartBase are experts in Django and custom software.
118
+
119
+ Whether you're building a new platform or modernizing an internal tool —
120
+ 💡 We can help you design, build, and scale it.
121
+
122
+ 📬 [Let’s talk](https://en.smartbase.sk/contact-us/) — We’d love to work with you.
123
+
@@ -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-0.2.101.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
685
+ django_smartbase_admin-0.2.101.dist-info/METADATA,sha256=d1g0KZIMQtVsHw5kUJD8c1_DKuF7nrT2HskjX5GgODU,4403
686
+ django_smartbase_admin-0.2.101.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
687
+ django_smartbase_admin-0.2.101.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
-