This commit is contained in:
Ross
2025-12-08 11:51:36 +00:00
parent eb06e63f77
commit 9a3a8b932a
3 changed files with 178 additions and 17 deletions
@@ -1,9 +1,16 @@
{% if results %}
<ul class="list-unstyled mb-0" id="exam_search_results_list_{{ field }}">
{% for item in results %}
<li class="py-1 d-flex justify-content-between align-items-center" data-exam-id="{{ item.id }}" data-exam-text="{{ item.text|escapejs }}">
<li class="py-1 d-flex justify-content-between align-items-center"
data-exam-id="{{ item.id }}" data-exam-text="{{ item.text|escapejs }}"
data-exam-archive="{{ item.archive|yesno:'1,0' }}" data-exam-open-access="{{ item.open_access|yesno:'1,0' }}"
data-exam-exam-mode="{{ item.exam_mode|yesno:'1,0' }}" data-exam-candidates-only="{{ item.candidates_only|yesno:'1,0' }}">
<div class="flex-grow-1">
{{ item.text|escape }}
{% if item.archive %}<span class="badge bg-secondary ms-2">Archived</span>{% endif %}
{% if item.open_access %}<span class="badge bg-success ms-2">Open</span>{% endif %}
{% if item.exam_mode %}<span class="badge bg-info text-dark ms-2">Exam mode</span>{% endif %}
{% if item.candidates_only %}<span class="badge bg-warning text-dark ms-2">Candidates only</span>{% endif %}
</div>
<div>
<button type="button" class="btn btn-sm btn-primary exam-add-btn" data-exam-id="{{ item.id }}" data-exam-text="{{ item.text|escapejs }}">Add</button>