Include shared/field.html in single_field_panel.html instead of duplicating

pull/1382/head
Matt Westcott 2015-06-05 14:31:22 +01:00
rodzic 15c9482512
commit 12e44c5b39
2 zmienionych plików z 3 dodań i 22 usunięć

Wyświetl plik

@ -1,27 +1,8 @@
{% load wagtailadmin_tags %}
<fieldset>
<legend>{{ self.heading }}</legend>
<ul class="fields">
<li>
{# render field with markup as per wagtailadmin/shared/field.html, but with label/help text omitted (those are handled by object_list.html) #}
<div class="field {{ field|fieldtype }} {{ field|widgettype }}">
<div class="field-content">
<div class="input">
{{ field|render_with_errors }}
{# This span only used on rare occasions by certain types of input #}
<span></span>
</div>
{% if field|has_unrendered_errors %}
<p class="error-message">
{% for error in field.errors %}
<span>{{ error|escape }}</span>
{% endfor %}
</p>
{% endif %}
</div>
</div>
{% include "wagtailadmin/shared/field.html" with show_label=False show_help_text=False %}
</li>
</ul>
</fieldset>

Wyświetl plik

@ -1,6 +1,6 @@
{% load wagtailadmin_tags %}
<div class="field {{ field|fieldtype }} {{ field|widgettype }} {{ field_classes }}">
{{ field.label_tag }}
{% if show_label|default_if_none:True %}{{ field.label_tag }}{% endif %}
<div class="field-content">
<div class="input {{ input_classes }} ">
{% block form_field %}
@ -10,7 +10,7 @@
{# This span only used on rare occasions by certain types of input #}
<span></span>
</div>
{% if field.help_text %}
{% if show_help_text|default_if_none:True and field.help_text %}
<p class="help">{{ field.help_text }}</p>
{% endif %}