django-unfold 0.52.0__py3-none-any.whl → 0.54.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.52.0.dist-info → django_unfold-0.54.0.dist-info}/METADATA +1 -1
- {django_unfold-0.52.0.dist-info → django_unfold-0.54.0.dist-info}/RECORD +42 -38
- {django_unfold-0.52.0.dist-info → django_unfold-0.54.0.dist-info}/WHEEL +1 -1
- unfold/contrib/filters/admin/__init__.py +17 -0
- unfold/contrib/filters/admin/choice_filters.py +134 -0
- unfold/contrib/filters/admin/dropdown_filters.py +3 -3
- unfold/contrib/filters/admin/mixins.py +1 -1
- unfold/contrib/filters/admin/text_filters.py +2 -2
- unfold/contrib/filters/forms.py +41 -3
- unfold/contrib/filters/templates/unfold/filters/filters_date_range.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_datetime_range.html +1 -1
- unfold/contrib/filters/templates/unfold/filters/filters_numeric_slider.html +1 -1
- unfold/decorators.py +10 -4
- unfold/forms.py +2 -1
- unfold/paginator.py +10 -0
- unfold/sites.py +8 -6
- unfold/static/admin/js/inlines.js +23 -3
- unfold/static/unfold/css/styles.css +1 -1
- unfold/styles.css +2 -1
- unfold/templates/admin/auth/user/add_form.html +1 -1
- unfold/templates/admin/change_form.html +9 -8
- unfold/templates/admin/change_list.html +15 -13
- unfold/templates/admin/change_list_results.html +1 -1
- unfold/templates/admin/edit_inline/tabular.html +1 -2
- unfold/templates/admin/pagination.html +4 -20
- unfold/templates/unfold/components/chart/cohort.html +2 -2
- unfold/templates/unfold/helpers/change_list_filter.html +2 -2
- unfold/templates/unfold/helpers/change_list_filter_actions.html +28 -26
- unfold/templates/unfold/helpers/edit_inline/tabular_field.html +10 -8
- unfold/templates/unfold/helpers/field.html +4 -2
- unfold/templates/unfold/helpers/fieldset_row.html +19 -7
- unfold/templates/unfold/helpers/form_label.html +1 -1
- unfold/templates/unfold/helpers/pagination_default.html +23 -0
- unfold/templates/unfold/helpers/pagination_infinite.html +11 -0
- unfold/templates/unfold/helpers/site_icon.html +14 -14
- unfold/templates/unfold/helpers/tab_action.html +18 -3
- unfold/templates/unfold/helpers/welcomemsg.html +2 -2
- unfold/templates/unfold/widgets/radio_option.html +1 -1
- unfold/templatetags/unfold.py +66 -29
- unfold/utils.py +11 -0
- unfold/widgets.py +2 -0
- {django_unfold-0.52.0.dist-info → django_unfold-0.54.0.dist-info}/LICENSE.md +0 -0
@@ -96,12 +96,23 @@
|
|
96
96
|
.removeClass(options.emptyCssClass)
|
97
97
|
.addClass(options.formCssClass)
|
98
98
|
.attr("id", options.prefix + "-" + nextIndex);
|
99
|
+
|
99
100
|
addInlineDeleteButton(row);
|
100
101
|
row.find("*").each(function () {
|
101
102
|
updateElementIndex(this, options.prefix, totalForms.val());
|
102
103
|
});
|
104
|
+
|
103
105
|
// Insert the new form when it has been fully edited.
|
104
|
-
|
106
|
+
// !CHANGED from original
|
107
|
+
if ($(template).parent().is("tbody")) {
|
108
|
+
row
|
109
|
+
.wrap('<tbody class="template"></tbody>')
|
110
|
+
.parent()
|
111
|
+
.insertBefore($(template).parent());
|
112
|
+
} else {
|
113
|
+
row.insertBefore($(template));
|
114
|
+
}
|
115
|
+
|
105
116
|
// Update number of total forms.
|
106
117
|
$(totalForms).val(parseInt(totalForms.val(), 10) + 1);
|
107
118
|
nextIndex += 1;
|
@@ -183,7 +194,13 @@
|
|
183
194
|
if (prevRow.length && prevRow.hasClass("row-form-errors")) {
|
184
195
|
prevRow.remove();
|
185
196
|
}
|
186
|
-
|
197
|
+
|
198
|
+
// !CHANGED from original
|
199
|
+
if (deleteButton.parent().parent().parent().parent().is("tbody")) {
|
200
|
+
row.parent().remove();
|
201
|
+
} else {
|
202
|
+
row.remove();
|
203
|
+
}
|
187
204
|
nextIndex -= 1;
|
188
205
|
// Pass the deleted form to the post-delete callback, if provided.
|
189
206
|
if (options.removed) {
|
@@ -245,8 +262,11 @@
|
|
245
262
|
}
|
246
263
|
|
247
264
|
// Create the delete buttons for all unsaved inlines:
|
265
|
+
// !CHANGED from original, added parent() and used find() instead of filter()
|
248
266
|
$this
|
249
|
-
.
|
267
|
+
.parent()
|
268
|
+
.parent()
|
269
|
+
.find(
|
250
270
|
"." +
|
251
271
|
options.formCssClass +
|
252
272
|
":not(.has_original):not(." +
|