django-smartbase-admin 1.0.13__py3-none-any.whl → 1.0.14__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.
@@ -18,9 +18,11 @@ export default class Multiselect {
18
18
  el.checked = e.target.checked
19
19
  })
20
20
  } else {
21
- selectAllEl.checked = false
21
+ if(selectAllEl) {
22
+ selectAllEl.checked = false
23
+ }
22
24
  }
23
- if(!checkboxes.some(el => el.checked) && selectAllEl) {
25
+ if(selectAllEl && !checkboxes.some(el => el.checked)) {
24
26
  selectAllEl.checked = true
25
27
  }
26
28
  let checked = []
@@ -40,7 +40,7 @@
40
40
  </div>
41
41
  {% else %}
42
42
  <div class="detail-view-header py-16 md:pb-32 flex items-center max-xs:px-20 w-full max-w-1180 mx-auto">
43
- {% if not is_popup and has_view_permission %}
43
+ {% if not is_popup and has_view_permission and show_back_button %}
44
44
  {% url opts|admin_urlname:'changelist' as changelist_url %}
45
45
  <a href="{% add_preserved_filters changelist_url %}" class="btn p-0 w-40 mr-16">
46
46
  <svg class="w-20 h-20">
@@ -219,27 +219,29 @@
219
219
  {% else %}
220
220
  {% url opts|admin_urlname:'add' as post_url %}
221
221
  {% endif %}
222
- <button
223
- form="{% if sbadmin_is_modal %}modal_{% endif %}{{ opts.model_name }}_form"
224
- hx-post="{{ post_url }}"
225
- hx-target="#sb-admin-modal .modal-content"
226
- hx-swap="innerHTML"
227
- hx-select="#content"
228
- hx-encoding="multipart/form-data"
229
- hx-vals='{
230
- "sbadmin_is_modal": 1,
231
- "sb_admin_source_field": "{{ request.GET.sb_admin_source_field }}",
232
- "sbadmin_reload_on_save": {% if sbadmin_reload_on_save %}1{% else %}0{% endif %},
233
- "sbadmin_parent_instance_field": "{{ request.GET.sbadmin_parent_instance_field }}",
234
- "sbadmin_parent_instance_pk": "{{ request.GET.sbadmin_parent_instance_pk | default:"" }}",
235
- "sbadmin_parent_instance_label": "{{ request.GET.sbadmin_parent_instance_label }}"
236
- }'
237
- class="btn btn-primary flex-grow flex items-center justify-center">
238
- <svg class="w-20 h-20 mr-8">
239
- <use xlink:href="#Save"></use>
240
- </svg>
241
- {% trans 'Save' %}
242
- </button>
222
+ {% if has_change_permission %}
223
+ <button
224
+ form="{% if sbadmin_is_modal %}modal_{% endif %}{{ opts.model_name }}_form"
225
+ hx-post="{{ post_url }}"
226
+ hx-target="#sb-admin-modal .modal-content"
227
+ hx-swap="innerHTML"
228
+ hx-select="#content"
229
+ hx-encoding="multipart/form-data"
230
+ hx-vals='{
231
+ "sbadmin_is_modal": 1,
232
+ "sb_admin_source_field": "{{ request.GET.sb_admin_source_field }}",
233
+ "sbadmin_reload_on_save": {% if sbadmin_reload_on_save %}1{% else %}0{% endif %},
234
+ "sbadmin_parent_instance_field": "{{ request.GET.sbadmin_parent_instance_field }}",
235
+ "sbadmin_parent_instance_pk": "{{ request.GET.sbadmin_parent_instance_pk | default:"" }}",
236
+ "sbadmin_parent_instance_label": "{{ request.GET.sbadmin_parent_instance_label }}"
237
+ }'
238
+ class="btn btn-primary flex-grow flex items-center justify-center">
239
+ <svg class="w-20 h-20 mr-8">
240
+ <use xlink:href="#Save"></use>
241
+ </svg>
242
+ {% trans 'Save' %}
243
+ </button>
244
+ {% endif %}
243
245
  <button type="button"
244
246
  class="btn flex-grow"
245
247
  data-bs-dismiss="modal" aria-label="Close">
@@ -269,7 +271,7 @@
269
271
  </div>
270
272
  {% endif %}
271
273
  <div class="flex ml-auto gap-8">
272
- {% if not is_popup and has_view_permission %}
274
+ {% if not is_popup and has_view_permission and show_back_button %}
273
275
  {% url opts|admin_urlname:'changelist' as changelist_url %}
