django-unfold 0.40.0__tar.gz → 0.41.0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. {django_unfold-0.40.0 → django_unfold-0.41.0}/PKG-INFO +6 -1
  2. {django_unfold-0.40.0 → django_unfold-0.41.0}/README.md +4 -0
  3. {django_unfold-0.40.0 → django_unfold-0.41.0}/pyproject.toml +3 -2
  4. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/admin.py +5 -0
  5. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/forms.py +2 -2
  6. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/forms/templates/unfold/forms/array.html +2 -2
  7. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage.html +1 -1
  8. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html +1 -1
  9. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html +1 -1
  10. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/export.html +1 -1
  11. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/import.html +1 -1
  12. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/simple_history/templates/simple_history/object_history_form.html +1 -1
  13. django_unfold-0.41.0/src/unfold/static/admin/js/inlines.js +439 -0
  14. django_unfold-0.41.0/src/unfold/static/unfold/css/styles.css +1 -0
  15. django_unfold-0.41.0/src/unfold/static/unfold/fonts/material-symbols/Material-Symbols-Outlined.woff2 +0 -0
  16. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/fonts/material-symbols/styles.css +1 -2
  17. django_unfold-0.41.0/src/unfold/static/unfold/js/alpine.sort.js +1 -0
  18. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/js/app.js +36 -10
  19. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/js/select2.init.js +1 -1
  20. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/styles.css +5 -1
  21. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/app_index.html +1 -1
  22. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/auth/user/change_password.html +1 -1
  23. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/base.html +1 -1
  24. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/change_form.html +1 -1
  25. django_unfold-0.41.0/src/unfold/templates/admin/change_list.html +128 -0
  26. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/delete_confirmation.html +4 -9
  27. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/delete_selected_confirmation.html +4 -8
  28. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/edit_inline/stacked.html +15 -6
  29. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/edit_inline/tabular.html +36 -19
  30. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/object_history.html +1 -1
  31. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/submit_line.html +8 -8
  32. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/registration/password_change_done.html +1 -1
  33. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/registration/password_change_form.html +1 -1
  34. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/change_list_filter.html +7 -9
  35. django_unfold-0.41.0/src/unfold/templates/unfold/helpers/delete_submit_line.html +11 -0
  36. django_unfold-0.41.0/src/unfold/templates/unfold/helpers/display_header.html +30 -0
  37. django_unfold-0.41.0/src/unfold/templates/unfold/helpers/field_readonly_value.html +1 -0
  38. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/fieldset_row.html +2 -0
  39. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/layouts/skeleton.html +1 -0
  40. django_unfold-0.41.0/src/unfold/templates/unfold/widgets/url.html +9 -0
  41. django_unfold-0.40.0/src/unfold/static/unfold/css/styles.css +0 -1
  42. django_unfold-0.40.0/src/unfold/static/unfold/fonts/material-symbols/Material-Symbols-Outlined.woff2 +0 -0
  43. django_unfold-0.40.0/src/unfold/templates/admin/change_list.html +0 -126
  44. django_unfold-0.40.0/src/unfold/templates/unfold/helpers/display_header.html +0 -25
  45. django_unfold-0.40.0/src/unfold/templates/unfold/helpers/field_readonly_value.html +0 -1
  46. django_unfold-0.40.0/src/unfold/templates/unfold/widgets/url.html +0 -7
  47. {django_unfold-0.40.0 → django_unfold-0.41.0}/LICENSE.md +0 -0
  48. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/__init__.py +0 -0
  49. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/apps.py +0 -0
  50. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/checks.py +0 -0
  51. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/__init__.py +0 -0
  52. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/__init__.py +0 -0
  53. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/admin.py +0 -0
  54. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/apps.py +0 -0
  55. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/static/unfold/filters/css/nouislider.min.css +0 -0
  56. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/static/unfold/filters/js/DateTimeShortcuts.js +0 -0
  57. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/static/unfold/filters/js/admin-numeric-filter.js +0 -0
  58. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/static/unfold/filters/js/nouislider.min.js +0 -0
  59. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/static/unfold/filters/js/wNumb.min.js +0 -0
  60. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_date_range.html +0 -0
  61. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_datetime_range.html +0 -0
  62. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_field.html +0 -0
  63. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_numeric_range.html +0 -0
  64. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_numeric_single.html +0 -0
  65. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html +0 -0
  66. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/forms/__init__.py +0 -0
  67. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/forms/apps.py +0 -0
  68. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/forms/static/unfold/forms/css/trix.css +0 -0
  69. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/forms/static/unfold/forms/js/trix.config.js +0 -0
  70. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/forms/static/unfold/forms/js/trix.js +0 -0
  71. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/forms/templates/unfold/forms/helpers/toolbar.html +0 -0
  72. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/forms/templates/unfold/forms/wysiwyg.html +0 -0
  73. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/forms/widgets.py +0 -0
  74. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/guardian/__init__.py +0 -0
  75. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/guardian/apps.py +0 -0
  76. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/change_form.html +0 -0
  77. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/guardian/templates/admin/guardian/model/field.html +0 -0
  78. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/guardian/templates/unfold/guardian/group_form.html +0 -0
  79. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/guardian/templates/unfold/guardian/user_form.html +0 -0
  80. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/__init__.py +0 -0
  81. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/apps.py +0 -0
  82. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/forms.py +0 -0
  83. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/base.html +0 -0
  84. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_form.html +0 -0
  85. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_export.html +0 -0
  86. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_export_item.html +0 -0
  87. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_import_export.html +0 -0
  88. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/change_list_import_item.html +0 -0
  89. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_confirm.html +0 -0
  90. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_errors.html +0 -0
  91. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_form.html +0 -0
  92. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_preview.html +0 -0
  93. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/import_validation.html +0 -0
  94. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/import_export/templates/admin/import_export/resource_fields_list.html +0 -0
  95. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/inlines/__init__.py +0 -0
  96. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/inlines/admin.py +0 -0
  97. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/inlines/apps.py +0 -0
  98. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/inlines/checks.py +0 -0
  99. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/inlines/forms.py +0 -0
  100. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/simple_history/__init__.py +0 -0
  101. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/simple_history/apps.py +0 -0
  102. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/simple_history/templates/simple_history/object_history.html +0 -0
  103. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/simple_history/templates/simple_history/object_history_list.html +0 -0
  104. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/contrib/simple_history/templates/simple_history/submit_line.html +0 -0
  105. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/dataclasses.py +0 -0
  106. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/decorators.py +0 -0
  107. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/exceptions.py +0 -0
  108. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/fields.py +0 -0
  109. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/forms.py +0 -0
  110. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/settings.py +0 -0
  111. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/sites.py +0 -0
  112. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/admin/js/admin/RelatedObjectLookups.js +0 -0
  113. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/css/simplebar.css +0 -0
  114. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/fonts/inter/Inter-Bold.woff2 +0 -0
  115. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/fonts/inter/Inter-Medium.woff2 +0 -0
  116. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/fonts/inter/Inter-Regular.woff2 +0 -0
  117. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/fonts/inter/Inter-SemiBold.woff2 +0 -0
  118. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/fonts/inter/styles.css +0 -0
  119. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/js/alpine.anchor.js +0 -0
  120. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/js/alpine.js +0 -0
  121. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/js/alpine.persist.js +0 -0
  122. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/js/chart.js +0 -0
  123. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/js/htmx.js +0 -0
  124. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/static/unfold/js/simplebar.js +0 -0
  125. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/actions.html +0 -0
  126. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/app_list.html +0 -0
  127. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/auth/user/add_form.html +0 -0
  128. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/base_site.html +0 -0
  129. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/change_form_object_tools.html +0 -0
  130. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/change_list_object_tools.html +0 -0
  131. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/change_list_results.html +0 -0
  132. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/date_hierarchy.html +0 -0
  133. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/filter.html +0 -0
  134. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/includes/fieldset.html +0 -0
  135. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/includes/object_delete_summary.html +0 -0
  136. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/index.html +0 -0
  137. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/login.html +0 -0
  138. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/nav_sidebar.html +0 -0
  139. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/pagination.html +0 -0
  140. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/admin/search_form.html +0 -0
  141. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/auth/widgets/read_only_password_hash.html +0 -0
  142. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/registration/logged_out.html +0 -0
  143. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/button.html +0 -0
  144. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/card.html +0 -0
  145. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/chart/bar.html +0 -0
  146. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/chart/line.html +0 -0
  147. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/container.html +0 -0
  148. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/flex.html +0 -0
  149. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/icon.html +0 -0
  150. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/navigation.html +0 -0
  151. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/progress.html +0 -0
  152. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/separator.html +0 -0
  153. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/table.html +0 -0
  154. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/text.html +0 -0
  155. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/components/title.html +0 -0
  156. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/account_links.html +0 -0
  157. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/actions_row.html +0 -0
  158. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/add_link.html +0 -0
  159. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/app_list.html +0 -0
  160. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/app_list_default.html +0 -0
  161. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/attrs.html +0 -0
  162. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/boolean.html +0 -0
  163. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/breadcrumb_item.html +0 -0
  164. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/display_label.html +0 -0
  165. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/field.html +0 -0
  166. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/field_readonly.html +0 -0
  167. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/fieldsets_tabs.html +0 -0
  168. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/form_errors.html +0 -0
  169. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/form_label.html +0 -0
  170. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/header.html +0 -0
  171. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/help_text.html +0 -0
  172. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/history.html +0 -0
  173. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/label.html +0 -0
  174. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/messages/error.html +0 -0
  175. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/messages/errornote.html +0 -0
  176. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/messages/info.html +0 -0
  177. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/messages.html +0 -0
  178. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/navigation.html +0 -0
  179. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/pagination_current_item.html +0 -0
  180. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/pagination_ellipsis.html +0 -0
  181. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/search.html +0 -0
  182. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/search_results.html +0 -0
  183. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/site_icon.html +0 -0
  184. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/site_logo.html +0 -0
  185. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/submit.html +0 -0
  186. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/tab_action.html +0 -0
  187. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/tab_list.html +0 -0
  188. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/theme_switch.html +0 -0
  189. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/userlinks.html +0 -0
  190. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/helpers/welcomemsg.html +0 -0
  191. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/layouts/base.html +0 -0
  192. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/layouts/base_simple.html +0 -0
  193. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/clearable_file_input.html +0 -0
  194. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/clearable_file_input_small.html +0 -0
  195. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/date.html +0 -0
  196. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/foreign_key_raw_id.html +0 -0
  197. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/radio.html +0 -0
  198. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/radio_option.html +0 -0
  199. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/range.html +0 -0
  200. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/related_widget_wrapper.html +0 -0
  201. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/split_datetime.html +0 -0
  202. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/split_datetime_vertical.html +0 -0
  203. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/split_money.html +0 -0
  204. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/textarea.html +0 -0
  205. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/textarea_expandable.html +0 -0
  206. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templates/unfold/widgets/time.html +0 -0
  207. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templatetags/__init__.py +0 -0
  208. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templatetags/unfold.py +0 -0
  209. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/templatetags/unfold_list.py +0 -0
  210. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/typing.py +0 -0
  211. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/utils.py +0 -0
  212. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/views.py +0 -0
  213. {django_unfold-0.40.0 → django_unfold-0.41.0}/src/unfold/widgets.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-unfold
