order editions by most recent to oldest
parent
07073f8620
commit
e164744872
|
@ -10,10 +10,10 @@
|
|||
<div class="content-block">
|
||||
<h1>{{ work.title }}</h1>
|
||||
|
||||
<h2>{{ work.editions.all.count }} Editions:</h2>
|
||||
<h2>{{ editions.all.count }} Editions:</h2>
|
||||
|
||||
<ul class="edition-list">
|
||||
{% for edition in work.editions.all %}
|
||||
{% for edition in editions %}
|
||||
<li class="edition">
|
||||
<div style="float: left; margin-right: 10px;">
|
||||
<img class="cover" src="{{ edition.cover_image_small }}" />
|
||||
|
|
|
@ -32,7 +32,8 @@ def home(request):
|
|||
|
||||
def work(request, work_id):
|
||||
work = get_object_or_404(models.Work, id=work_id)
|
||||
return render(request, 'work.html', {'work': work})
|
||||
editions = work.editions.all().order_by('-publication_date')
|
||||
return render(request, 'work.html', {'work': work, 'editions': editions})
|
||||
|
||||
def supporter(request, supporter_username):
|
||||
supporter = get_object_or_404(User, username=supporter_username)
|
||||
|
|
Loading…
Reference in New Issue