274
276
  <a href="{% add_preserved_filters changelist_url %}" class="btn btn-empty">{% trans 'Back' %}</a>
275
277
  {% endif %}
@@ -3,23 +3,23 @@
3
3
  {% block content %}
4
4
  {% block header %}
5
5
  {% if fieldset.name %}
6
- <header class="mb-24">
6
+ <header class="mb-24 flex items-center">
7
7
  <span class="text-dark-900">{{ fieldset.name }}</span>
8
- <div class="ml-auto flex items-center">
8
+ {% block description %}
9
+ {% if fieldset.description %}
10
+ <div class="js-tooltip ml-8" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ fieldset.description|safe }}">
11
+ <svg class="w-20 h-20">
12
+ <use xlink:href="#Help"></use>
13
+ </svg>
14
+ </div>
15
+ {% endif %}
16
+ {% endblock %}
17
+ <div class="ml-auto flex items-center gap-4">
9
18
  {% block actions %}
10
19
  {% for action in fieldset_context.actions %}
11
20
  <a href="{{ action.url }}" class="btn btn-small">{{ action.title }}</a>
12
21
  {% endfor %}
13
22
  {% endblock %}
14
- {% block description %}
15
- {% if fieldset.description %}
16
- <div class="js-tooltip ml-8" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ fieldset.description|safe }}">
17
- <svg class="w-20 h-20">
18
- <use xlink:href="#Help"></use>
19
- </svg>
20
- </div>
21
- {% endif %}
22
- {% endblock %}
23
23
  </div>
24
24
  </header>
25
25
  {% endif %}
@@ -42,7 +42,10 @@ def render_notifications(request):
42
42
 
43
43
  def is_modal(request):
44
44
  from django_smartbase_admin.engine.admin_base_view import SBADMIN_IS_MODAL_VAR
45
- return request and (SBADMIN_IS_MODAL_VAR in request.GET or SBADMIN_IS_MODAL_VAR in request.POST)
45
+
46
+ return request and (
47
+ SBADMIN_IS_MODAL_VAR in request.GET or SBADMIN_IS_MODAL_VAR in request.POST
48
+ )
46
49
 
47
50
 
48
51
  class FormFieldsetMixin(forms.Form):
@@ -208,11 +208,17 @@ class ModelTranslationView(SBAdminView, SBAdminBaseListView):
208
208
 
209
209
  def format_translation_status(self, object_id, value):
210
210
  if value == self.TRANSLATION_NOT_TRANSLATED:
211
- return mark_safe(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>')
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
+ )
212
214
  if value == self.TRANSLATION_INCOMPLETE:
213
- return mark_safe(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>')
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
+ )
214
218
  if value == self.TRANSLATION_TRANSLATED:
215
- return mark_safe(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>')
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
+ )
216
222
 
217
223
  def get_translated_fields(self):
218
224
  return SBAdminTranslationsService.get_translated_fields_for_model(self.model)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-smartbase-admin
3
- Version: 1.0.13
3
+ Version: 1.0.14
4
4
  Summary:
5
5
  Home-page: https://smartbase-sk.github.io/django-smartbase-admin-docs/
6
6
  License: MIT
@@ -3,9 +3,9 @@ django_smartbase_admin/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
3
3
  django_smartbase_admin/actions/admin_action_list.py,sha256=F4b_KmXzuPaKywZK6lq1rYby0CCFU4aMIjv0xoAaUn8,19621
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=hYK8t_CB6spIk5q4zXyS844Z1TErZIKlQJkDn-ZETIc,46405
6
+ django_smartbase_admin/admin/admin_base.py,sha256=FqH-5gxMWIkY_ObBLnOXiEAHzGJygp2qm7S0J7GX4Dw,47200
7
7
  django_smartbase_admin/admin/site.py,sha256=VrJBhwgZsLa2GohvjnNL7m4dVR3S4Ou1V1UzfE1qOoQ,6577
8
- django_smartbase_admin/admin/widgets.py,sha256=8JZlQHScRCQvrUES-oJRO_MXZYWoqUupsxXesqdlraM,25304
8
+ django_smartbase_admin/admin/widgets.py,sha256=VlOUEfC9due8Iyqpb6G3uQETEBHwubSXJ_XeIJSDBAY,25461
9
9
  django_smartbase_admin/apps.py,sha256=C1wT1YUEZNKcUJfpD01nIZEFgYEsuav52WFKvEURRDU,545
