django-unfold 0.35.0__py3-none-any.whl → 0.36.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-unfold
3
- Version: 0.35.0
3
+ Version: 0.36.0
4
4
  Summary: Modern Django admin theme for seamless interface development
5
5
  Home-page: https://unfoldadmin.com
6
6
  License: MIT
@@ -83,7 +83,7 @@ unfold/static/unfold/fonts/material-symbols/styles.css,sha256=U0oiGd2DS7LXnbuqgs
83
83
  unfold/static/unfold/js/alpine.anchor.js,sha256=2Jg9aUq749pjFynzr_H1NK3lf-nXrbHMtO9wvlWJyIQ,15524
84
84
  unfold/static/unfold/js/alpine.js,sha256=NY2a-7GrW--i9IBhowd25bzXcH9BCmBrqYX5i8OxwDQ,44659
85
85
  unfold/static/unfold/js/alpine.persist.js,sha256=jFBwr6faTqqhp3sVi4_VTxJ0FpaF9YGZN1ZGLl_5QYM,837
86
- unfold/static/unfold/js/app.js,sha256=kL7gJu4bDcY7v61KYtYtjn7KxWd-rHVvL49GTD_q770,6884
86
+ unfold/static/unfold/js/app.js,sha256=wECCd_-BPLcpWLR2sJKLmuaM8-QtXQ6EPKChFTOdsZ4,7259
87
87
  unfold/static/unfold/js/chart.js,sha256=22W6cFERR-CElMOKRgMMicueMVP0Vf7FBEBYH8Z8tCk,200633
88
88
  unfold/static/unfold/js/htmx.js,sha256=XOLqvnZiyEx46EW9vaJTBUaaWg8CGVVfXJkVsUmJbpI,42820
89
89
  unfold/static/unfold/js/select2.init.js,sha256=SzpjSL1mD9tHedjSeXlmEwHjuuyqlnpilpSeEEKeYLE,265
@@ -96,7 +96,7 @@ unfold/templates/admin/auth/user/add_form.html,sha256=iLig-vd2YExXsj0xGBwYhZ4kGU
96
96
  unfold/templates/admin/auth/user/change_password.html,sha256=-Wa9ml3yss-kDz0YQxCiwoxs91KQD8eetCt5l6xekWM,2892
97
97
  unfold/templates/admin/base.html,sha256=RptiEpgXZ6seYrPu-1Stoe8ECHpi9PjkJjFheGecYF0,2358
98
98
  unfold/templates/admin/base_site.html,sha256=3ckWrcAdd7Pw1hk6Zwyknab_Qb-rteV9-mXhMnfo6VI,361
99
- unfold/templates/admin/change_form.html,sha256=FiVfbB1j1wb6qGfaLukdMUrLRXsO_sJ4wirKq1bit60,4528
99
+ unfold/templates/admin/change_form.html,sha256=nWZV7ak_MSX01M54y_VdJAbZ7dSi7FWdXJEJaq2ECMk,4621
100
100
  unfold/templates/admin/change_form_object_tools.html,sha256=eyeH-i2HgEM0Yi-OJA2D1VnKJyC19A_my1IDGxxoP8Y,593
101
101
  unfold/templates/admin/change_list.html,sha256=o8XnKa1xFot53-BxGeB8afJ0TF8N7TcJhyTA4vPnop0,5124
102
102
  unfold/templates/admin/change_list_object_tools.html,sha256=cmMiT2nT20Ph5yfpj9aHPr76Z-JP4aSXp0o-Rnad28s,147
@@ -191,12 +191,12 @@ unfold/templates/unfold/widgets/textarea_expandable.html,sha256=4xIGWb20Duwiwumn
191
191
  unfold/templates/unfold/widgets/time.html,sha256=WXo2LG1v_gBZBSg-zocj7oujMKI0MWLYCIFfB04HMLQ,122
192
192
  unfold/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
193
193
  unfold/templatetags/unfold.py,sha256=jWumX0e2KIyDxz_CmIfyOu7blILxVBqUPtGi1VutaBo,6884
