Fix button formatting and ensure proper user checks in collection reset answers template
This commit is contained in:
@@ -1,10 +1,14 @@
|
|||||||
|
|
||||||
{% for cid_user_exam in cid_users %}
|
{% for cid_user_exam in cid_users %}
|
||||||
|
{% if cid_user_exam.user_user and cid_user_exam.user_user.id %}
|
||||||
<button class="btn btn-sm btn-primary" title="This will clear the user answers and attempts"
|
<button class="btn btn-sm btn-primary" title="This will clear the user answers and attempts"
|
||||||
hx-post="{% url 'atlas:collection_reset_answers_user' collection.pk cid_user_exam.user_user.id %}"
|
hx-post="{% url 'atlas:collection_reset_answers_user' collection.pk cid_user_exam.user_user.id %}"
|
||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
hx-confirm="Are you sure you want to reset answers for the user? This action cannot be undone."
|
hx-confirm="Are you sure you want to reset answers for the user? This action cannot be undone."
|
||||||
>{{ cid_user_exam.user_user }}</button>
|
>{{ cid_user_exam.user_user }}</button>
|
||||||
|
{% else %}
|
||||||
|
<button class="btn btn-sm btn-secondary" disabled>Unknown user</button>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
Reference in New Issue
Block a user