10
10
  django_smartbase_admin/compilemessages.py,sha256=-_FEFQlOvE4L8UzSuUxSxZQjgGlwL9IZtmg59fW_kIQ,342
11
11
  django_smartbase_admin/engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -13,7 +13,7 @@ django_smartbase_admin/engine/actions.py,sha256=vmwMmo1mxxHSLTlbNwbH6h9ulxwDVJnF
13
13
  django_smartbase_admin/engine/admin_base_view.py,sha256=EN9X_cECVf_jKO4pNQEJeQ9uKq8T4WPvaGpdCsIlEDY,31724
14
14
  django_smartbase_admin/engine/admin_entrypoint_view.py,sha256=jfMfcYPfdre2abHfC4KIxaP_epJFuCeTcujGhGd4Tl4,624
15
15
  django_smartbase_admin/engine/admin_view.py,sha256=9wGffahDR3IYmhL9ZbX8uitwGdXdw5DIL5GnWBawmJM,4238
16
- django_smartbase_admin/engine/configuration.py,sha256=fg7CeG7Viv-QFx0S-uuk_P-_16Nl54gqj6-MXJUkK88,8422
16
+ django_smartbase_admin/engine/configuration.py,sha256=L6VYNkZrfOaVUK9fMSlwAsCU9zyRHqUpWGYHyx47VWA,8322
17
17
  django_smartbase_admin/engine/const.py,sha256=BP5I2UcCtV0bIlk_YUuVFHrDHRM9-gbCL0sJUX-q4Wo,2600
18
18
  django_smartbase_admin/engine/dashboard.py,sha256=d2DgixV1olL4jXFylcOfRsJZ4GfjqFAjYLgb_Wwyzas,24321
19
19
  django_smartbase_admin/engine/fake_inline.py,sha256=tGLX3yHANYBsVPcDk6yQqn8RN-JGdaV-RdHcxh9-61w,6190
@@ -21,7 +21,7 @@ django_smartbase_admin/engine/field.py,sha256=AkcEs9hYqIJHy9cLgchWfC1wpWTRzFNm7b
21
21
  django_smartbase_admin/engine/field_formatter.py,sha256=Ma4GoO2DMgCtx-zy_hgyW_095GWwflMdn8uN4GUatgw,2087
22
22
  django_smartbase_admin/engine/filter_widgets.py,sha256=jGx1LuuprJ0DxwxbuyN_Oym3HKsqSJjePzyapFBcedo,31881
23
23
  django_smartbase_admin/engine/global_filter_form.py,sha256=jlj6e9VYWDPyUNjcgj3gTIkCZXO01NZOWAeU3jFtkoA,249
24
- django_smartbase_admin/engine/menu_item.py,sha256=rMJFG5xm1T0wF8lUmiAZHzKtt9C0LdbpRFvaP0PlngM,2936
24
+ django_smartbase_admin/engine/menu_item.py,sha256=HP5EwjxBYygAg72RsgQyde62DI9CDg_pDzc8FqlUPEc,3028
25
25
  django_smartbase_admin/engine/modal_view.py,sha256=Qzx9kd9shoqCYes_lYkAvX1ItVL41oi2vORUrYUkZkE,2269
26
26
  django_smartbase_admin/engine/request.py,sha256=sFjxgmzGXUeCD3hEx-Eu-ebgF8CnrBJDH2e8LF1ieRg,2615
27
27
  django_smartbase_admin/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -65,7 +65,7 @@ django_smartbase_admin/static/sb_admin/dist/calendar_style.js,sha256=47DEQpj8HBS
65
65
  django_smartbase_admin/static/sb_admin/dist/chart.js,sha256=85FPvSgZ2k34GIAKx1tLWF2vRas2cKDFQYIqFAvPOQ8,204926
66
66
  django_smartbase_admin/static/sb_admin/dist/chart.js.LICENSE.txt,sha256=m7M__mzLlrKDz-hky_AC848p_HzYWhziwCLIpXMsj4I,257
67
67
  django_smartbase_admin/static/sb_admin/dist/confirmation_modal.js,sha256=glK-x4oxSAHqiabqXmNFE3FRtzMbpg7TgZiKcPle9_o,1745
