Skip to content

Commit

Permalink
fix: django length_is migration (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Jun 5, 2024
1 parent ce583b4 commit 12f41c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/unfold/templates/admin/edit_inline/tabular.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
{{ inline_admin_formset.formset.non_form_errors }}

<div>
{% if not inline_admin_formset.has_add_permission and inline_admin_formset.forms|length_is:0 %}
{% if not inline_admin_formset.has_add_permission and inline_admin_formset.forms|length == 0 %}
<p class="mb-6 text-gray-500 text-sm dark:text-gray-400">
{% trans "No records found." %}
</p>
Expand Down
4 changes: 2 additions & 2 deletions src/unfold/templates/admin/includes/fieldset.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro

<div class="aligned mb-8 {% if not stacked %}border border-gray-200 rounded-md pt-3 px-3 shadow-sm dark:border-gray-800{% endif %}">
{% for line in fieldset %}
<div class="form-row block {% if not line.fields|length_is:'1' %}flex flex-row flex-wrap gap-x-8{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
<div class="form-row block {% if not line.fields|length == 1 %}flex flex-row flex-wrap gap-x-8{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
{% for field in line %}
<div class="flex group {% if field.errors %}errors {% endif %}{% if not line.fields|length_is:1 %}lg:max-w-xs w-full {% endif %}{% if not forloop.parentloop.last %} mb-6 {% else %} mb-3{% endif %} {% if row %}flex-row items-center{% else %}flex-col{% endif %}">
<div class="flex group {% if field.errors %}errors {% endif %}{% if not line.fields|length == 1 %}lg:max-w-xs w-full {% endif %}{% if not forloop.parentloop.last %} mb-6 {% else %} mb-3{% endif %} {% if row %}flex-row items-center{% else %}flex-col{% endif %}">
{% if field.is_checkbox %}
<div class="flex flex-row items-center">
{{ field.field }}{{ field.label_tag }}
Expand Down

0 comments on commit 12f41c3

Please sign in to comment.