forms: add class when rendering a widget readonly (#18745)

This commit is contained in:
Frédéric Péters 2017-09-16 15:17:49 +02:00
parent 0d990a433c
commit 1444fa10d1
1 changed files with 1 additions and 0 deletions

View File

@ -1,5 +1,6 @@
{% load qommon %}
<div class="widget {{widget.class_name}} {{widget.extra_css_class}}
{% if widget.readonly %}widget-readonly{% endif %}
{% if widget.get_error %}widget-with-error{% endif %}
{% if widget.get_message %}widget-with-message{% endif %}
{% if widget.is_required %}widget-required{% else %}widget-optional{% endif %}