Skip to content

Commit eb3a3c6

Browse files
authored
fix: collapsible empty inline (#702)
1 parent 421ee23 commit eb3a3c6

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/unfold/templates/admin/edit_inline/stacked.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
1414
{% include "unfold/helpers/messages/error.html" with errors=inline_admin_formset.formset.non_form_errors %}
1515

1616
{% if inline_admin_formset.forms|length == 0 %}
17-
<p class="mb-6 text-sm">
18-
{% trans "No records found." %}
19-
</p>
17+
<div>
18+
<p class="mb-6 text-sm">
19+
{% trans "No records found." %}
20+
</p>
21+
</div>
2022
{% else %}
2123
<div class="border border-gray-200 mb-6 overflow-hidden rounded-md shadow-sm w-full dark:border-gray-800">
2224
{% for inline_admin_form in inline_admin_formset %}

src/unfold/templates/unfold/widgets/foreign_key_raw_id.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
{% endif %}
99

1010
{% if link_url %}
11-
<a href="{{ link_url }}" title="{{ link_label }}" class="flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-primary-600 text-sm dark:text-primary-500">
11+
<a href="{{ link_url }}" title="{{ link_label }}" class="flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-primary-600 text-sm truncate dark:text-primary-500">
1212
{{ link_label }}
1313
</a>
1414
{% else %}
15-
<span title="{{ link_label }}" class="bg-white flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-sm">
16-
{{ link_label }}
17-
</span>
15+
{% if link_label %}
16+
<span title="{{ link_label }}" class="flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-sm truncate">
17+
{{ link_label }}
18+
</span>
19+
{% endif %}
1820
{% endif %}
1921
</div>

0 commit comments

Comments
 (0)