This commit is contained in:
Ross
2022-04-13 22:58:31 +01:00
parent 94350182b6
commit 091bdfefbc
3 changed files with 5 additions and 3 deletions
@@ -34,6 +34,7 @@
<h3>Cases:</h3>
Add cases here. These can only be added once created (they can also be added to cases on creation). Click and drag to change order.
<input type="button" value="Add More Cases" id="add_more_case">
<input type=button id="case-order-button" title="click and drag to update case order" value="Update case order" />
<div id="case_formset" class="sortable">
{% for form in case_formset %}
<ul class="no-error case-formset">
@@ -43,7 +44,6 @@
</ul>
{% endfor %}
</div>
<input type=button id="case-order-button" title="click and drag to update case order">Update case order</button>
{{ case_formset.management_form }}
<input type="submit" class="submit-button" value="Submit" name="submit">
</form>
+1 -1
View File
@@ -10,7 +10,7 @@
</div>
<h3>Cases</h3>
<ul>
{% for case in collection.cases.all %}
{% for case in cases %}
<li><a href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=forloop.counter0 %}">Case {{forloop.counter}}</a>
: {{case.title}}
</li>
+3 -1
View File
@@ -1042,7 +1042,9 @@ class CollectionView(LoginRequiredMixin, SingleTableMixin, FilterView):
def collection_detail(request, pk):
collection = get_object_or_404(CaseCollection, pk=pk)
return render(request, "atlas/collection_detail.html", {"collection": collection})
cases = collection.cases.all().order_by("casedetail__sort_order")
return render(request, "atlas/collection_detail.html", {"collection": collection, "cases": cases})
def collection_take(request, pk):