From 1883792c7fd4447e91719311b8fc78f38a40a315 Mon Sep 17 00:00:00 2001 From: Evert Date: Thu, 28 Dec 2017 17:34:58 +0200 Subject: [PATCH] Pinning of submissions --- Show/templates/episode.html | 7 +++++-- Show/views.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Show/templates/episode.html b/Show/templates/episode.html index 431fdcf..b0ff05a 100644 --- a/Show/templates/episode.html +++ b/Show/templates/episode.html @@ -57,8 +57,11 @@

Watch {{episode.name}} From

{% for sbm in submissions %} -
-  {{sbm.url}} +
+ + {% if sbm.pinned %}{% endif %} +  {{sbm.url}} +
{% csrf_token %} diff --git a/Show/views.py b/Show/views.py index 185f1f1..531fef8 100644 --- a/Show/views.py +++ b/Show/views.py @@ -76,7 +76,7 @@ class EpisodeView(TemplateView): ), negatives=Count('votes') - F('positives'), score=F('positives') - F('negatives') - ).order_by('-score') + ).order_by('-pinned', '-score') # Add fields to context ctx['show'] = show