From 8d21bc76eb8b779e655847c12d6c503c833764a4 Mon Sep 17 00:00:00 2001 From: Jayaram Pai Date: Sat, 3 May 2014 21:40:11 +0530 Subject: ignored question in filter added back with highlight --- static/website/css/main.css | 4 +++ static/website/templates/filter.html | 61 ++++-------------------------------- website/views.py | 7 ++--- 3 files changed, 12 insertions(+), 60 deletions(-) diff --git a/static/website/css/main.css b/static/website/css/main.css index 4726635..467cea6 100644 --- a/static/website/css/main.css +++ b/static/website/css/main.css @@ -354,3 +354,7 @@ table .title a { .carousel .caption .btn { margin-top: 7px; } +.parent-filter { + background: #FDF5E6; + transition: background 2.5s ease; +} diff --git a/static/website/templates/filter.html b/static/website/templates/filter.html index 7496c0c..1397b26 100644 --- a/static/website/templates/filter.html +++ b/static/website/templates/filter.html @@ -1,57 +1,5 @@ {% extends 'website/templates/base.html' %} {% block content %} -{% if question %} -
FOSS | Tutorial | Min | @@ -86,7 +34,7 @@Answers | User | {% for question in questions %} -
---|
{{ question.category|truncatechars:12 }} @@ -159,6 +107,9 @@ {% block javascript %} {% endblock %} diff --git a/website/views.py b/website/views.py index e349daa..842b12b 100644 --- a/website/views.py +++ b/website/views.py @@ -207,12 +207,9 @@ def filter(request, category=None, tutorial=None, minute_range=None, second_ran questions = Question.objects.filter(category=category).filter(tutorial=tutorial).filter(minute_range=minute_range) if 'qid' in request.GET: - qid = request.GET['qid'] - question = get_object_or_404(Question, id=qid) - context['question'] = question - questions = questions.filter(~Q(id=qid)) + context['qid'] = int(request.GET['qid']) - context['questions'] = questions + context['questions'] = questions.order_by('date_created').reverse() return render(request, 'website/templates/filter.html', context) @login_required -- cgit |