mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-05-02 04:24:45 +00:00
Show a nice message if the have no visible fields.
This commit is contained in:
parent
ee445acadf
commit
b169d28653
3 changed files with 19 additions and 2 deletions
|
|
@ -1,7 +1,12 @@
|
|||
{% load admin2_tags crispy_forms_tags %}
|
||||
{% load admin2_tags crispy_forms_tags i18n %}
|
||||
|
||||
{% for inline_form in formset %}
|
||||
<div class="change_form space-below">
|
||||
{{ inline_form|crispy }}
|
||||
{% if not inline_form.visible_fields %}
|
||||
<p class="alert alert-warning empty-form">
|
||||
{% trans "This form doesn't have visible fields. This doesn't mean there isn't hidden fields." %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{% load admin2_tags %}
|
||||
{% load admin2_tags i18n %}
|
||||
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
|
|
@ -21,6 +21,13 @@
|
|||
{{ field }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% if not inline_form.visible_fields %}
|
||||
<td>
|
||||
<p class="alert alert-warning empty-form">
|
||||
{% trans "This form doesn't have visible fields. This doesn't mean there isn't hidden fields." %}
|
||||
</p>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr class="new_row">
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@
|
|||
<div class="change_form">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
{% if not form.visible_fields %}
|
||||
<p class="alert alert-warning empty-form">
|
||||
{% trans "This form doesn't have visible fields. This doesn't mean there isn't hidden fields." %}
|
||||
</p>
|
||||
{% endif %}
|
||||
{% for formset in inlines %}
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue