Add validation error alerts to import preview for question items
This commit is contained in:
@@ -5,6 +5,16 @@
|
|||||||
<div class="card mb-2">
|
<div class="card mb-2">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">Question {{ item.index|add:1 }}</h5>
|
<h5 class="card-title">Question {{ item.index|add:1 }}</h5>
|
||||||
|
{% if item.errors %}
|
||||||
|
<div class="alert alert-danger" role="alert">
|
||||||
|
<strong>Validation errors:</strong>
|
||||||
|
<ul class="mb-0">
|
||||||
|
{% for err in item.errors %}
|
||||||
|
<li>{{ err }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% if item.payload %}
|
{% if item.payload %}
|
||||||
<p><strong>Title:</strong> {{ item.payload.title|default:'(No title)'|safe }}</p>
|
<p><strong>Title:</strong> {{ item.payload.title|default:'(No title)'|safe }}</p>
|
||||||
<p><strong>Stem:</strong> {{ item.payload.stem|default:''|safe }}</p>
|
<p><strong>Stem:</strong> {{ item.payload.stem|default:''|safe }}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user