Revised the record form template to display the whole-record errors.

This commit is contained in:
依瑪貓 2020-08-08 11:08:56 +08:00
parent 5833af83a9
commit 1f0ec979ae
2 changed files with 82 additions and 76 deletions

View File

@ -20,7 +20,9 @@ Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2020/8/5
{% endcomment %}
<li id="{{ record_type }}-{{ no }}" class="list-group-item d-flex justify-content-between draggable-record {{ record_type }}-record" data-no="{{ no }}">
<li id="{{ record_type }}-{{ no }}" class="list-group-item {% if should_validate and record.non_field_errors %} list-group-item-danger {% endif %} draggable-record {{ record_type }}-record" data-no="{{ no }}">
<div id="{{ record_type }}-{{ no }}-error">{% if should_validate and record.non_field_errors %}{{ record.non_field_errors.0 }}{% endif %}</div>
<div class="d-flex justify-content-between">
<div class="row">
<div class="col-lg-6">
{% if record.id.value %}
@ -68,4 +70,5 @@ First written: 2020/8/5
</button>
</div>
</div>
</div>
</li>

View File

@ -20,7 +20,9 @@ Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2020/8/5
{% endcomment %}
<li id="{{ record_type }}-{{ no }}" class="list-group-item d-flex draggable-record {{ record_type }}-record" data-no="{{ no }}">
<li id="{{ record_type }}-{{ no }}" class="list-group-item {% if should_validate and record.non_field_errors %} list-group-item-danger {% endif %} draggable-record {{ record_type }}-record" data-no="{{ no }}">
<div id="{{ record_type }}-{{ no }}-error">{% if should_validate and record.non_field_errors %}{{ record.non_field_errors.0 }}{% endif %}</div>
<div class="d-flex">
<div>
<div class="row">
<div class="col-sm-12">
@ -60,4 +62,5 @@ First written: 2020/8/5
</button>
</div>
</div>
</div>
</li>