allow ordering of case collections

This commit is contained in:
Ross
2023-07-31 11:39:36 +01:00
parent bce3469676
commit fdc0de29d3
4 changed files with 23 additions and 6 deletions
+8 -3
View File
@@ -9,15 +9,20 @@
Self review: {{collection.self_review}}<br />
</div>
<h3>Cases</h3>
<ul>
<ol id="full-question-list" class="sortable">
{% for case in cases %}
<li><a href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=forloop.counter0 %}">Case {{forloop.counter}}</a>
<li data-question_pk={{case.pk}}><a href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=forloop.counter0 %}">Case {{forloop.counter}}</a>
: {{case.title}}
</li>
{% endfor %}
</ul>
</ol>
<p>This collection will be available to view/take <a href='{{collection.get_take_url}}'>here</a>
{% if can_edit %}
<p><button id='button-edit-order' title='click and drag questions to change order' data-posturl="{% url 'atlas:exam_json_edit' pk=collection.pk %}">Edit case order / Delete cases</button></p>
{% endif %}
{% include 'exam_overview_js.html' %}
{% endblock %}
+1 -1
View File
@@ -1097,7 +1097,7 @@ def collection_detail(request, pk):
return render(
request,
"atlas/collection_detail.html",
{"collection": collection, "cases": cases},
{"collection": collection, "cases": cases, "can_edit": True},
)