194
- unfold/templatetags/unfold_list.py,sha256=q02u7jbMWyDi_6_rOk17W-jW6Yqe9dkuz7Cc_mDp4Ok,14181
194
+ unfold/templatetags/unfold_list.py,sha256=NDUwYJ2azzTzejV0FphNZBftmh1n697Qppgn-2y_-y0,14164
195
195
  unfold/typing.py,sha256=1P8PWM2oeaceUJtA5j071RbKEBpHYaux441u7Hd6wv4,643
196
196
  unfold/utils.py,sha256=zZdJE4FmwRd7p5a7sJiAoZjBOJitXJduOq7BulyppWM,4803
197
197
  unfold/views.py,sha256=hQCyeeMa9kcJV1IZeeYqj8PGW7J4QWME8n-5n0UGmiU,1003
198
198
  unfold/widgets.py,sha256=6hQp13LmuhDJ41YxTG70SPJEg0agmHcmUhCtCUwI6SU,16369
199
- django_unfold-0.35.0.dist-info/LICENSE.md,sha256=Ltk_quRyyvV3J5v3brtOqmibeZSw2Hrb8bY1W3ya0Ik,1077
200
- django_unfold-0.35.0.dist-info/METADATA,sha256=_lkCvpMErEFx3xEWaKWziYEDzsvy4jxiLlfVkJav5u0,57888
201
- django_unfold-0.35.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
202
- django_unfold-0.35.0.dist-info/RECORD,,
199
+ django_unfold-0.36.0.dist-info/LICENSE.md,sha256=Ltk_quRyyvV3J5v3brtOqmibeZSw2Hrb8bY1W3ya0Ik,1077
200
+ django_unfold-0.36.0.dist-info/METADATA,sha256=K6xEy0qCc-UlMaaH6ETEB0z060atUfRe8baojrVymqs,57888
201
+ django_unfold-0.36.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
202
+ django_unfold-0.36.0.dist-info/RECORD,,
@@ -17,14 +17,27 @@ window.addEventListener("load", (e) => {
17
17
  *************************************************************/
18
18
  const warnWithoutSaving = () => {
19
19
  let formChanged = false;
20
+ const form = document.querySelector("form.warn-unsaved-form");
20
21
 
21
- Array.from(
22
- document.querySelectorAll(
23
- "form.warn-unsaved-form input, form.warn-unsaved-form select"
24
- )
25
- ).forEach((field) => {
26
- field.addEventListener("change", (e) => (formChanged = true));
27
- });
22
+ const checkFormChanged = () => {
23
+ const elements = document.querySelectorAll(
24
+ "form.warn-unsaved-form input, form.warn-unsaved-form select, form.warn-unsaved-form textarea"
25
+ );
26
+
27
+ Array.from(elements).forEach((field) => {
28
+ field.addEventListener("input", (e) => (formChanged = true));
29
+ });
30
+ };
31
+
32
+ if (!form) {
33
+ return;
34
+ }
35
+
36
+ new MutationObserver((mutationsList, observer) => {
37
+ checkFormChanged();
38
+ }).observe(form, { attributes: true, childList: true, subtree: true });
39
+
40
+ checkFormChanged();
28
41
 
29
42
  window.addEventListener("beforeunload", (e) => {
30
43
  if (formChanged) {
@@ -59,6 +59,8 @@
59
59
 
60
60
  {% block content %}
61
61
  <div id="content-main">
62
+ {% block form_before %}{% endblock %}
63
+
62
64
  <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}{% if form_url %}action="{{ form_url }}" {% endif %}method="post" id="{{ opts.model_name }}_form" {% if adminform.model_admin.warn_unsaved_form %}class="warn-unsaved-form"{% endif %} novalidate>
63
65
  {% csrf_token %}
64
66
 
@@ -106,5 +108,7 @@
106
108
  {% prepopulated_fields_js %}
107
109
  </div>
108
110
  </form>
111
+
112
+ {% block form_after %}{% endblock %}
109
113
  </div>
110
114
  {% endblock %}
@@ -36,9 +36,7 @@ from ..widgets import UnfoldBooleanWidget
36
36
 
37
37
  register = Library()
38
38
 
39
- LINK_CLASSES = [
40
- "truncate",
41
- ]
39
+ LINK_CLASSES = []
42
40
 
43
41
  ROW_CLASSES = [
44
42
  "align-middle",