68
- django_smartbase_admin/static/sb_admin/dist/main.js,sha256=UMkpYF4PIYLw1aqB3FZmL6n0Gain9gVNEza8jYUKUkk,381417
68
+ django_smartbase_admin/static/sb_admin/dist/main.js,sha256=ZJO-eAgrMSjUCq-GF1FvU-XlSEi_1R3IlFiIxkyNaIo,381422
69
69
  django_smartbase_admin/static/sb_admin/dist/main.js.LICENSE.txt,sha256=Z8-1IrzhOFV3eE_WGR7SRfbzN9GRXsvfiU7_E_BkX-k,5600
70
70
  django_smartbase_admin/static/sb_admin/dist/main_style.css,sha256=WDtNcpYLr9m9X0XpRjJi-a4UjO83aySrOqQIa_RfZXM,170414
71
71
  django_smartbase_admin/static/sb_admin/dist/main_style.js,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -534,7 +534,7 @@ django_smartbase_admin/static/sb_admin/src/js/confirmation_modal.js,sha256=9xycy
534
534
  django_smartbase_admin/static/sb_admin/src/js/datepicker.js,sha256=Nnc28kngTOnb8d2q6NOFGismUVp6l-sTVeBu3M1DgJY,6704
535
535
  django_smartbase_admin/static/sb_admin/src/js/datepicker_plugins.js,sha256=d_EkPi0qv_74diVL4inJs8n1os4t1Ss6hp6-gY4_6hU,12368
536
536
  django_smartbase_admin/static/sb_admin/src/js/main.js,sha256=YdfwkKJjj_PCK0-2NzpzlQqWQgU53pB3uIpP-vu9al8,13466
537
- django_smartbase_admin/static/sb_admin/src/js/multiselect.js,sha256=OlOTrBFR-Ds1as57G3al_3MJq5-_N77ytZngor1Q0UQ,4336
537
+ django_smartbase_admin/static/sb_admin/src/js/multiselect.js,sha256=7_AIEnsAv_Cq7lo-G9D66w51fiY_qsaQAV3hfEseD-Y,4408
538
538
  django_smartbase_admin/static/sb_admin/src/js/range.js,sha256=k_1EIK0R-mrg3ScopUm2UDuYeaCg_VLTjtdJoN-8MXc,1794
539
539
  django_smartbase_admin/static/sb_admin/src/js/sb_ajax_params_tabulator_modifier.js,sha256=vJsAfRlXYeUH-hXLyVukim-UBRUHhv2J9UZHKAALOKo,650
540
540
  django_smartbase_admin/static/sb_admin/src/js/sidebar.js,sha256=gx0MqnLWIRb26-GDvETQ7CE4DucP-L-9-hZ9-oFjuUw,1570
@@ -555,7 +555,7 @@ django_smartbase_admin/static/sb_admin/src/js/table_modules/views_module.js,sha2
555
555
  django_smartbase_admin/static/sb_admin/src/js/translations.js,sha256=GEizlr_D5yDj00i7jKENkWfDr6gZcg4RQ1Nek22WP4g,954
556
556
  django_smartbase_admin/static/sb_admin/src/js/tree_widget.js,sha256=rL0znvFm85f74HzNwf9YmUpenV7WfEAr79dD9M4BdxA,18225
557
557
  django_smartbase_admin/static/sb_admin/src/js/utils.js,sha256=QsT-fmobc0HGFLhK5ZZlHnxX4wtbJ7nLxkWOkSJuxjY,4812
558
- django_smartbase_admin/templates/sb_admin/actions/change_form.html,sha256=ebpiYKrU7F9-fgV9e6dtHBplNSi8JcBzGqoruS3c7eI,16464
558
+ django_smartbase_admin/templates/sb_admin/actions/change_form.html,sha256=54GrK9tBP3uHnyu7elNYrOyFx9P7dx0lMFnJgryomNk,16673
559
559
  django_smartbase_admin/templates/sb_admin/actions/change_password.html,sha256=LhciaKCvlywKMJ6gY9JbEaTkOXjNSFO-mAnWIZfk6sA,3200
560
560
  django_smartbase_admin/templates/sb_admin/actions/dashboard.html,sha256=KLy4Ix4Bs8u_-e2d6HT4Fz8MoAOsS2boCpD8qsnaHxU,279
561
561
  django_smartbase_admin/templates/sb_admin/actions/delete_confirmation.html,sha256=4AeJLqGGPVBYXS9XQSNTnMvsT3I6QttyNLThE8gEZHE,3205