3
- Version: 0.40.0
3
+ Version: 0.41.0
4
4
  Summary: Modern Django admin theme for seamless interface development
5
5
  Home-page: https://unfoldadmin.com
6
6
  License: MIT
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.9
18
18
  Classifier: Programming Language :: Python :: 3.10
19
19
  Classifier: Programming Language :: Python :: 3.11
20
20
  Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
21
22
  Requires-Dist: django (>=3.2)
22
23
  Project-URL: Repository, https://github.com/unfoldadmin/django-unfold
23
24
  Description-Content-Type: text/markdown
@@ -37,6 +38,9 @@ Unfold is a theme for Django admin that incorporates common best practices for b
37
38
  - **Unfold:** Demo site is available at [unfoldadmin.com](https://unfoldadmin.com?utm_medium=github&utm_source=unfold).
38
39
  - **Formula:** Repository with demo implementation at [github.com/unfoldadmin/formula](https://github.com/unfoldadmin/formula?utm_medium=github&utm_source=unfold).
39
40
  - **Turbo:** Django & Next.js boilerplate implementing Unfold at [github.com/unfoldadmin/turbo](https://github.com/unfoldadmin/turbo?utm_medium=github&utm_source=unfold).
41
+ - **Discord:** Join the Unfold community on [Discord](https://discord.gg/9sQj9MEbNz).
42
+
43
+
40
44
 
41
45
  ## Are you using Unfold and need help?
42
46
 
@@ -56,6 +60,7 @@ Have you decided to start using Unfold but don’t have time to make the switch
56
60
  - **Inline tabs:** Groups inlines into tab navigation in the change form.
57
61
  - **Model tabs:** Allows defining custom tab navigation for models.
58
62
  - **Fieldset tabs:** Merges multiple fieldsets into tabs in the change form.
63
+ - **Sortable inlines:** Allows sorting inlines by dragging and dropping.
59
64
  - **Environment label**: Distinguishes between environments by displaying a label.
60
65
  - **Nonrelated inlines**: Displays nonrelated models as inlines in the change form.
61
66
  - **Favicons**: Built-in support for configuring various site favicons.
@@ -13,6 +13,9 @@ Unfold is a theme for Django admin that incorporates common best practices for b
13
13
  - **Unfold:** Demo site is available at [unfoldadmin.com](https://unfoldadmin.com?utm_medium=github&utm_source=unfold).
14
14
  - **Formula:** Repository with demo implementation at [github.com/unfoldadmin/formula](https://github.com/unfoldadmin/formula?utm_medium=github&utm_source=unfold).
15
15
  - **Turbo:** Django & Next.js boilerplate implementing Unfold at [github.com/unfoldadmin/turbo](https://github.com/unfoldadmin/turbo?utm_medium=github&utm_source=unfold).
16
+ - **Discord:** Join the Unfold community on [Discord](https://discord.gg/9sQj9MEbNz).
17
+
18
+
16
19
 
17
20
  ## Are you using Unfold and need help?
18
21
 
@@ -32,6 +35,7 @@ Have you decided to start using Unfold but don’t have time to make the switch
32
35
  - **Inline tabs:** Groups inlines into tab navigation in the change form.
33
36
  - **Model tabs:** Allows defining custom tab navigation for models.
34
37
  - **Fieldset tabs:** Merges multiple fieldsets into tabs in the change form.
38
+ - **Sortable inlines:** Allows sorting inlines by dragging and dropping.
35
39
  - **Environment label**: Distinguishes between environments by displaying a label.
36
40
  - **Nonrelated inlines**: Displays nonrelated models as inlines in the change form.
37
41
  - **Favicons**: Built-in support for configuring various site favicons.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "django-unfold"
3
- version = "0.40.0"
3
+ version = "0.41.0"
4
4
  description = "Modern Django admin theme for seamless interface development"
5
5
  license = "MIT"
6
6
  readme = "README.md"
@@ -16,6 +16,7 @@ classifiers = [
16
16
  "Programming Language :: Python :: 3.10",
17
17
  "Programming Language :: Python :: 3.11",
18
18
  "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
19
20
  "Operating System :: OS Independent",
20
21
  "Environment :: Web Environment",
21
22
  "Intended Audience :: Developers",
@@ -89,7 +90,7 @@ legacy_tox_ini = """
89
90
  [tox]
90
91
  isolated_build = true
91
92
  envlist =
92
- python{38,39,310,311,312}-django{32,41,42,50,51}
93
+ python{38,39,310,311,312,313}-django{32,41,42,50,51}
93
94
 
94
95
  [testenv]
95
96
  skip_install = true
@@ -233,6 +233,7 @@ class ModelAdmin(ModelAdminMixin, BaseModelAdmin):
233
233
  add_fieldsets = ()
234
234
  list_horizontal_scrollbar_top = False
235
235
  list_filter_submit = False
236
+ list_filter_sheet = True
236
237
  list_fullwidth = False
237
238
  list_disable_select_all = False
238
239
  list_before_template = None
@@ -560,8 +561,12 @@ class ModelAdmin(ModelAdminMixin, BaseModelAdmin):
560
561
  class TabularInline(ModelAdminMixin, BaseTabularInline):
561
562
  formfield_overrides = FORMFIELD_OVERRIDES_INLINE
562
563
  readonly_preprocess_fields = {}
564
+ ordering_field = None
565
+ hide_ordering_field = False
563
566
 
564
567
 
565
568
  class StackedInline(ModelAdminMixin, BaseStackedInline):
566
569
  formfield_overrides = FORMFIELD_OVERRIDES_INLINE
567
570
  readonly_preprocess_fields = {}
571
+ ordering_field = None
572
+ hide_ordering_field = False
@@ -26,7 +26,7 @@ class DropdownForm(forms.Form):
26
26
  widget = UnfoldAdminSelectWidget(
27
27
  attrs={
28
28
  "data-theme": "admin-autocomplete",
29
- "class": "admin-autocomplete",
29
+ "class": "unfold-admin-autocomplete admin-autocomplete",
30
30
  }
31
31
  )
32
32
  field = ChoiceField
@@ -38,7 +38,7 @@ class DropdownForm(forms.Form):
38
38
  self.widget = UnfoldAdminSelectMultipleWidget(
39
39
  attrs={
40
40
  "data-theme": "admin-autocomplete",
41
- "class": "admin-autocomplete",
41
+ "class": "unfold-admin-autocomplete admin-autocomplete",
42
42
  }
43
43
  )
44
44
  self.field = MultipleChoiceField
@@ -14,7 +14,7 @@
14
14
  {% endfor %}
15
15
 
16
16
  <template x-for="(item, index) in items" :key="item.key">
17
- <div class="flex flex-row">
17
+ <div class="flex flex-row" x-init="if ($el.getElementsByTagName('input')[0].name.includes('__prefix__')) { $el.getElementsByTagName('input')[0].name = $el.parentElement.getElementsByTagName('input')[0].name }">
18
18
  {% with widget=template %}
19
19
  {% include template.template_name %}
20
20
  {% endwith %}
@@ -26,7 +26,7 @@
26
26
  </template>
27
27
 
28
28
  <div class="flex flex-row">
29
- <div x-on:click="items.push({ key: new Date().getTime()})" class="bg-primary-600 border border-transparent cursor-pointer font-medium inline-block px-3 py-2 rounded-md text-sm text-white w-full lg:w-auto">
29
+ <div x-on:click="items.push({ key: new Date().getTime()})" class="bg-primary-600 border border-transparent cursor-pointer font-medium inline-block px-3 py-2 rounded-md text-center text-sm text-white w-full lg:w-auto">
30
30
  {% trans "Add new item" %}
31
31
  </div>
32
32
  </div>
@@ -5,7 +5,7 @@
5
5
  {% block breadcrumbs %}{% if not is_popup %}
6
6
  <div class="px-4 lg:px-12">
7
7
  <div class="container mb-6 mx-auto -my-3 lg:mb-12">
8
- <ul class="flex">
8
+ <ul class="flex flex-wrap">
9
9
  {% url 'admin:index' as link %}
10
10
  {% trans 'Home' as name %}
11
11
  {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
@@ -8,7 +8,7 @@
8
8
  {% block breadcrumbs %}{% if not is_popup %}
9
9
  <div class="px-4 lg:px-12">
10
10
  <div class="container mb-6 mx-auto -my-3 lg:mb-12">
11
- <ul class="flex">
11
+ <ul class="flex flex-wrap">
12
12
  {% url 'admin:index' as link %}
13
13
  {% trans 'Home' as name %}
14
14
  {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
@@ -9,7 +9,7 @@
9
9
  {% block breadcrumbs %}{% if not is_popup %}
10
10
  <div class="px-4 lg:px-12">
11
11
  <div class="container mb-6 mx-auto -my-3 lg:mb-12">
12
- <ul class="flex">
12
+ <ul class="flex flex-wrap">
13
13
  {% url 'admin:index' as link %}
14
14
  {% trans 'Home' as name %}
15
15
  {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
@@ -12,7 +12,7 @@
12
12
  {% block breadcrumbs %}
13
13
  <div class="px-4 lg:px-12">
14
14
  <div class="container mb-6 mx-auto -my-3 lg:mb-12">
15
- <ul class="flex">
15
+ <ul class="flex flex-wrap">
16
16
  {% url 'admin:index' as link %}
17
17
  {% trans 'Home' as name %}
18
18
  {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
@@ -23,7 +23,7 @@
23
23
  {% block breadcrumbs %}
24
24
  <div class="px-4 lg:px-12">
25
25
  <div class="container mb-6 mx-auto -my-3 lg:mb-12">
26
- <ul class="flex">
26
+ <ul class="flex flex-wrap">
27
27
  {% url 'admin:index' as link %}
28
28
  {% trans 'Home' as name %}
29
29
  {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
@@ -6,7 +6,7 @@
6
6
  {% block breadcrumbs %}
7
7
  <div class="px-4 lg:px-12">
8
8
  <div class="container mb-6 mx-auto -my-3 lg:mb-12">
9
- <ul class="flex">
9
+ <ul class="flex flex-wrap">
10
10
  {% url 'admin:index' as link %}
11
11
  {% trans 'Home' as name %}
12
12
  {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
@@ -0,0 +1,439 @@
1
+ /*global DateTimeShortcuts, SelectFilter*/
2
+ /**
3
+ * Django admin inlines
4
+ *
5
+ * Based on jQuery Formset 1.1
6
+ * @author Stanislaus Madueke (stan DOT madueke AT gmail DOT com)
7
+ * @requires jQuery 1.2.6 or later
8
+ *
9
+ * Copyright (c) 2009, Stanislaus Madueke
10
+ * All rights reserved.
11
+ *
12
+ * Spiced up with Code from Zain Memon's GSoC project 2009
13
+ * and modified for Django by Jannis Leidel, Travis Swicegood and Julien Phalip.
14
+ *
15
+ * Licensed under the New BSD License
16
+ * See: https://opensource.org/licenses/bsd-license.php
17
+ */
18
+ "use strict";
19
+ {
20
+ const $ = django.jQuery;
21
+ $.fn.formset = function (opts) {
22
+ const options = $.extend({}, $.fn.formset.defaults, opts);
23
+ const $this = $(this);
24
+ const $parent = $this.parent();
25
+ const updateElementIndex = function (el, prefix, ndx) {
26
+ const id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))");
27
+ const replacement = prefix + "-" + ndx;
28
+ if ($(el).prop("for")) {
29
+ $(el).prop("for", $(el).prop("for").replace(id_regex, replacement));
30
+ }
31
+ if (el.id) {
32
+ el.id = el.id.replace(id_regex, replacement);
33
+ }
34
+ if (el.name) {
35
+ el.name = el.name.replace(id_regex, replacement);
36
+ }
37
+ };
38
+ const totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").prop(
39
+ "autocomplete",
40
+ "off"
41
+ );
42
+ let nextIndex = parseInt(totalForms.val(), 10);
43
+ const maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").prop(
44
+ "autocomplete",
45
+ "off"
46
+ );
47
+ const minForms = $("#id_" + options.prefix + "-MIN_NUM_FORMS").prop(
48
+ "autocomplete",
49
+ "off"
50
+ );
51
+ let addButton;
52
+
53
+ /**
54
+ * The "Add another MyModel" button below the inline forms.
55
+ */
56
+ const addInlineAddButton = function () {
57
+ if (addButton === null) {
58
+ if ($this.prop("tagName") === "TR") {
59
+ // If forms are laid out as table rows, insert the
60
+ // "add" button in a new table row:
61
+ const numCols = $this.eq(-1).children().length;
62
+ $parent.append(
63
+ '<tr class="' +
64
+ options.addCssClass +
65
+ '"><td colspan="' +
66
+ numCols +
67
+ '"><a href="#">' +
68
+ options.addText +
69
+ "</a></tr>"
70
+ );
71
+ addButton = $parent.find("tr:last a");
72
+ } else {
73
+ // Otherwise, insert it immediately after the last form:
74
+ $this
75
+ .filter(":last")
76
+ .after(
77
+ '<div class="' +
78
+ options.addCssClass +
79
+ '"><a href="#">' +
80
+ options.addText +
81
+ "</a></div>"
82
+ );
83
+ addButton = $this.filter(":last").next().find("a");
84
+ }
85
+ }
86
+ addButton.on("click", addInlineClickHandler);
87
+ };
88
+
89
+ const addInlineClickHandler = function (e) {
90
+ e.preventDefault();
91
+ const template = $("#" + options.prefix + "-empty");
92
+ const row = template.clone(true);
93
+ row
94
+ .removeClass(options.emptyCssClass)
95
+ .addClass(options.formCssClass)
96
+ .attr("id", options.prefix + "-" + nextIndex);
97
+ addInlineDeleteButton(row);
98
+ row.find("*").each(function () {
99
+ updateElementIndex(this, options.prefix, totalForms.val());
100
+ });
101
+ // Insert the new form when it has been fully edited.
102
+ row.insertBefore($(template));
103
+ // Update number of total forms.
104
+ $(totalForms).val(parseInt(totalForms.val(), 10) + 1);
105
+ nextIndex += 1;
106
+ // Hide the add button if there's a limit and it's been reached.
107
+ if (maxForms.val() !== "" && maxForms.val() - totalForms.val() <= 0) {
108
+ addButton.parent().hide();
109
+ }
110
+ // Show the remove buttons if there are more than min_num.
111
+ toggleDeleteButtonVisibility(row.closest(".inline-group"));
112
+
113
+ // Pass the new form to the post-add callback, if provided.
114
+ if (options.added) {
115
+ options.added(row);
116
+ }
117
+ row.get(0).dispatchEvent(
118
+ new CustomEvent("formset:added", {
119
+ bubbles: true,
120
+ detail: {
121
+ formsetName: options.prefix,
122
+ },
123
+ })
124
+ );
125
+ };
126
+
127
+ /**
128
+ * The "X" button that is part of every unsaved inline.
129
+ * (When saved, it is replaced with a "Delete" checkbox.)
130
+ */
131
+ const addInlineDeleteButton = function (row) {
132
+ if (row.is("tr")) {
133
+ // If the forms are laid out in table rows, insert
134
+ // the remove button into the last table cell:
135
+ row
136
+ .children(":last")
137
+ .append(
138
+ '<div><a class="' +
139
+ options.deleteCssClass +
140
+ '" href="#">' +
141
+ options.deleteText +
142
+ "</a></div>"
143
+ );
144
+ } else if (row.is("ul") || row.is("ol")) {
145
+ // If they're laid out as an ordered/unordered list,
146
+ // insert an <li> after the last list item:
147
+ row.append(
148
+ '<li><a class="' +
149
+ options.deleteCssClass +
150
+ '" href="#">' +
151
+ options.deleteText +
152
+ "</a></li>"
153
+ );
154
+ } else {
155
+ // Otherwise, just insert the remove button as the
156
+ // last child element of the form's container:
157
+ row
158
+ .children(":first")
159
+ .append(
160
+ '<span><a class="' +
161
+ options.deleteCssClass +
162
+ '" href="#">' +
163
+ options.deleteText +
164
+ "</a></span>"
165
+ );
166
+ }
167
+ // Add delete handler for each row.
168
+ row
169
+ .find("a." + options.deleteCssClass)
170
+ .on("click", inlineDeleteHandler.bind(this));
171
+ };
172
+
173
+ const inlineDeleteHandler = function (e1) {
174
+ e1.preventDefault();
175
+ const deleteButton = $(e1.target);
176
+ const row = deleteButton.closest("." + options.formCssClass);
177
+ const inlineGroup = row.closest(".inline-group");
178
+ // Remove the parent form containing this button,
179
+ // and also remove the relevant row with non-field errors:
180
+ const prevRow = row.prev();
181
+ if (prevRow.length && prevRow.hasClass("row-form-errors")) {
182
+ prevRow.remove();
183
+ }
184
+ row.remove();
185
+ nextIndex -= 1;
186
+ // Pass the deleted form to the post-delete callback, if provided.
187
+ if (options.removed) {
188
+ options.removed(row);
189
+ }
190
+ document.dispatchEvent(
191
+ new CustomEvent("formset:removed", {
192
+ detail: {
193
+ formsetName: options.prefix,
194
+ },
195
+ })
196
+ );
197
+ // Update the TOTAL_FORMS form count.
198
+ const forms = $("." + options.formCssClass);
199
+ $("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length);
200
+ // Show add button again once below maximum number.
201
+ if (maxForms.val() === "" || maxForms.val() - forms.length > 0) {
202
+ addButton.parent().show();
203
+ }
204
+ // Hide the remove buttons if at min_num.
205
+ toggleDeleteButtonVisibility(inlineGroup);
206
+ // Also, update names and ids for all remaining form controls so
207
+ // they remain in sequence:
208
+ let i, formCount;
209
+ const updateElementCallback = function () {
210
+ updateElementIndex(this, options.prefix, i);
211
+ };
212
+ for (i = 0, formCount = forms.length; i < formCount; i++) {
213
+ updateElementIndex($(forms).get(i), options.prefix, i);
214
+ $(forms.get(i)).find("*").each(updateElementCallback);
215
+ }
216
+ };
217
+
218
+ const toggleDeleteButtonVisibility = function (inlineGroup) {
219
+ if (minForms.val() !== "" && minForms.val() - totalForms.val() >= 0) {
220
+ inlineGroup.find(".inline-deletelink").hide();
221
+ } else {
222
+ inlineGroup.find(".inline-deletelink").show();
223
+ }
224
+ };
225
+
226
+ $this.each(function (i) {
227
+ $(this)
228
+ .not("." + options.emptyCssClass)
229
+ .addClass(options.formCssClass);
230
+ });
231
+
232
+ // Create the delete buttons for all unsaved inlines:
233
+ $this
234
+ .filter(
235
+ "." +
236
+ options.formCssClass +
237
+ ":not(.has_original):not(." +
238
+ options.emptyCssClass +
239
+ ")"
240
+ )
241
+ .each(function () {
242
+ addInlineDeleteButton($(this));
243
+ });
244
+ toggleDeleteButtonVisibility($this);
245
+
246
+ // Create the add button, initially hidden.
247
+ addButton = options.addButton;
248
+ addInlineAddButton();
249
+
250
+ // Show the add button if allowed to add more items.
251
+ // Note that max_num = None translates to a blank string.
252
+ const showAddButton =
253
+ maxForms.val() === "" || maxForms.val() - totalForms.val() > 0;
254
+ if ($this.length && showAddButton) {
255
+ addButton.parent().show();
256
+ } else {
257
+ addButton.parent().hide();
258
+ }
259
+
260
+ return this;
261
+ };
262
+
263
+ /* Setup plugin defaults */
264
+ $.fn.formset.defaults = {
265
+ prefix: "form", // The form prefix for your django formset
266
+ addText: "add another", // Text for the add link
267
+ deleteText: "remove", // Text for the delete link
268
+ addCssClass: "add-row", // CSS class applied to the add link
269
+ deleteCssClass: "delete-row", // CSS class applied to the delete link
270
+ emptyCssClass: "empty-row", // CSS class applied to the empty row
271
+ formCssClass: "dynamic-form", // CSS class applied to each form in a formset
272
+ added: null, // Function called each time a new form is added
273
+ removed: null, // Function called each time a form is deleted
274
+ addButton: null, // Existing add button to use
275
+ };
276
+
277
+ // Tabular inlines ---------------------------------------------------------
278
+ $.fn.tabularFormset = function (selector, options) {
279
+ const $rows = $(this);
280
+
281
+ const reinitDateTimeShortCuts = function () {
282
+ // Reinitialize the calendar and clock widgets by force
283
+ if (typeof DateTimeShortcuts !== "undefined") {
284
+ $(".datetimeshortcuts").remove();
285
+ DateTimeShortcuts.init();
286
+ }
287
+ };
288
+
289
+ const updateSelectFilter = function () {
290
+ // If any SelectFilter widgets are a part of the new form,
291
+ // instantiate a new SelectFilter instance for it.
292
+ if (typeof SelectFilter !== "undefined") {
293
+ $(".selectfilter").each(function (index, value) {
294
+ SelectFilter.init(value.id, this.dataset.fieldName, false);
295
+ });
296
+ $(".selectfilterstacked").each(function (index, value) {
297
+ SelectFilter.init(value.id, this.dataset.fieldName, true);
298
+ });
299
+ }
300
+ };
301
+
302
+ const initPrepopulatedFields = function (row) {
303
+ row.find(".prepopulated_field").each(function () {
304
+ const field = $(this),
305
+ input = field.find("input, select, textarea"),
306
+ dependency_list = input.data("dependency_list") || [],
307
+ dependencies = [];
308
+ $.each(dependency_list, function (i, field_name) {
309
+ dependencies.push(
310
+ "#" +
311
+ row
312
+ .find(".field-" + field_name)
313
+ .find("input, select, textarea")
314
+ .attr("id")
315
+ );
316
+ });
317
+ if (dependencies.length) {
318
+ input.prepopulate(dependencies, input.attr("maxlength"));
319
+ }
320
+ });
321
+ };
322
+
323
+ $rows.formset({
324
+ prefix: options.prefix,
325
+ addText: options.addText,
326
+ formCssClass: "dynamic-" + options.prefix,
327
+ deleteCssClass: "inline-deletelink",
328
+ deleteText: options.deleteText,
329
+ emptyCssClass: "empty-form",
330
+ added: function (row) {
331
+ initPrepopulatedFields(row);
332
+ reinitDateTimeShortCuts();
333
+ updateSelectFilter();
334
+ },
335
+ addButton: options.addButton,
336
+ });
337
+
338
+ return $rows;
339
+ };
340
+
341
+ // Stacked inlines ---------------------------------------------------------
342
+ $.fn.stackedFormset = function (selector, options) {
343
+ const $rows = $(this);
344
+ const updateInlineLabel = function (row) {
345
+ $(selector)
346
+ .find(".inline_label")
347
+ .each(function (i) {
348
+ const count = i + 1;
349
+ $(this).html(
350
+ $(this)
351
+ .html()
352
+ .replace(/(#\d+)/g, "#" + count)
353
+ );
354
+ });
355
+ };
356
+
357
+ const reinitDateTimeShortCuts = function () {
358
+ // Reinitialize the calendar and clock widgets by force, yuck.
359
+ if (typeof DateTimeShortcuts !== "undefined") {
360
+ $(".datetimeshortcuts").remove();
361
+ DateTimeShortcuts.init();
362
+ }
363
+ };
364
+
365
+ const updateSelectFilter = function () {
366
+ // If any SelectFilter widgets were added, instantiate a new instance.
367
+ if (typeof SelectFilter !== "undefined") {
368
+ $(".selectfilter").each(function (index, value) {
369
+ SelectFilter.init(value.id, this.dataset.fieldName, false);
370
+ });
371
+ $(".selectfilterstacked").each(function (index, value) {
372
+ SelectFilter.init(value.id, this.dataset.fieldName, true);
373
+ });
374
+ }
375
+ };
376
+
377
+ const initPrepopulatedFields = function (row) {
378
+ row.find(".prepopulated_field").each(function () {
379
+ const field = $(this),
380
+ input = field.find("input, select, textarea"),
381
+ dependency_list = input.data("dependency_list") || [],
382
+ dependencies = [];
383
+ $.each(dependency_list, function (i, field_name) {
384
+ // Dependency in a fieldset.
385
+ let field_element = row.find(".form-row .field-" + field_name);
386
+ // Dependency without a fieldset.
387
+ if (!field_element.length) {
388
+ field_element = row.find(".form-row.field-" + field_name);
389
+ }
390
+ dependencies.push(
391
+ "#" + field_element.find("input, select, textarea").attr("id")
392
+ );
393
+ });
394
+ if (dependencies.length) {
395
+ input.prepopulate(dependencies, input.attr("maxlength"));
396
+ }
397
+ });
398
+ };
399
+
400
+ $rows.formset({
401
+ prefix: options.prefix,
402
+ addText: options.addText,
403
+ formCssClass: "dynamic-" + options.prefix,
404
+ deleteCssClass: "inline-deletelink",
405
+ deleteText: options.deleteText,
406
+ emptyCssClass: "empty-form",
407
+ removed: updateInlineLabel,
408
+ added: function (row) {
409
+ initPrepopulatedFields(row);
410
+ reinitDateTimeShortCuts();
411
+ updateSelectFilter();
412
+ updateInlineLabel(row);
413
+ },
414
+ addButton: options.addButton,
415
+ });
416
+
417
+ return $rows;
418
+ };
419
+
420
+ $(document).ready(function () {
421
+ $(".js-inline-admin-formset").each(function () {
422
+ const data = $(this).data(),
423
+ inlineOptions = data.inlineFormset;
424
+ let selector;
425
+ switch (data.inlineType) {
426
+ case "stacked":
427
+ selector = inlineOptions.name + "-group .inline-related";
428
+ $(selector).stackedFormset(selector, inlineOptions.options);
429
+ break;
430
+ case "tabular":
431
+ selector =
432
+ inlineOptions.name +
433
+ "-group .tabular.inline-related tbody:last > tr.form-row";
434
+ $(selector).tabularFormset(selector, inlineOptions.options);
435
+ break;
436
+ }
437
+ });
438
+ });
439
+ }