Improve rendering of the details form.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-04-06 16:16:37 -04:00
parent d9f0caeee7
commit bbd7704e2e
2 changed files with 28 additions and 3 deletions

View File

@@ -143,7 +143,7 @@
- Removing running workflow instances in document of a specific type if
that document type is removed from the workflow.
- Make error messages persistent and increase the timeout of warning to 10 seconds.
- Improve rendering of the details form.
2.7.3 (2017-09-11)
==================

View File

@@ -55,9 +55,33 @@
{% if not hide_labels %}{{ field.label }}{% if field.field.required and not read_only %} ({% trans 'required' %}){% endif %}{% endif %}
</label>
</div>
{% elif field|widget_type == 'detailselectmultiple' %}
{% elif field|widget_type == 'emailinput' %}
{% if read_only %}
<input class="form-control" readonly="readonly" type="text" value="{{ field|get_choice_value }}">
{{ field.value }}
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
{% elif field|widget_type == 'textinput' %}
{% if read_only %}
{{ field.value }}
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
{% elif field|widget_type == 'textarea' %}
{% if read_only %}
{{ field.value }}
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
{% elif field|widget_type == 'select' %}
{% if read_only %}
{{ field|get_choice_value }}
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
{% elif field|widget_type == 'selectmultiple' %}
{% if read_only %}
{{ field|get_choice_value }}
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
@@ -87,6 +111,7 @@
{% else %}
{% render_field field class+="form-control" %}
{% endif %}
{% if field.help_text %}<p class="help-block">{{ field.help_text|safe }}</p>{% endif %}
</div>
{% endfor %}