@@ -622,7 +622,7 @@ django_smartbase_admin/templates/sb_admin/includes/change_form_title.html,sha256
622
622
  django_smartbase_admin/templates/sb_admin/includes/components.html,sha256=ixhN__EcMbCfjXQXdCElda18sqWZYj9scV3nsR9nXts,18822
623
623
  django_smartbase_admin/templates/sb_admin/includes/confirmation.html,sha256=F2lgUPCIF6pveCSyS7L4k8ifZxa_DoJp-NZb4uwmtyI,1844
624
624
  django_smartbase_admin/templates/sb_admin/includes/fieldset.html,sha256=cSaqkdB2OOMXW4UFysoDQP4x-Wm4fgMtClPHqHepv1o,280
625
- django_smartbase_admin/templates/sb_admin/includes/inline_fieldset.html,sha256=N8rlUUzlaHGOG_NDtjV6XvKL3whxkDA7jFBVS0D5qys,2592
625
+ django_smartbase_admin/templates/sb_admin/includes/inline_fieldset.html,sha256=TkebKOOyeDC_2l4Em4bJ6uOIKbSNqVI8GJmC5b970DU,2580
626
626
  django_smartbase_admin/templates/sb_admin/includes/loading.html,sha256=mI-Ya6y0vTOqPVUS9n_GPXmQDvyaDdL9637I5oqcnBE,287
627
627
  django_smartbase_admin/templates/sb_admin/includes/loading_absolute.html,sha256=Eck62NW9ByTw6Mu5QOcYZZJVebhRUNbxTB29XmN5drE,304
628
628
  django_smartbase_admin/templates/sb_admin/includes/notifications.html,sha256=wEEcrcdX3Wrlz-tVCJouiUFSZV_vVEqrc5opV_nifAw,783
@@ -702,13 +702,13 @@ django_smartbase_admin/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQ
702
702
  django_smartbase_admin/templatetags/base.py,sha256=XF1wUQxUjULXfdlV-PeHvITfbw65LTHjlDzRikJa_F4,1520
703
703
  django_smartbase_admin/templatetags/sb_admin_tags.py,sha256=V8EUaS1adBAbmJ49Ntmoj2cXnDiAt7VQEbVXvCiNT_Q,9374
704
704
  django_smartbase_admin/urls.py,sha256=Bjdewssljt0LIefjixBem9JN0kkghPvmrIETj3GdXbY,17
705
- django_smartbase_admin/utils.py,sha256=P8H2PbaHnF47eRkfMJXDZMkJwcLVZHLfD5YZIHndwUU,3385
705
+ django_smartbase_admin/utils.py,sha256=1SHuRAeEvXsPOHdE525o9iHTLY7DT6auUCx2mBa_w2Q,3400
706
706
  django_smartbase_admin/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
707
707
  django_smartbase_admin/views/dashboard_view.py,sha256=Rgdq3r3JoAGfi2oUC1N_8ZE5KXuI5S4MmRxIkT-EN78,1812
708
708
  django_smartbase_admin/views/global_filter_view.py,sha256=eYo1moJGyi7jc2cPDA5ZBiEgA7Hmc-DxbQvbqUpDkg8,1127
709
709
  django_smartbase_admin/views/media_view.py,sha256=5BLWXuzynF7nM34t-mf2BQSRN5ojY8HxpLIqt7Jiq9g,292
710
- django_smartbase_admin/views/translations_view.py,sha256=JlAE9EPrTmbEVXqX7r0NjdbEv0c9BK3YDj_BYCIPPck,20351
711
- django_smartbase_admin-1.0.13.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
712
- django_smartbase_admin-1.0.13.dist-info/METADATA,sha256=hO_NjO4x2ALpAwWUSZQ734dYZefSW_ccd1ZyAaTUdMo,5375
713
- django_smartbase_admin-1.0.13.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
714
- django_smartbase_admin-1.0.13.dist-info/RECORD,,
710
+ django_smartbase_admin/views/translations_view.py,sha256=hktmkJIZ0EJxgnzjHLIoRDY0ckFa5wkbaoFZg32UWYw,20441
711
+ django_smartbase_admin-1.0.14.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
712
+ django_smartbase_admin-1.0.14.dist-info/METADATA,sha256=TdgH3VDwuQrc9f7U2KJPDFBgVGx5isM8W4M8Fq2lzmw,5375
713
+ django_smartbase_admin-1.0.14.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
714
+ django_smartbase_admin-1.0.14.dist-info/RECORD,,