SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit f95e9ae8 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

sort collections in series (detail) by start date

parent 16c1d9f3
No related branches found
No related tags found
No related merge requests found
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<div class="col-lg-6"> <div class="col-lg-6">
<h3 class="highlight" id="collections">Collections in this Series</h3> <h3 class="highlight" id="collections">Collections in this Series</h3>
<ul> <ul>
{% for collection in series.collection_set.all %} {% for collection in collections %}
<li><a href="{{ collection.get_absolute_url }}">{{ collection }}</a></li> <li><a href="{{ collection.get_absolute_url }}">{{ collection }}</a></li>
{% empty %} {% empty %}
<li>No Collection has yet been assembled for this Series</li> <li>No Collection has yet been assembled for this Series</li>
......
...@@ -32,6 +32,15 @@ class SeriesDetailView(DetailView): ...@@ -32,6 +32,15 @@ class SeriesDetailView(DetailView):
model = Series model = Series
def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
# Sort collections in series by event start date
context["collections"] = self.object.collection_set.all().order_by(
"event_start_date"
)
return context
class CollectionDetailView(DetailView): class CollectionDetailView(DetailView):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment