django-unfold 0.60.0__py3-none-any.whl → 0.61.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.
Files changed (40) hide show
  1. {django_unfold-0.60.0.dist-info → django_unfold-0.61.0.dist-info}/METADATA +15 -6
  2. {django_unfold-0.60.0.dist-info → django_unfold-0.61.0.dist-info}/RECORD +40 -37
  3. unfold/admin.py +1 -1
  4. unfold/contrib/import_export/templates/admin/import_export/change_list_import.html +5 -0
  5. unfold/contrib/simple_history/templates/simple_history/submit_line.html +16 -18
  6. unfold/forms.py +2 -2
  7. unfold/mixins/base_model_admin.py +7 -2
  8. unfold/sites.py +15 -2
  9. unfold/static/unfold/css/styles.css +1 -1
  10. unfold/static/unfold/js/app.js +61 -0
  11. unfold/styles.css +3 -5
  12. unfold/templates/admin/auth/user/add_form.html +1 -5
  13. unfold/templates/admin/change_form.html +3 -1
  14. unfold/templates/admin/change_list.html +4 -2
  15. unfold/templates/admin/change_list_results.html +3 -3
  16. unfold/templates/admin/edit_inline/stacked.html +8 -2
  17. unfold/templates/admin/edit_inline/tabular.html +2 -2
  18. unfold/templates/admin/includes/fieldset.html +9 -3
  19. unfold/templates/admin/search_form.html +14 -5
  20. unfold/templates/admin/submit_line.html +1 -1
  21. unfold/templates/unfold/components/card.html +4 -4
  22. unfold/templates/unfold/helpers/add_link.html +3 -1
  23. unfold/templates/unfold/helpers/fieldsets_tabs.html +3 -3
  24. unfold/templates/unfold/helpers/help_text.html +1 -1
  25. unfold/templates/unfold/helpers/messages.html +4 -4
  26. unfold/templates/unfold/helpers/pagination.html +1 -1
  27. unfold/templates/unfold/helpers/popup_header.html +27 -0
  28. unfold/templates/unfold/helpers/search.html +16 -12
  29. unfold/templates/unfold/helpers/search_results.html +10 -9
  30. unfold/templates/unfold/helpers/shortcut.html +3 -0
  31. unfold/templates/unfold/helpers/site_branding.html +2 -2
  32. unfold/templates/unfold/helpers/tab_action.html +4 -3
  33. unfold/templates/unfold_crispy/field.html +12 -10
  34. unfold/templates/unfold_crispy/layout/checkbox.html +20 -4
  35. unfold/templates/unfold_crispy/layout/fieldset.html +3 -3
  36. unfold/templatetags/unfold.py +3 -3
  37. unfold/templatetags/unfold_list.py +4 -1
  38. unfold/widgets.py +2 -1
  39. {django_unfold-0.60.0.dist-info → django_unfold-0.61.0.dist-info}/LICENSE.md +0 -0
  40. {django_unfold-0.60.0.dist-info → django_unfold-0.61.0.dist-info}/WHEEL +0 -0
@@ -340,7 +340,7 @@ def preserve_changelist_filters(context: Context) -> dict[str, dict[str, str]]:
340
340
  @register.simple_tag(takes_context=True)
341
341
  def element_classes(context: Context, key: str) -> str:
342
342
  if key in context.get("element_classes", {}):
343
- if isinstance(context["element_classes"][key], list | tuple):
343
+ if isinstance(context["element_classes"][key], (list, tuple)):
344
344
  return " ".join(context["element_classes"][key])
345
345
 
346
346
  return context["element_classes"][key]
@@ -385,8 +385,8 @@ def fieldset_row_classes(context: Context) -> str:
385
385
  if (
386
386
  formset
387
387
  and hasattr(field.field, "name")
388
- and field.field.name == formset.opts.ordering_field
389
- and formset.opts.hide_ordering_field
388
+ and field.field.name == getattr(formset.opts, "ordering_field", None)
389
+ and getattr(formset.opts, "hide_ordering_field", False)
390
390
  ):
391
391
  classes.append("hidden")
392
392
 
@@ -38,7 +38,10 @@ from unfold.widgets import UnfoldBooleanWidget
38
38
 
39
39
  register = Library()
40
40
 
41
- LINK_CLASSES = []
41
+ LINK_CLASSES = [
42
+ "text-font-important-light",
43
+ "dark:text-font-important-dark",
44
+ ]
42
45
 
43
46
  ROW_CLASSES = [
44
47
  "align-middle",
unfold/widgets.py CHANGED
@@ -290,7 +290,8 @@ FILE_CLASSES = [
290
290
 
291
291
  class UnfoldPrefixSuffixMixin:
292
292
  def get_context(self, name, value, attrs):
293
- widget = {}
293
+ context = super().get_context(name, value, attrs)
294
+ widget = context["widget"]
294
295
 
295
296
  if "prefix" in self.attrs:
296
297
  widget["prefix"] = self.attrs["prefix"]