django-unfold 0.61.0__py3-none-any.whl → 0.63.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.
- {django_unfold-0.61.0.dist-info → django_unfold-0.63.0.dist-info}/METADATA +15 -2
- {django_unfold-0.61.0.dist-info → django_unfold-0.63.0.dist-info}/RECORD +36 -31
- unfold/contrib/constance/__init__.py +0 -0
- unfold/contrib/constance/apps.py +6 -0
- unfold/contrib/constance/settings.py +32 -0
- unfold/contrib/constance/templates/admin/constance/change_list.html +70 -0
- unfold/contrib/constance/templates/admin/constance/includes/results_list.html +71 -0
- unfold/contrib/forms/widgets.py +12 -1
- unfold/fields.py +1 -1
- unfold/static/admin/js/inlines.js +42 -17
- unfold/static/unfold/css/styles.css +2 -2
- unfold/static/unfold/js/select2.init.js +4 -0
- unfold/styles.css +5 -6
- unfold/templates/admin/base.html +1 -1
- unfold/templates/admin/change_form.html +12 -6
- unfold/templates/admin/change_list_results.html +2 -2
- unfold/templates/admin/edit_inline/stacked.html +2 -2
- unfold/templates/admin/edit_inline/tabular.html +2 -2
- unfold/templates/admin/includes/fieldset.html +1 -1
- unfold/templates/admin/login.html +1 -1
- unfold/templates/registration/logged_out.html +12 -7
- unfold/templates/unfold/helpers/fieldsets_tabs.html +1 -1
- unfold/templates/unfold/helpers/navigation_header.html +2 -2
- unfold/templates/unfold/helpers/pagination_inline.html +28 -20
- unfold/templates/unfold/helpers/search.html +1 -1
- unfold/templates/unfold/helpers/submit.html +1 -1
- unfold/templates/unfold/helpers/tab_actions.html +1 -1
- unfold/templates/unfold/helpers/tab_list.html +1 -1
- unfold/templates/unfold/helpers/unauthenticated_header.html +2 -2
- unfold/templates/unfold/helpers/unauthenticated_title.html +1 -1
- unfold/templates/unfold/widgets/related_widget_wrapper.html +4 -4
- unfold/templates/unfold/widgets/text.html +1 -1
- unfold/templatetags/unfold.py +0 -1
- unfold/widgets.py +6 -1
- {django_unfold-0.61.0.dist-info → django_unfold-0.63.0.dist-info}/LICENSE.md +0 -0
- {django_unfold-0.61.0.dist-info → django_unfold-0.63.0.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: django-unfold
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.63.0
|
4
4
|
Summary: Modern Django admin theme for seamless interface development
|
5
5
|
License: MIT
|
6
6
|
Keywords: django,admin,tailwind,theme
|
@@ -59,11 +59,11 @@ Unfold Studio lets you visually customize your Django admin without writing code
|
|
59
59
|
|
60
60
|
## Fresh Features & Enhancements
|
61
61
|
|
62
|
+
- **django-constance**: Official support with a completely new design and UX improvements
|
62
63
|
- **Paginated inlines:** Break down large record sets into pages within inlines for better admin performance
|
63
64
|
- **Conditional fields:** Show or hide fields dynamically based on the values of other fields in the form
|
64
65
|
- **Infinite paginator:** Efficiently handle large datasets with seamless pagination that reduces server load
|
65
66
|
- **Checkbox & radio filters:** Enhanced filter options with checkbox and radio interfaces for intuitive filtering
|
66
|
-
- **Site dropdown:** Configurable dropdown menu in the header area for managing custom navigation links
|
67
67
|
|
68
68
|
## Core Features & Capabilities
|
69
69
|
|
@@ -74,6 +74,7 @@ Unfold Studio lets you visually customize your Django admin without writing code
|
|
74
74
|
- **Advanced filters**: Features custom dropdowns, autocomplete, numeric, datetime, and text field filters.
|
75
75
|
- **Dashboard tools**: Includes helpers for building custom dashboard pages.
|
76
76
|
- **UI components**: Offers reusable interface components such as cards, buttons, and charts.
|
77
|
+
- **Crispy forms**: Custom template pack for django-crispy-forms to style forms with Unfold's design system
|
77
78
|
- **WYSIWYG editor**: Built-in support for WYSIWYG editing through Trix.
|
78
79
|
- **Array widget:** Built-in widget for `django.contrib.postgres.fields.ArrayField`
|
79
80
|
- **Inline tabs:** Group inlines into tab navigation in the change form
|
@@ -96,8 +97,20 @@ Unfold Studio lets you visually customize your Django admin without writing code
|
|
96
97
|
- **Dependencies:** Built entirely on `django.contrib.admin`.
|
97
98
|
- **VS Code:** Project configuration and development container included.
|
98
99
|
|
100
|
+
## Third-party package support
|
101
|
+
|
102
|
+
- [django-guardian](https://github.com/django-guardian/django-guardian) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-guardian/)
|
103
|
+
- [django-import-export](https://github.com/django-import-export/django-import-export) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-import-export/)
|
104
|
+
- [django-simple-history](https://github.com/jazzband/django-simple-history) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-simple-history/)
|
105
|
+
- [django-constance](https://github.com/jazzband/django-constance) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-constance/)
|
106
|
+
- [django-celery-beat](https://github.com/celery/django-celery-beat) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-celery-beat/)
|
107
|
+
- [django-modeltranslation](https://github.com/deschler/django-modeltranslation) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-modeltranslation/)
|
108
|
+
- [django-money](https://github.com/django-money/django-money) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-money/)
|
109
|
+
- [django-location-field](https://github.com/caioariede/django-location-field) - [Integration guide](https://unfoldadmin.com/docs/integrations/django-location-field/)
|
110
|
+
|
99
111
|
## Credits
|
100
112
|
|
113
|
+
- **Tailwind**: [Tailwind CSS](https://github.com/tailwindlabs/tailwindcss) - Licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
101
114
|
- **Icons**: [Material Symbols](https://github.com/google/material-design-icons) - Licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
|
102
115
|
- **Font**: [Inter](https://github.com/rsms/inter) - Licensed under the [SIL Open Font License 1.1](https://scripts.sil.org/OFL).
|
103
116
|
- **Charts**: [Chart.js](https://github.com/chartjs/Chart.js) - Licensed under the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -4,6 +4,11 @@ unfold/apps.py,sha256=SlBXPYrUd2uXn67qFbRvbXSUk3XFWrF4-5WELgDCvho,381
|
|
4
4
|
unfold/checks.py,sha256=e5HEhbXRcu3FwZDT_d-IbimeVpjJ6jgCUPXWvsUjEw0,2601
|
5
5
|
unfold/components.py,sha256=vqkQzseYUvLXDohmTVAlbKopALjyX4WA9yglvdfhqu4,1283
|
6
6
|
unfold/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
unfold/contrib/constance/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
unfold/contrib/constance/apps.py,sha256=636jGQ_C15fp5WRccmuSeZCZ4GOQ2PhXSEe4769uqrQ,139
|
9
|
+
unfold/contrib/constance/settings.py,sha256=SuEMNoEHjCiC3TrdQirKP6Uw17nuTaReKOTGiFjgAR4,785
|
10
|
+
unfold/contrib/constance/templates/admin/constance/change_list.html,sha256=_hpxZRNL5naXrPZWyuIimt7vd9ty8KQ0OUpvzMeReqw,3073
|
11
|
+
unfold/contrib/constance/templates/admin/constance/includes/results_list.html,sha256=icFkvds6H96GeeJZFTmWw74Ze4TwBX9GGUPltkg16qA,3663
|
7
12
|
unfold/contrib/filters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
13
|
unfold/contrib/filters/admin/__init__.py,sha256=7pooAoA2Y9MbBL_RTJBZeIAwV5ECrOvMbe0_egoHfew,1663
|
9
14
|
unfold/contrib/filters/admin/autocomplete_filters.py,sha256=Jh3m3iQ8YubZRQDVzHPGfpk9RulOhHkZc0N7L6KV9wc,514
|
@@ -39,7 +44,7 @@ unfold/contrib/forms/static/unfold/forms/js/trix.config.js,sha256=spkNBlJVk_pqid
|
|
39
44
|
unfold/contrib/forms/templates/unfold/forms/array.html,sha256=EKN_Tk1YKrdhZfOcC9aMKZMKyIiBk9frF0tYDWXqiDA,1799
|
40
45
|
unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html,sha256=_sPtxaK14XzdfB6sAwA7ZYHbfIMtaKbORByxjxXoNh8,10130
|
41
46
|
unfold/contrib/forms/templates/unfold/forms/wysiwyg.html,sha256=uLLf59jsD3apAm9Uh1TH4pwCOtO7pL2djAeZLOHyNAI,399
|
42
|
-
unfold/contrib/forms/widgets.py,sha256=
|
47
|
+
unfold/contrib/forms/widgets.py,sha256=ctGrtqEnT9Azdr6oMTpqe7vCd_lECx7QKzaPE8-McLs,3394
|
43
48
|
unfold/contrib/guardian/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
44
49
|
unfold/contrib/guardian/apps.py,sha256=ObJqwh4vHxkD4XfduP5IQAiYiWZxsXUOUqF1_R1GsRI,136
|
45
50
|
unfold/contrib/guardian/templates/admin/guardian/model/change_form.html,sha256=FSJc4MYYWyzZAy8Ay0b7Ov-cUo-oELHOM5fQehM54Lg,403
|
@@ -85,7 +90,7 @@ unfold/dataclasses.py,sha256=a-9INnkCAIcnMgoffTcB1rxWCJH33AjhMCWIGWnjWbI,719
|
|
85
90
|
unfold/decorators.py,sha256=jPiYFy1p0WGFn68VZhAZkYCPDF7argb9SDFaH6aemHk,4922
|
86
91
|
unfold/enums.py,sha256=9sTfyEycMWeoGPBa-ft6ZhQGnW1vkFg108RMBVf9nko,187
|
87
92
|
unfold/exceptions.py,sha256=gcCj1ox61E137bk_0Cqy4YC3SttdPgB-fiJUqpmyHSE,43
|
88
|
-
unfold/fields.py,sha256=
|
93
|
+
unfold/fields.py,sha256=wvkdeMCIYs3vNB_QDtRo191tXoYVrP-uRFfzFCTYY3c,7314
|
89
94
|
unfold/forms.py,sha256=0u4TFw7oQ96S7njzJ2G79Qzt1X-4P4px-kfMgjVt49o,7762
|
90
95
|
unfold/layout.py,sha256=Q-dFTA6UlvvPCA4PsGyTkHQmBLO7PL56xBfZi-bdt0c,1459
|
91
96
|
unfold/mixins/__init__.py,sha256=YlhoDs9Y_DXQ8Ejr3enxuHMS1-Ij9fwukxNwpeOS4Co,190
|
@@ -97,10 +102,10 @@ unfold/sections.py,sha256=Lcg3xCZ76fqjm4vD4x7YdE5VsbTKluL-sX5QTEBlHxA,2379
|
|
97
102
|
unfold/settings.py,sha256=DE3hComMaWtty8o-LqdgGGcoku3mevRWJah4NH1k5B4,2879
|
98
103
|
unfold/sites.py,sha256=GPeMbBA4ckhacUOPW9PXrzQrOttU7_91zwReaKJdZgc,17616
|
99
104
|
unfold/static/admin/js/admin/RelatedObjectLookups.js,sha256=ubKKhWmX_QborwPnaLHuQshTwQw6tK1pAViWdKIjw4E,9222
|
100
|
-
unfold/static/admin/js/inlines.js,sha256=
|
105
|
+
unfold/static/admin/js/inlines.js,sha256=UXtFzCWHZWIJbxRghlNsNsz8HuRHjcaH1Mvb5e6uJms,16222
|
101
106
|
unfold/static/unfold/css/simplebar/LICENSE,sha256=okNJf6UFl2NrEiC4iqORNBa16IKgUgV88acdcl9FbtY,1081
|
102
107
|
unfold/static/unfold/css/simplebar/simplebar.css,sha256=5LLaEM11pKi6JFCOLt4XKuZxTpT9rpdq_tNlaQytFlU,4647
|
103
|
-
unfold/static/unfold/css/styles.css,sha256=
|
108
|
+
unfold/static/unfold/css/styles.css,sha256=Y3X76eCWJtDA5BCjRt2TggJ1C9PSnniTYa_SZOV2NoE,159990
|
104
109
|
unfold/static/unfold/fonts/inter/Inter-Bold.woff2,sha256=-oiBJ7baAVtlVp8DUfO1w5GtkokElR8cIOn4RiqNleo,114840
|
105
110
|
unfold/static/unfold/fonts/inter/Inter-Medium.woff2,sha256=D_PpRhThST61VjFP0keubEqFp3g7TMhr5TmUDPg_Kkg,114348
|
106
111
|
unfold/static/unfold/fonts/inter/Inter-Regular.woff2,sha256=4G9rG8VTqupORmgCPtCrChRxKcMQf1Ebx9A9NhsK4IU,111268
|
@@ -121,39 +126,39 @@ unfold/static/unfold/js/chart/LICENSE,sha256=QahKosq6ZF-WahjZwgVrc-bTqB2AvABGvAA
|
|
121
126
|
unfold/static/unfold/js/chart/chart.js,sha256=22W6cFERR-CElMOKRgMMicueMVP0Vf7FBEBYH8Z8tCk,200633
|
122
127
|
unfold/static/unfold/js/htmx/LICENSE,sha256=09JFb3ZBTyRWEEZg69Za_xwEzXlmuUK9q9Y_PNsxajg,642
|
123
128
|
unfold/static/unfold/js/htmx/htmx.js,sha256=acrv0NqSJpBm5yXX_hdeJrnVDJYuMFZFnAxHcVTNudM,50918
|
124
|
-
unfold/static/unfold/js/select2.init.js,sha256=
|
129
|
+
unfold/static/unfold/js/select2.init.js,sha256=E1BhZ_a16_wxMb3zFq346HIrzvfQz8PRSB_o5CH_i2E,1196
|
125
130
|
unfold/static/unfold/js/simplebar/LICENSE,sha256=okNJf6UFl2NrEiC4iqORNBa16IKgUgV88acdcl9FbtY,1081
|
126
131
|
unfold/static/unfold/js/simplebar/simplebar.js,sha256=t-uG1FAD6ZoiMeN--wac0XRS7SxoDVG6zvRnGuEp7X8,27176
|
127
|
-
unfold/styles.css,sha256
|
132
|
+
unfold/styles.css,sha256=-jJ71cltEATcjct-BGrXSkiGnmeKMvRaiABNAolNTN4,21381
|
128
133
|
unfold/templates/admin/actions.html,sha256=iuuubcAILkOoYBgV6cpXqFIyZUh4zMqyFp0JaDFlPKU,3096
|
129
134
|
unfold/templates/admin/app_index.html,sha256=LRR07CLcZVsYpisCOncWdMSACARNstcDt536Oydnt60,1239
|
130
135
|
unfold/templates/admin/app_list.html,sha256=-DEZKFdmkdTq3rix_cgZurPZ1r8PHg5pBL3i7ZtzVdI,2972
|
131
136
|
unfold/templates/admin/auth/user/add_form.html,sha256=-_YY4guGdAbw2rCskrQfRAAvQF2XzVHt5UMI0fsLDm4,337
|
132
137
|
unfold/templates/admin/auth/user/change_password.html,sha256=028v1dfQTlSmdr-WCuV4lBOmFa7Oo38CsYhsXEe8ANI,2831
|
133
|
-
unfold/templates/admin/base.html,sha256=
|
138
|
+
unfold/templates/admin/base.html,sha256=pU0e7dCQa1E1K1BDGEiqM_OD_GRgNVrqC8As_t-nAyo,2471
|
134
139
|
unfold/templates/admin/base_site.html,sha256=UOsecaCycpyn_ygJNIKO7MQtDFJuHv--r83-mzaVY30,300
|
135
|
-
unfold/templates/admin/change_form.html,sha256=
|
140
|
+
unfold/templates/admin/change_form.html,sha256=dRc4hTIp7YAGMW348SVFt9LGsT1hxbEQRO7BIpgprLM,6131
|
136
141
|
unfold/templates/admin/change_form_object_tools.html,sha256=eyeH-i2HgEM0Yi-OJA2D1VnKJyC19A_my1IDGxxoP8Y,593
|
137
142
|
unfold/templates/admin/change_list.html,sha256=39S_LBbd25DiKhL9HjLOamXN1o-Ads4HfeQ6wEvv8JA,5361
|
138
143
|
unfold/templates/admin/change_list_object_tools.html,sha256=cmMiT2nT20Ph5yfpj9aHPr76Z-JP4aSXp0o-Rnad28s,147
|
139
|
-
unfold/templates/admin/change_list_results.html,sha256=
|
144
|
+
unfold/templates/admin/change_list_results.html,sha256=vGmT3hxmVUxyJvYlYo6-EKxrfhDk1Bp9jlIVriMFsWM,8173
|
140
145
|
unfold/templates/admin/date_hierarchy.html,sha256=A-sIqBKzZTMqSn3NSHORIL1yTEAqhj4Atff0OvWtqT0,1413
|
141
146
|
unfold/templates/admin/delete_confirmation.html,sha256=IPSGhOpxDl6hJB9LtpSg_XRkVmbDO1BpO9q_dthqkac,4635
|
142
147
|
unfold/templates/admin/delete_selected_confirmation.html,sha256=T3NNe7pP0WM2QM4F39AbkDGsfd_d_tKYRpwxvExahgU,4399
|
143
|
-
unfold/templates/admin/edit_inline/stacked.html,sha256=
|
144
|
-
unfold/templates/admin/edit_inline/tabular.html,sha256=
|
148
|
+
unfold/templates/admin/edit_inline/stacked.html,sha256=EpTG-HPExprnY833xeFcqY8qTOnNXvDHYicgl2NkIZI,8628
|
149
|
+
unfold/templates/admin/edit_inline/tabular.html,sha256=DtXaKC_0HEKPIphbqiykixQa1cRrEYcnLV7I3VlynhU,3020
|
145
150
|
unfold/templates/admin/filter.html,sha256=DEyrLgCWuncS1O1WR0vlt1evGQFvKoZV2pABkHzSoGU,2039
|
146
|
-
unfold/templates/admin/includes/fieldset.html,sha256=
|
151
|
+
unfold/templates/admin/includes/fieldset.html,sha256=UWcatsmHzfdcjZP58P94YL7BI3F-CP-BgYi2uC7FSb4,1471
|
147
152
|
unfold/templates/admin/includes/object_delete_summary.html,sha256=FgwfapZCKWtnFtTHqh1MRuxxLot4bAw92WCcR_V8ImI,444
|
148
153
|
unfold/templates/admin/index.html,sha256=9ey6IIXxBVTEkVSDiQw01AwvMbUnG_h0B08N1Zg3wTg,578
|
149
|
-
unfold/templates/admin/login.html,sha256=
|
154
|
+
unfold/templates/admin/login.html,sha256=E963dlzjZlkNc6WPJg9DiqijWAhRp1QLVCxFHkRca3g,2468
|
150
155
|
unfold/templates/admin/nav_sidebar.html,sha256=xvCaXOamXawmf80NhE0OwjjjuNwoyoePS--lsdqDeIE,772
|
151
156
|
unfold/templates/admin/object_history.html,sha256=t-iJFQnpstowwsabGGA-FQjmcT1KIKhKLKbQ3iVELkk,4832
|
152
157
|
unfold/templates/admin/pagination.html,sha256=-9kjc_lKEeqvDVHMrnTfnlXDxMSkM8GNRGZGuI9D8os,912
|
153
158
|
unfold/templates/admin/search_form.html,sha256=7ckco8llu5paptroZgr3jZw54DtowX-NiwFvxsCV898,1713
|
154
159
|
unfold/templates/admin/submit_line.html,sha256=9FDZ5HOfiJG11HSMtA4rfqjKe3ucC-_OChpx1CGTLac,4626
|
155
160
|
unfold/templates/auth/widgets/read_only_password_hash.html,sha256=MlaNXJ2PLEbv8Nd01BBp-AQEfMB13LNxD_DzRemXhCg,775
|
156
|
-
unfold/templates/registration/logged_out.html,sha256=
|
161
|
+
unfold/templates/registration/logged_out.html,sha256=ytjIz3abnpERwUp1F8zn89HyrimSrb9wgUna3Iz0CJE,1202
|
157
162
|
unfold/templates/registration/password_change_done.html,sha256=ITV6Fug4S6YG3WG-O1cm-sDAXTHEXPcNZ_w2x1IQFu8,1006
|
158
163
|
unfold/templates/registration/password_change_form.html,sha256=-8AauxUHWHXVaokG269UsETY_FHKqU83Zx38ZzrAA1A,2159
|
159
164
|
unfold/templates/unfold/components/button.html,sha256=RlNNIa_JmcsNFH151ECHkbB2TxpgeCPRh-eW1Bc0Xtk,933
|
@@ -199,7 +204,7 @@ unfold/templates/unfold/helpers/field_readonly_value.html,sha256=FI_CFEsCN7ELQux
|
|
199
204
|
unfold/templates/unfold/helpers/fieldset_row.html,sha256=LriorPLXU4VmqstjX1oBc3T49H8CbhCrRxwQ7YfUSkI,1219
|
200
205
|
unfold/templates/unfold/helpers/fieldset_row_checkbox.html,sha256=z4aRab--zJS2PC0jfKPez85IptKGRrqgkPpwW6_IKoo,1467
|
201
206
|
unfold/templates/unfold/helpers/fieldset_row_field.html,sha256=cqLT1fHsCCszOHxvYlDFDTAd-6RRoOjdqfdBdhFgHOo,647
|
202
|
-
unfold/templates/unfold/helpers/fieldsets_tabs.html,sha256
|
207
|
+
unfold/templates/unfold/helpers/fieldsets_tabs.html,sha256=F-s-4imtLbp2IYad3lFcDtMDadI89FFjOx5da3WdaJI,1551
|
203
208
|
unfold/templates/unfold/helpers/form_errors.html,sha256=mrv2_J7RPcLfVtoN1UHh3rfUyOSZpHl67wk1UGqtPcY,266
|
204
209
|
unfold/templates/unfold/helpers/form_label.html,sha256=7FfaXfviQmqKpsA1E7NSwM8rJiMNLl9e73XQram0Pfs,249
|
205
210
|
unfold/templates/unfold/helpers/header.html,sha256=cHAPz7niLLQDQbrZpURZS1hiA8OYLzkGaqnYzjgv8aE,1151
|
@@ -217,29 +222,29 @@ unfold/templates/unfold/helpers/messages/success.html,sha256=UWHpRJTvVhXiYC9-AvJ
|
|
217
222
|
unfold/templates/unfold/helpers/messages/warning.html,sha256=UldycPr8wdyp5vdjlkfs_yHCEvNg9PgspyzTALAjdDY,161
|
218
223
|
unfold/templates/unfold/helpers/messages.html,sha256=SYVGFWdL1ZhFamxnZ6ZJUvs9GKITYpY4fvdebBlSprU,1003
|
219
224
|
unfold/templates/unfold/helpers/navigation.html,sha256=U9cMmw3ETMI88zqHvSf5VQkMehcU6YfLKTcH1CmS4fY,554
|
220
|
-
unfold/templates/unfold/helpers/navigation_header.html,sha256=
|
225
|
+
unfold/templates/unfold/helpers/navigation_header.html,sha256=frgItqC006qdYoKPty59WU5aIbUFXIUKEgz_aMtjKrM,1329
|
221
226
|
unfold/templates/unfold/helpers/pagination.html,sha256=cvD4Jtw1YeKcgvWuY10iyM9Qjs52iokskzYG3TLscyY,375
|
222
227
|
unfold/templates/unfold/helpers/pagination_current_item.html,sha256=4cZ2KLVcP0Y7xuGyXgexDQ07r94cgM5Gnmtv11dkRPQ,69
|
223
228
|
unfold/templates/unfold/helpers/pagination_default.html,sha256=pseTrqaG5EOn_IpCy0GXNht3ickSkZYJ4lJaocZeI6A,496
|
224
229
|
unfold/templates/unfold/helpers/pagination_ellipsis.html,sha256=8g0KUUKtqRkXx_EBLGtsJsiYQO4tPS3GazZjxT90e0M,56
|
225
230
|
unfold/templates/unfold/helpers/pagination_infinite.html,sha256=QyHcYb36CeuiwpukC0Y553UC4LU2tPolGos-0mh7WP0,557
|
226
|
-
unfold/templates/unfold/helpers/pagination_inline.html,sha256=
|
231
|
+
unfold/templates/unfold/helpers/pagination_inline.html,sha256=mMiqoYTmLjN2DFoen46EWHyP-b61staMG6WiaZn-YxI,1889
|
227
232
|
unfold/templates/unfold/helpers/popup_header.html,sha256=IDR9B0OO6v6TvJggeof-OMGJ4cYK2INStU_2a1AlWfM,1325
|
228
|
-
unfold/templates/unfold/helpers/search.html,sha256=
|
233
|
+
unfold/templates/unfold/helpers/search.html,sha256=ATAYuvFU6Io6zmo5ki4TlYK6f3veg4GA2SNjCBEvYLs,1878
|
229
234
|
unfold/templates/unfold/helpers/search_results.html,sha256=awd6DWTLILIBnx-QkwN7my8IncTN9BfE8jHm7OibgoM,846
|
230
235
|
unfold/templates/unfold/helpers/shortcut.html,sha256=gVoXCDwEpbjxLilJ3QEoFLWmFlH18-vgoWdHv6aRLfQ,199
|
231
236
|
unfold/templates/unfold/helpers/site_branding.html,sha256=_hhWQZqUrMYGqRJRpeANjbRJPfCROPZkQLZLV7FiRk8,268
|
232
237
|
unfold/templates/unfold/helpers/site_dropdown.html,sha256=UwGFImzujCt20M4_WZt_T9TjeqVSEattYtLXHq57bcY,910
|
233
238
|
unfold/templates/unfold/helpers/site_icon.html,sha256=q9YynbaAZsEXKXT3SDZy54iSdjUwR6i2vo0AFyllGQ0,1490
|
234
239
|
unfold/templates/unfold/helpers/site_logo.html,sha256=S_QJoT2qh0xw0ciaKxoT4GJ6QIH5eqgRSC0abbWWkOI,423
|
235
|
-
unfold/templates/unfold/helpers/submit.html,sha256=
|
240
|
+
unfold/templates/unfold/helpers/submit.html,sha256=6bfZ7V2PTJfSXGg4K3IEZ42oREkMdAVjfP8yaM8Tu0k,226
|
236
241
|
unfold/templates/unfold/helpers/tab_action.html,sha256=mJd87_2qkSNQEwDZZCDkvll5ZbizBkPxWFnBR-kH89o,3431
|
237
|
-
unfold/templates/unfold/helpers/tab_actions.html,sha256=
|
242
|
+
unfold/templates/unfold/helpers/tab_actions.html,sha256=koe4D-vm7PRPqZ4FPjo3KEfWARebcpt1KuUJ7oa7PK4,685
|
238
243
|
unfold/templates/unfold/helpers/tab_items.html,sha256=5kZcU7R9tZKKxVLahp2siZpZf7FhrluBH1dIAIaWoAg,3377
|
239
|
-
unfold/templates/unfold/helpers/tab_list.html,sha256=
|
244
|
+
unfold/templates/unfold/helpers/tab_list.html,sha256=98qf9a-lxfgbGORhjs7OyjgYMIOpT5NKMIa972CI5uA,461
|
240
245
|
unfold/templates/unfold/helpers/theme_switch.html,sha256=Y46KKpULH_G-fKQuc5LzfSB7Pubcgj_dBJPRMwZoWxE,2408
|
241
|
-
unfold/templates/unfold/helpers/unauthenticated_header.html,sha256=
|
242
|
-
unfold/templates/unfold/helpers/unauthenticated_title.html,sha256=
|
246
|
+
unfold/templates/unfold/helpers/unauthenticated_header.html,sha256=nBTHKonEmR87zMAivl48E4c1xOVcTujodn6H9rAf_6U,601
|
247
|
+
unfold/templates/unfold/helpers/unauthenticated_title.html,sha256=GRPqdhpPdxYG4o3DNB1uBE0V1IFotVqeviCW-znGDNE,416
|
243
248
|
unfold/templates/unfold/helpers/userlinks.html,sha256=bJRDQXQ_0XgxLpfmZoNgU9xpn4X6T6LOAgEmzepFXOI,740
|
244
249
|
unfold/templates/unfold/helpers/welcomemsg.html,sha256=Z3dDvozCJ5VhSVA_1go0F4ZD0lQYhCmoWqd_RM00pec,2019
|
245
250
|
unfold/templates/unfold/layouts/base.html,sha256=e9T-vuPvrySHf23LLwRuTQXUg0Q4x-6gmT_yXghqc-I,278
|
@@ -254,12 +259,12 @@ unfold/templates/unfold/widgets/foreign_key_raw_id.html,sha256=4r7ha4I9vMp9Ls7WI
|
|
254
259
|
unfold/templates/unfold/widgets/radio.html,sha256=7Mgc92mMwJdVLjCxoGj5lo76KNaN5dKKktV3vzmbeqA,652
|
255
260
|
unfold/templates/unfold/widgets/radio_option.html,sha256=wVg6zIB0O44vwBgQCCphPuCXeh-gaDg6ed-0gcf5kg4,324
|
256
261
|
unfold/templates/unfold/widgets/range.html,sha256=Zhfj2VTusS3nZjOYR7slcjk1JtFK0psZbaSCw6TDY1I,294
|
257
|
-
unfold/templates/unfold/widgets/related_widget_wrapper.html,sha256=
|
262
|
+
unfold/templates/unfold/widgets/related_widget_wrapper.html,sha256=5QNucDSrA5-vDnuCXToUfsbEVW6fhGOhm-6uMKmZebA,4179
|
258
263
|
unfold/templates/unfold/widgets/select.html,sha256=MyhlEO4sf7AUjOgH84rL76rhYM0WEn4qRqzuzPmgu5M,715
|
259
264
|
unfold/templates/unfold/widgets/split_datetime.html,sha256=Hfv2PoHxPmV_21DmBFmMcR4WVP9vTV9SrfjVdliRci8,1074
|
260
265
|
unfold/templates/unfold/widgets/split_datetime_vertical.html,sha256=39lZsRyRcKr8DIcy9oL39zC8nAHZTHwW6gyTYOKePrQ,806
|
261
266
|
unfold/templates/unfold/widgets/split_money.html,sha256=AFLUBmzGbY-RXgsfz7gaDxVRhplaIPhXjg_hWYo9xcY,352
|
262
|
-
unfold/templates/unfold/widgets/text.html,sha256=
|
267
|
+
unfold/templates/unfold/widgets/text.html,sha256=lbUfrI7DpA_p4yotMJTouud0PUX42gZQCuvvIh2jByE,956
|
263
268
|
unfold/templates/unfold/widgets/textarea.html,sha256=-ZLDGrtASero7L-J3VvTNq_KjPAZh_kLVw0Ow3awqXM,144
|
264
269
|
unfold/templates/unfold/widgets/time.html,sha256=ih9wj8koTaHb9s1NGUmyN9rHvSAmqCMbti9ONDOIujg,122
|
265
270
|
unfold/templates/unfold/widgets/url.html,sha256=IRLgW44VTKN7UrSWeywJwaxQhfG5jhhXuT-KTadKX58,304
|
@@ -288,13 +293,13 @@ unfold/templates/unfold_crispy/uni_form.html,sha256=l9UNCUrIycgJ0p_B6qhtO_YxdARy
|
|
288
293
|
unfold/templates/unfold_crispy/whole_uni_form.html,sha256=ufXRKCIGqkqKFOsh166rpKUnHpFMyBV4eYUCRhs3iws,475
|
289
294
|
unfold/templates/unfold_crispy/whole_uni_formset.html,sha256=CYksfG2hRUdi5n691KW2ih-FfBxpOU4qVBfbOvcu1zs,873
|
290
295
|
unfold/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
291
|
-
unfold/templatetags/unfold.py,sha256=
|
296
|
+
unfold/templatetags/unfold.py,sha256=PZGnKciiEYZfREApWp-0CcFiGYWU5UPOmTMfapzmfUY,18155
|
292
297
|
unfold/templatetags/unfold_list.py,sha256=WWQSCM4QmQMr8YddA4krFztuuUXo2y28RA7jZfOiewE,14415
|
293
298
|
unfold/typing.py,sha256=i7LM2LiwYTAjT5-OLDUPVn5b9X-DMmHnjlZG2toWwSE,692
|
294
299
|
unfold/utils.py,sha256=lXKkvhaTxoTtd4p3bB0wHIZD26md6XzBcDkPL5bJGH8,6191
|
295
300
|
unfold/views.py,sha256=FuYnMrlg6SegLUDDN6An__yZj8rchD_iBK8myieYhkA,1492
|
296
|
-
unfold/widgets.py,sha256=
|
297
|
-
django_unfold-0.
|
298
|
-
django_unfold-0.
|
299
|
-
django_unfold-0.
|
300
|
-
django_unfold-0.
|
301
|
+
unfold/widgets.py,sha256=Af4eZWRxhOxxDpyxz-jC5DD_JNvZ0NSvJirVJOQcA_8,24687
|
302
|
+
django_unfold-0.63.0.dist-info/LICENSE.md,sha256=Ltk_quRyyvV3J5v3brtOqmibeZSw2Hrb8bY1W3ya0Ik,1077
|
303
|
+
django_unfold-0.63.0.dist-info/METADATA,sha256=sXFsC_8vmHutekmLOawOtjPIMWjVKx1HGxEtmnddifc,9998
|
304
|
+
django_unfold-0.63.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
305
|
+
django_unfold-0.63.0.dist-info/RECORD,,
|
File without changes
|
@@ -0,0 +1,32 @@
|
|
1
|
+
UNFOLD_CONSTANCE_ADDITIONAL_FIELDS = {
|
2
|
+
str: [
|
3
|
+
"django.forms.CharField",
|
4
|
+
{
|
5
|
+
"widget": "unfold.widgets.UnfoldAdminTextInputWidget",
|
6
|
+
},
|
7
|
+
],
|
8
|
+
int: [
|
9
|
+
"django.forms.IntegerField",
|
10
|
+
{
|
11
|
+
"widget": "unfold.widgets.UnfoldAdminIntegerFieldWidget",
|
12
|
+
},
|
13
|
+
],
|
14
|
+
bool: [
|
15
|
+
"django.forms.BooleanField",
|
16
|
+
{
|
17
|
+
"widget": "unfold.widgets.UnfoldBooleanSwitchWidget",
|
18
|
+
},
|
19
|
+
],
|
20
|
+
"file_field": [
|
21
|
+
"django.forms.fields.FileField",
|
22
|
+
{
|
23
|
+
"widget": "unfold.widgets.UnfoldAdminFileFieldWidget",
|
24
|
+
},
|
25
|
+
],
|
26
|
+
"image_field": [
|
27
|
+
"django.forms.fields.ImageField",
|
28
|
+
{
|
29
|
+
"widget": "unfold.widgets.UnfoldAdminImageFieldWidget",
|
30
|
+
},
|
31
|
+
],
|
32
|
+
}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
{% extends "admin/base_site.html" %}
|
2
|
+
|
3
|
+
{% load admin_list static i18n %}
|
4
|
+
|
5
|
+
{% block extrahead %}
|
6
|
+
{% url 'admin:jsi18n' as jsi18nurl %}
|
7
|
+
<script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
|
8
|
+
{{ block.super }}
|
9
|
+
{{ media.js }}
|
10
|
+
<script type="text/javascript" src="{% static 'admin/js/constance.js' %}"></script>
|
11
|
+
{% endblock %}
|
12
|
+
|
13
|
+
{% block breadcrumbs %}
|
14
|
+
<div class="px-4">
|
15
|
+
<div class="container mb-6 mx-auto -my-3 lg:mb-12">
|
16
|
+
<ul class="flex flex-wrap">
|
17
|
+
{% url 'admin:index' as link %}
|
18
|
+
{% trans 'Home' as name %}
|
19
|
+
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
|
20
|
+
|
21
|
+
{% url 'admin:app_list' app_label=opts.app_label as link %}
|
22
|
+
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}
|
23
|
+
|
24
|
+
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=opts.verbose_name_plural|capfirst %}
|
25
|
+
</ul>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
{% endblock %}
|
29
|
+
|
30
|
+
|
31
|
+
{% block content %}
|
32
|
+
<div id="content-main" class="constance">
|
33
|
+
<div id="changelist" class="flex flex-col gap-8 w-full">
|
34
|
+
<form id="changelist-form" action="" method="post" enctype="multipart/form-data" novalidate class="flex flex-col gap-8 w-full">
|
35
|
+
{% csrf_token %}
|
36
|
+
|
37
|
+
{% include "unfold/helpers/form_errors.html" with errors=form.non_field_errors %}
|
38
|
+
|
39
|
+
{% for field in form.hidden_fields %}
|
40
|
+
{{ field }}
|
41
|
+
{% endfor %}
|
42
|
+
|
43
|
+
{% if fieldsets %}
|
44
|
+
<div class="border border-base-200 rounded-default overflow-x-auto simplebar-horizontal-scrollbar-top dark:border-base-800" data-simplebar data-simplebar-auto-hide="false">
|
45
|
+
<table class="w-full border-collapse">
|
46
|
+
{% for fieldset in fieldsets %}
|
47
|
+
{% with config_values=fieldset.config_values %}
|
48
|
+
{% include "admin/constance/includes/results_list.html" %}
|
49
|
+
{% endwith %}
|
50
|
+
{% endfor %}
|
51
|
+
|
52
|
+
<tfoot>
|
53
|
+
<tr>
|
54
|
+
<td class="border-t border-base-200 px-3 py-2 dark:border-base-800" colspan="100%">
|
55
|
+
<div class="flex justify-end">
|
56
|
+
{% trans "Save" as title %}
|
57
|
+
{% include "unfold/helpers/submit.html" with title=title %}
|
58
|
+
</div>
|
59
|
+
</td>
|
60
|
+
</tr>
|
61
|
+
</tfoot>
|
62
|
+
</table>
|
63
|
+
</div>
|
64
|
+
{% else %}
|
65
|
+
{% include "admin/constance/includes/results_list.html" %}
|
66
|
+
{% endif %}
|
67
|
+
</form>
|
68
|
+
</div>
|
69
|
+
</div>
|
70
|
+
{% endblock %}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
{% load admin_list static i18n %}
|
2
|
+
|
3
|
+
<tbody {% if fieldset.collapse %} x-data="{ rowsOpen: false }" {% endif %}>
|
4
|
+
<tr {% if fieldset.collapse %} x-on:click="rowsOpen = !rowsOpen" {% endif %} class="{% if fieldset.collapse %}cursor-pointer{% endif %}">
|
5
|
+
<th class="bg-base-50 border-t border-base-200 font-semibold px-3 py-2 text-left text-font-important-light dark:text-font-important-dark dark:border-base-800 dark:bg-white/[.04] {% if forloop.first %}border-t-0{% endif %}" colspan="100%">
|
6
|
+
{{ fieldset.title }}
|
7
|
+
|
8
|
+
{% if fieldset.collapse %}
|
9
|
+
<span class="material-symbols-outlined float-right select-none transition-all" title="{% trans "Collapse" %}" x-bind:class="rowsOpen ? 'rotate-180' : ''">
|
10
|
+
expand_more
|
11
|
+
</span>
|
12
|
+
{% endif %}
|
13
|
+
</th>
|
14
|
+
</tr>
|
15
|
+
|
16
|
+
<tr class="border-t border-base-200 dark:border-base-800 *:font-semibold *:px-3 *:py-2 *:text-left *:text-font-important-light dark:*:text-font-important-dark" {% if fieldset.collapse %}x-show="rowsOpen"{% endif %}>
|
17
|
+
<th>{% trans "Name" %}</th>
|
18
|
+
<th>{% trans "Value" %}</th>
|
19
|
+
<th>{% trans "Default" %}</th>
|
20
|
+
<th>{% trans "Code" %}</th>
|
21
|
+
<th>{% trans "Modified" %}</th>
|
22
|
+
<th></th>
|
23
|
+
</tr>
|
24
|
+
|
25
|
+
{% for item in config_values %}
|
26
|
+
<tr class="border-t border-base-200 h-[55px] *:px-3 *:py-2 *:align-middle dark:border-base-800" {% if fieldset.collapse %}x-show="rowsOpen"{% endif %}>
|
27
|
+
<th class="font-normal text-left">
|
28
|
+
{{ item.help_text|linebreaksbr }}
|
29
|
+
</th>
|
30
|
+
|
31
|
+
<td class="{% if item.form_field.errors %}group errors{% endif %}">
|
32
|
+
{{ item.form_field }}
|
33
|
+
|
34
|
+
{% include "unfold/helpers/form_errors.html" with errors=item.form_field.errors %}
|
35
|
+
</td>
|
36
|
+
|
37
|
+
<td>
|
38
|
+
{% if item.default %}
|
39
|
+
{% include "unfold/helpers/label.html" with text=item.default %}
|
40
|
+
{% else %}
|
41
|
+
-
|
42
|
+
{% endif %}
|
43
|
+
</td>
|
44
|
+
|
45
|
+
<td>
|
46
|
+
<a class="item-name item-anchor" href="#{{ item.name|slugify }}" tabindex="-1" id="{{ item.name|slugify }}" title="Link to this setting">
|
47
|
+
{% include "unfold/helpers/label.html" with text=item.name type="info" %}
|
48
|
+
</a>
|
49
|
+
</td>
|
50
|
+
|
51
|
+
<td>
|
52
|
+
{% include "unfold/helpers/boolean.html" with value=item.modified %}
|
53
|
+
</td>
|
54
|
+
|
55
|
+
<td class="w-px">
|
56
|
+
{% if not item.is_file %}
|
57
|
+
<a href="#"
|
58
|
+
tabindex="-1"
|
59
|
+
class="flex items-center gap-1 reset-link whitespace-nowrap"
|
60
|
+
data-default="{% spaceless %}{% if item.is_checkbox %}{% if item.raw_default %} true {% else %} false {% endif %}{% elif item.is_date %}{{ item.raw_default|date:"U" }}{% elif item.is_datetime %}{{ item.raw_default|date:"U" }}{% else %}{{ item.default }}{% endif %}{% endspaceless %}"
|
61
|
+
data-field-type="{% spaceless %}{% if item.is_checkbox %}checkbox{% elif item.is_datetime %}datetime{% elif item.is_date %}date{% endif %}{% endspaceless %}"
|
62
|
+
data-field-id="{{ item.form_field.auto_id }}">
|
63
|
+
<span class="material-symbols-outlined text-base-400 hover:text-base-700 dark:border-base-700 dark:text-base-500 dark:hover:text-base-200" title="{% trans "Reset to default" %}">
|
64
|
+
refresh
|
65
|
+
</span>
|
66
|
+
</a>
|
67
|
+
{% endif %}
|
68
|
+
</td>
|
69
|
+
</tr>
|
70
|
+
{% endfor %}
|
71
|
+
</tbody>
|
unfold/contrib/forms/widgets.py
CHANGED
@@ -33,14 +33,25 @@ WYSIWYG_CLASSES = [
|
|
33
33
|
class ArrayWidget(MultiWidget):
|
34
34
|
template_name = "unfold/forms/array.html"
|
35
35
|
|
36
|
-
def __init__(
|
36
|
+
def __init__(
|
37
|
+
self,
|
38
|
+
widget_class: Optional[type[Widget]] = None,
|
39
|
+
*args: Any,
|
40
|
+
**kwargs: Any,
|
41
|
+
) -> None:
|
37
42
|
if "choices" in kwargs:
|
38
43
|
self.choices = kwargs["choices"]
|
39
44
|
|
45
|
+
if widget_class is not None:
|
46
|
+
self.widget_class = widget_class
|
47
|
+
|
40
48
|
widgets = [self.get_widget_instance()]
|
41
49
|
super().__init__(widgets)
|
42
50
|
|
43
51
|
def get_widget_instance(self) -> Any:
|
52
|
+
if hasattr(self, "widget_class"):
|
53
|
+
return self.widget_class()
|
54
|
+
|
44
55
|
if hasattr(self, "choices"):
|
45
56
|
return UnfoldAdminSelectWidget(choices=self.choices)
|
46
57
|
|
unfold/fields.py
CHANGED
@@ -139,7 +139,7 @@ class UnfoldAdminReadonlyField(helpers.AdminReadonlyField):
|
|
139
139
|
result_repr = display_for_field(value, f, self.empty_value_display)
|
140
140
|
return conditional_escape(result_repr)
|
141
141
|
elif isinstance(f, models.URLField):
|
142
|
-
return format_html(
|
142
|
+
return value and format_html(
|
143
143
|
'<a href="{}" class="text-primary-600 dark:text-primary-500">{}</a>',
|
144
144
|
value,
|
145
145
|
value,
|
@@ -310,7 +310,7 @@
|
|
310
310
|
};
|
311
311
|
|
312
312
|
// Tabular inlines ---------------------------------------------------------
|
313
|
-
$.fn.tabularFormset = function (selector, options) {
|
313
|
+
$.fn.tabularFormset = function (selector, options, callback = null) {
|
314
314
|
const $rows = $(this);
|
315
315
|
|
316
316
|
const reinitDateTimeShortCuts = function () {
|
@@ -370,11 +370,15 @@
|
|
370
370
|
addButton: options.addButton,
|
371
371
|
});
|
372
372
|
|
373
|
+
if (typeof callback === "function") {
|
374
|
+
callback();
|
375
|
+
}
|
376
|
+
|
373
377
|
return $rows;
|
374
378
|
};
|
375
379
|
|
376
380
|
// Stacked inlines ---------------------------------------------------------
|
377
|
-
$.fn.stackedFormset = function (selector, options) {
|
381
|
+
$.fn.stackedFormset = function (selector, options, callback = null) {
|
378
382
|
const $rows = $(this);
|
379
383
|
const updateInlineLabel = function (row) {
|
380
384
|
$(selector)
|
@@ -449,26 +453,47 @@
|
|
449
453
|
addButton: options.addButton,
|
450
454
|
});
|
451
455
|
|
456
|
+
if (typeof callback === "function") {
|
457
|
+
callback();
|
458
|
+
}
|
459
|
+
|
452
460
|
return $rows;
|
453
461
|
};
|
454
462
|
|
463
|
+
$(window).on("htmx:afterSettle", function (event) {
|
464
|
+
if (event.target.classList.contains("js-inline-admin-formset")) {
|
465
|
+
initInlines($(event.target), function () {
|
466
|
+
if (typeof DateTimeShortcuts !== "undefined") {
|
467
|
+
$(".datetimeshortcuts").remove();
|
468
|
+
DateTimeShortcuts.init();
|
469
|
+
}
|
470
|
+
|
471
|
+
$(event.target).find(".admin-autocomplete").djangoAdminSelect2();
|
472
|
+
});
|
473
|
+
}
|
474
|
+
});
|
475
|
+
|
455
476
|
$(document).ready(function () {
|
456
477
|
$(".js-inline-admin-formset").each(function () {
|
457
|
-
|
458
|
-
inlineOptions = data.inlineFormset;
|
459
|
-
let selector;
|
460
|
-
switch (data.inlineType) {
|
461
|
-
case "stacked":
|
462
|
-
selector = inlineOptions.name + "-group .inline-related";
|
463
|
-
$(selector).stackedFormset(selector, inlineOptions.options);
|
464
|
-
break;
|
465
|
-
case "tabular":
|
466
|
-
selector =
|
467
|
-
inlineOptions.name +
|
468
|
-
"-group .tabular.inline-related tbody:last > tr.form-row";
|
469
|
-
$(selector).tabularFormset(selector, inlineOptions.options);
|
470
|
-
break;
|
471
|
-
}
|
478
|
+
initInlines(this);
|
472
479
|
});
|
473
480
|
});
|
481
|
+
|
482
|
+
function initInlines(el, callback = null) {
|
483
|
+
const data = $(el).data(),
|
484
|
+
inlineOptions = data.inlineFormset;
|
485
|
+
let selector;
|
486
|
+
switch (data.inlineType) {
|
487
|
+
case "stacked":
|
488
|
+
selector = inlineOptions.name + "-group .inline-related";
|
489
|
+
$(selector).stackedFormset(selector, inlineOptions.options, callback);
|
490
|
+
break;
|
491
|
+
case "tabular":
|
492
|
+
selector =
|
493
|
+
inlineOptions.name +
|
494
|
+
"-group .tabular.inline-related tbody:last > tr.form-row";
|
495
|
+
$(selector).tabularFormset(selector, inlineOptions.options, callback);
|
496
|
+
break;
|
497
|
+
}
|
498
|
+
}
|
474
499
|
}
|