Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: collapsible empty inline #702

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/unfold/templates/admin/edit_inline/stacked.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ <h2 class="bg-gray-100 border border-transparent font-semibold mb-6 px-4 py-3 ro
{% include "unfold/helpers/messages/error.html" with errors=inline_admin_formset.formset.non_form_errors %}

{% if inline_admin_formset.forms|length == 0 %}
<p class="mb-6 text-sm">
{% trans "No records found." %}
</p>
<div>
<p class="mb-6 text-sm">
{% trans "No records found." %}
</p>
</div>
{% else %}
<div class="border border-gray-200 mb-6 overflow-hidden rounded-md shadow-sm w-full dark:border-gray-800">
{% for inline_admin_form in inline_admin_formset %}
Expand Down
10 changes: 6 additions & 4 deletions src/unfold/templates/unfold/widgets/foreign_key_raw_id.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
{% endif %}

{% if link_url %}
<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">
<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">
{{ link_label }}
</a>
{% else %}
<span title="{{ link_label }}" class="bg-white flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-sm">
{{ link_label }}
</span>
{% if link_label %}
<span title="{{ link_label }}" class="flex items-center h-9.5 justify-center ml-4 rounded shrink-0 text-sm truncate">
{{ link_label }}
</span>
{% endif %}
{% endif %}
</div>