django-smartbase-admin 1.0.38__py3-none-any.whl → 1.0.40__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.
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ {
4
+ function init_prepopulate(container) {
5
+ const $ = django.jQuery;
6
+ const scripts = container.querySelectorAll('script[id^="sbadmin_prepopulated_fields_"][type="application/json"]');
7
+ for (const el of scripts) {
8
+ let fields = [];
9
+ try {
10
+ fields = JSON.parse(el.textContent);
11
+ } catch (e) {
12
+ fields = [];
13
+ }
14
+ for (const f of fields) {
15
+ $(f.id).data('dependency_list', f.dependency_list).prepopulate(f.dependency_ids, f.maxLength, f.allowUnicode);
16
+ }
17
+ }
18
+ return true;
19
+ }
20
+
21
+ window.init_prepopulate = init_prepopulate;
22
+ init_prepopulate(document);
23
+ }
24
+
25
+
@@ -71,6 +71,12 @@
71
71
  &:focus {
72
72
  @apply text-primary;
73
73
  }
74
+
75
+ .loader,
76
+ .loader:after {
77
+ width: 20px;
78
+ height: 20px;
79
+ }
74
80
  }
75
81
 
76
82
  .btn[data-bs-toggle="dropdown"] {
@@ -20,8 +20,7 @@
20
20
  data-model-name="{{ opts.model_name }}"
21
21
  {% endif %}>
22
22
  </script>
23
- {# JavaScript for prepopulated fields #}
24
- {% prepopulated_fields_js %}
23
+ <script src="{% static 'sb_admin/js/sbadmin_prepopulated_fields_init.js' %}"></script>
25
24
  {% endblock %}
26
25
 
27
26
  {% block content %}
@@ -282,5 +281,11 @@
282
281
  {% endblock %}
283
282
  {% endif %}
284
283
  </form>
284
+ {% sb_admin_prepopulated_fields_init %}
285
+ {% if sbadmin_is_modal %}
286
+ <script>
287
+ init_prepopulate(document.getElementById("modal-content"));
288
+ </script>
289
+ {% endif %}
285
290
  {% endblock %}
286
291
  {% endblock %}
@@ -28,7 +28,7 @@
28
28
  {% for list_action in content_context.list_actions %}
29
29
  {% if not list_action.sub_actions %}
30
30
  <li>
31
- {% include "sb_admin/actions/partials/action_link.html" with action=list_action view_id=view_id extra_classes="dropdown-menu-link items-center" %}
31
+ {% include list_action.template with action=list_action view_id=view_id dropdown=True extra_classes="dropdown-menu-link items-center" %}
32
32
  </li>
33
33
  {% endif %}
34
34
  {% endfor %}
@@ -50,6 +50,36 @@ def get_item(dictionary, key):
50
50
  return dictionary.get(key, None) if dictionary else None
51
51
 
52
52
 
53
+ @register.simple_tag(takes_context=True)
54
+ def sb_admin_prepopulated_fields_init(context):
55
+ adminform = context.get("adminform")
56
+ if not adminform:
57
+ return ""
58
+
59
+ data = []
60
+ for f in adminform.prepopulated_fields:
61
+ bf = f["field"]
62
+ deps = f["dependencies"]
63
+ data.append(
64
+ {
65
+ "id": f"#{bf.id_for_label}",
66
+ "name": bf.name,
67
+ "dependency_ids": [f"#{d.id_for_label}" for d in deps],
68
+ "dependency_list": [d.name for d in deps],
69
+ "maxLength": getattr(bf.field, "max_length", None) or 50,
70
+ "allowUnicode": bool(getattr(bf.field, "allow_unicode", False)),
71
+ }
72
+ )
73
+
74
+ opts = context.get("opts")
75
+ element_id = (
76
+ f"sbadmin_prepopulated_fields_{opts.app_label}_{opts.model_name}"
77
+ if opts
78
+ else "sbadmin_prepopulated_fields"
79
+ )
80
+ return mark_safe(get_json_script(data, element_id))
81
+
82
+
53
83
  @register.tag(name="submit_row")
54
84
  def submit_row_tag(parser, token):
55
85
  return InclusionSBAdminNode(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-smartbase-admin
3
- Version: 1.0.38
3
+ Version: 1.0.40
4
4
  Summary:
5
5
  Home-page: https://smartbase-sk.github.io/django-smartbase-admin-docs/
6
6
  License: MIT
@@ -1,11 +1,11 @@
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=VzC1ghdYPXXYDd_6JCqy41M8M2kkOLJGc8QIwPvvdEs,19825
3
+ django_smartbase_admin/actions/admin_action_list.py,sha256=UHeLe2z0qS5L8OIJsG-AjqzhwQpiooJ2xHG2NMVG7II,20115
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
6
  django_smartbase_admin/admin/admin_base.py,sha256=_LhpECtcP0NDb-0PEI3AY6WFYw94aCWGviCrrSl-R-s,49564
7
7
  django_smartbase_admin/admin/site.py,sha256=bU71Zcts2hRcusZq1l44q9Mlr8jOEjGHeM6MNAaS6Gc,9903
8
- django_smartbase_admin/admin/widgets.py,sha256=T2_haNKqky_D6tHkzDcxjZzqHeP9DEDi0thcVFiaYCI,34241
8
+ django_smartbase_admin/admin/widgets.py,sha256=4EiRb3vUxN6OZe3gfYidaSbbpxrdxYMmSrtoBW6DBS4,36154
9
9
  django_smartbase_admin/apps.py,sha256=heZq5O2GHlkJdhUCHbRR7Nmm0irSxnL9NMqY43_O7V4,599
10
10
  django_smartbase_admin/compilemessages.py,sha256=-_FEFQlOvE4L8UzSuUxSxZQjgGlwL9IZtmg59fW_kIQ,342
11
11
  django_smartbase_admin/engine/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -18,8 +18,8 @@ django_smartbase_admin/engine/const.py,sha256=BP5I2UcCtV0bIlk_YUuVFHrDHRM9-gbCL0
18
18
  django_smartbase_admin/engine/dashboard.py,sha256=yXi0oUTybqeo2_o2G3skp27W79u_SKjqcaXGKXR4pus,24488
19
19
  django_smartbase_admin/engine/fake_inline.py,sha256=tGLX3yHANYBsVPcDk6yQqn8RN-JGdaV-RdHcxh9-61w,6190
20
20
  django_smartbase_admin/engine/field.py,sha256=AkcEs9hYqIJHy9cLgchWfC1wpWTRzFNm7byEIf0DuLU,10858
21
- django_smartbase_admin/engine/field_formatter.py,sha256=QtcegfJoZPkRExviRk1fyl04KGkVx0eg_Jb5ab42aNE,2114
22
- django_smartbase_admin/engine/filter_widgets.py,sha256=Pg9uqH22StmfwNkEbML0ytAJFsOtdgmDvmBpVp35h1k,33331
21
+ django_smartbase_admin/engine/field_formatter.py,sha256=3NxapC_ee39saPKhJ4kHM3cQ604oG8E4m4On5P8xIZg,2513
22
+ django_smartbase_admin/engine/filter_widgets.py,sha256=sYhJy0SX5FP073WmN-xW9FZk7-hGx_y_iB1URhc2L-U,33119
23
23
  django_smartbase_admin/engine/global_filter_form.py,sha256=jlj6e9VYWDPyUNjcgj3gTIkCZXO01NZOWAeU3jFtkoA,249
24
24
  django_smartbase_admin/engine/menu_item.py,sha256=HP5EwjxBYygAg72RsgQyde62DI9CDg_pDzc8FqlUPEc,3028
25
25
  django_smartbase_admin/engine/modal_view.py,sha256=heo9r-RaRm2MuGtPd_fhWM2jRmxtctM-L59YZQOoOvs,2308
@@ -70,7 +70,7 @@ django_smartbase_admin/static/sb_admin/dist/chart.js.LICENSE.txt,sha256=m7M__mzL
70
70
  django_smartbase_admin/static/sb_admin/dist/confirmation_modal.js,sha256=glK-x4oxSAHqiabqXmNFE3FRtzMbpg7TgZiKcPle9_o,1745
71
71
  django_smartbase_admin/static/sb_admin/dist/main.js,sha256=S9F0bd-rm-541kDyUBrJnFL6RjknCEkED51je35LyAg,385342
72
72
  django_smartbase_admin/static/sb_admin/dist/main.js.LICENSE.txt,sha256=Z8-1IrzhOFV3eE_WGR7SRfbzN9GRXsvfiU7_E_BkX-k,5600
73
- django_smartbase_admin/static/sb_admin/dist/main_style.css,sha256=--alMURJO1ar5wZsUQjTOzeVmyPvxqmTaNbRs2lomIA,178843
73
+ django_smartbase_admin/static/sb_admin/dist/main_style.css,sha256=tS-Usr6Wc0MWuNJm29fLh66RqWzGm1aqipNLdFIqpjk,178928
74
74
  django_smartbase_admin/static/sb_admin/dist/main_style.js,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
75
  django_smartbase_admin/static/sb_admin/dist/table.js,sha256=ellAKCmVs6r3AjERQ5UZ3NUCLT6uY5KQmGMM-ciyI7I,592340
76
76
  django_smartbase_admin/static/sb_admin/dist/table.js.LICENSE.txt,sha256=WOKSfEow5EUe0a78P0kcxdWcrQlqn2n6H8idNZqHVDk,462
@@ -345,6 +345,7 @@ django_smartbase_admin/static/sb_admin/js/prices.js,sha256=ylJRc66S29EPyB8IG2Wcf
345
345
  django_smartbase_admin/static/sb_admin/js/querybuilder/jQuery.extendext.js,sha256=g0pOP9xwUS9WgQ0Oo6XexDDsl6p2tAR5n-ouO756t2c,4564
346
346
  django_smartbase_admin/static/sb_admin/js/querybuilder/query-builder.min.js,sha256=VWVRmHkPrZOcqYDkRiOYv-xVdckeB7tstHUJz7_pWpc,72497
347
347
  django_smartbase_admin/static/sb_admin/js/remove-me.js,sha256=58rFGRSCvxYqJI-_rYVF9YQjC03EemiEahZzWFHknmg,932
348
+ django_smartbase_admin/static/sb_admin/js/sbadmin_prepopulated_fields_init.js,sha256=Ngs8vTlBPKbXFleam-hIufnDlbdSjXK2S4Vh-lbE894,722
348
349
  django_smartbase_admin/static/sb_admin/js/tabulator.min.js,sha256=0EyacGIK0jSUNrcdtifwl11D0-K_hNdnFn33vJkpkFY,387673
349
350
  django_smartbase_admin/static/sb_admin/sprites/sb_admin/Accept-email.svg,sha256=Rxizrh_Ckal_LmaCLYxH1r62CXpEjVTJYh4QFmV7u2I,527
350
351
  django_smartbase_admin/static/sb_admin/sprites/sb_admin/Ad-product.svg,sha256=3ybwil9wnVkC6B-CfgXAfjwiLgYbtpiTTSc4Tk9Hf34,682
@@ -522,7 +523,7 @@ django_smartbase_admin/static/sb_admin/src/css/_tailwind_base.css,sha256=GGQZxH5
522
523
  django_smartbase_admin/static/sb_admin/src/css/_utilities.css,sha256=CwCzAMaTUSP8Wr-6zdusKPuMtS970u0Qb1RQ23TG_LM,901
523
524
  django_smartbase_admin/static/sb_admin/src/css/calendar.css,sha256=HC9vjkwnJqwAdtf7eH4AJ295m6Qa3bbcCFObhe949O0,3645
524
525
  django_smartbase_admin/static/sb_admin/src/css/components/_button.css,sha256=19jJ4xPNuE9KodmQrWTVJK7VcAsVrhhpIhWNU2evCag,5597
525
- django_smartbase_admin/static/sb_admin/src/css/components/_dropdown.css,sha256=ONfGX6cyBUjeXIMaCXWS3cGE1iaCKp4rGeENQZVPW3E,2299
526
+ django_smartbase_admin/static/sb_admin/src/css/components/_dropdown.css,sha256=BSLmNmvCOx6y8iGDtej4B1gNSBTzpZny3pw1TdYSQpY,2402
526
527
  django_smartbase_admin/static/sb_admin/src/css/components/_input.css,sha256=O1odbSQb-qtWo8HJ0UVzYpGJgYx2DD7Kat21lvXK9Ks,11210
527
528
  django_smartbase_admin/static/sb_admin/src/css/components/_modal.css,sha256=9fy9f6QXAeOCW7VWSBbx45umK37PyGRiHBQF1WGF09Q,4327
528
529
  django_smartbase_admin/static/sb_admin/src/css/components/_nav-tabs.css,sha256=86Ksvd2fX377J6pASPdWH2pzCuP7lpUu1arwZfa-ri4,719
@@ -561,12 +562,12 @@ django_smartbase_admin/static/sb_admin/src/js/table_modules/views_module.js,sha2
561
562
  django_smartbase_admin/static/sb_admin/src/js/translations.js,sha256=GEizlr_D5yDj00i7jKENkWfDr6gZcg4RQ1Nek22WP4g,954
562
563
  django_smartbase_admin/static/sb_admin/src/js/tree_widget.js,sha256=LEu8LNycEIK4drqfUORXDOzFW2EzYg6AWmlM4H35VdM,18426
563
564
  django_smartbase_admin/static/sb_admin/src/js/utils.js,sha256=8hBr_dr1F_SQKLvuh9Z4t3q3KnSP2cmth7-x0Ih2T4w,5500
564
- django_smartbase_admin/templates/sb_admin/actions/change_form.html,sha256=XzG1_gstbpryuA5kdsGHNOuQ2YGgQcTuoXVFZQb_ujI,16556
565
+ django_smartbase_admin/templates/sb_admin/actions/change_form.html,sha256=cep-uSTBBxwiTpfWbdCcfl9g8Nh6fJOLTs63wJm9oP0,16790
565
566
  django_smartbase_admin/templates/sb_admin/actions/change_password.html,sha256=LhciaKCvlywKMJ6gY9JbEaTkOXjNSFO-mAnWIZfk6sA,3200
566
567
  django_smartbase_admin/templates/sb_admin/actions/dashboard.html,sha256=ur4OFSKJrB71Sl8O5fF0BsV86zLq1tyiadmrDUy9aJ0,297
567
568
  django_smartbase_admin/templates/sb_admin/actions/delete_confirmation.html,sha256=4AeJLqGGPVBYXS9XQSNTnMvsT3I6QttyNLThE8gEZHE,3205
568
569
  django_smartbase_admin/templates/sb_admin/actions/delete_selected_confirmation.html,sha256=hQl8C3j22LI6fVPAMqRd4d_kXNKzcCNJDuhOzEZKBGE,3308
569
- django_smartbase_admin/templates/sb_admin/actions/list.html,sha256=7qbTcnwrrkRG2GQClGNZ1eqOSkjYDDDWn6OICwgFTjo,6885
570
+ django_smartbase_admin/templates/sb_admin/actions/list.html,sha256=gdT2WyxaU8Yk1kZChw5UzjIZ6kAYqdmWXpIgHa829Cc,6875
570
571
  django_smartbase_admin/templates/sb_admin/actions/media.html,sha256=UYe6QzEuqCFZOj1J9vVFHFKvUZDaVBBLFOzHHI8SEyk,122
571
572
  django_smartbase_admin/templates/sb_admin/actions/object_history.html,sha256=7EdXW3oa3kFfWb2ICyKDJmTlTWmjAA3SgONd26QFDzA,1949
572
573
  django_smartbase_admin/templates/sb_admin/actions/partials/action_link.html,sha256=k8ygmP8zPzazUQn7cabdNGQ9Kla_zrIlCDUHuRKILKs,684
@@ -706,7 +707,7 @@ django_smartbase_admin/templates/sb_admin/widgets/tree_select_inline.html,sha256
706
707
  django_smartbase_admin/templates/sb_admin/widgets/url.html,sha256=piw2218tiWPfOwncIvSGAW14Gc5FIzkL_YllirK4yTs,160
707
708
  django_smartbase_admin/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
708
709
  django_smartbase_admin/templatetags/base.py,sha256=XF1wUQxUjULXfdlV-PeHvITfbw65LTHjlDzRikJa_F4,1520
709
- django_smartbase_admin/templatetags/sb_admin_tags.py,sha256=Xd5Y3zPBTr7Rkg-V2-X47YH8YoqCGr831SudZrHKYb8,9656
710
+ django_smartbase_admin/templatetags/sb_admin_tags.py,sha256=yHp-M0IVdjYs14P-FeEQz6d-tv3zti0uvQ0Y08Hxr84,10613
710
711
  django_smartbase_admin/urls.py,sha256=Bjdewssljt0LIefjixBem9JN0kkghPvmrIETj3GdXbY,17
711
712
  django_smartbase_admin/utils.py,sha256=1SHuRAeEvXsPOHdE525o9iHTLY7DT6auUCx2mBa_w2Q,3400
712
713
  django_smartbase_admin/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -715,7 +716,7 @@ django_smartbase_admin/views/global_filter_view.py,sha256=eYo1moJGyi7jc2cPDA5ZBi
715
716
  django_smartbase_admin/views/media_view.py,sha256=5BLWXuzynF7nM34t-mf2BQSRN5ojY8HxpLIqt7Jiq9g,292
716
717
  django_smartbase_admin/views/translations_view.py,sha256=hktmkJIZ0EJxgnzjHLIoRDY0ckFa5wkbaoFZg32UWYw,20441
717
718
  django_smartbase_admin/views/user_config_view.py,sha256=hUSmwxgGXJog7vhiD-zGpm6smo31sLNzW2VoXapHIjc,1865
718
- django_smartbase_admin-1.0.38.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
719
- django_smartbase_admin-1.0.38.dist-info/METADATA,sha256=qc6M9cunTJGwHCzmcXGyVvOhx1YjrwgKa2bujwj-7as,6697
720
- django_smartbase_admin-1.0.38.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
721
- django_smartbase_admin-1.0.38.dist-info/RECORD,,
719
+ django_smartbase_admin-1.0.40.dist-info/LICENSE.md,sha256=okRGMBOYvyhprt2eTpX_QXqpzC0MODF-U7zX-4fKPjQ,1078
720
+ django_smartbase_admin-1.0.40.dist-info/METADATA,sha256=U_jEndKwL98wLQy-qIzkizv3SEAussJaFQfJYHrbgLo,6697
721
+ django_smartbase_admin-1.0.40.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
722
+ django_smartbase_admin-1.0.40.dist-info/RECORD,,