# HG changeset patch
# User Brian Neal
# Date 1331165522 21600
# Node ID 0a8e6a9ccf538df309145c06ca1868c1a6479c49
# Parent 4b9970ad0edbbd6f315b41ac1ea240bba5e98bd1
Tweaks to the contests application: show the winners on the list page.
Minor presentation changes on the detail template.
diff -r 4b9970ad0edb -r 0a8e6a9ccf53 gpp/contests/models.py
--- a/gpp/contests/models.py Sun Mar 04 14:52:24 2012 -0600
+++ b/gpp/contests/models.py Wed Mar 07 18:12:02 2012 -0600
@@ -87,7 +87,7 @@
"""
return {
'og:title': self.title,
- 'og:type': 'game',
+ 'og:type': 'article',
'og:url': self.get_absolute_url(),
'og:description': self.meta_description,
}
diff -r 4b9970ad0edb -r 0a8e6a9ccf53 gpp/contests/urls.py
--- a/gpp/contests/urls.py Sun Mar 04 14:52:24 2012 -0600
+++ b/gpp/contests/urls.py Wed Mar 07 18:12:02 2012 -0600
@@ -12,7 +12,7 @@
url(r'^$',
ListView.as_view(
context_object_name='contests',
- queryset=Contest.public_objects.all()),
+ queryset=Contest.public_objects.select_related('winner')),
name='contests-index'),
url(r'^enter/$',
diff -r 4b9970ad0edb -r 0a8e6a9ccf53 gpp/templates/contests/contest_detail.html
--- a/gpp/templates/contests/contest_detail.html Sun Mar 04 14:52:24 2012 -0600
+++ b/gpp/templates/contests/contest_detail.html Wed Mar 07 18:12:02 2012 -0600
@@ -33,9 +33,10 @@
{% endif %}
+{% if contest.can_enter %}
Contest Entry
-{% if contest.can_enter and user.is_authenticated %}
+{% if user.is_authenticated %}
{% if user in contest.contestants.all %}
You are currently entered into this contest.
@@ -44,20 +45,17 @@
{% endif %}
{% else %}
- {% if contest.can_enter %}
- Please login
- to enter this contest.
- {% else %}
- Sorry, we are no longer accepting entries to this contest.
- {% endif %}
+ Please login
+ to enter this contest.
{% endif %}
+{% endif %}
Contest Winner
{% if contest.winner %}
The winner of this contest, selected on {{ contest.win_date|date:"l, F d, Y" }}, is
-{% profile_link contest.winner.username %}. Congratulations to {{ contest.winner.username }}!
+{% profile_link contest.winner.username '.' %} Congratulations to {{ contest.winner.username }}!
{% else %}
A contest winner will be determined sometime on or after {{ contest.end_date|date:"l, F d, Y" }}.
Please check back later.
diff -r 4b9970ad0edb -r 0a8e6a9ccf53 gpp/templates/contests/contest_list.html
--- a/gpp/templates/contests/contest_list.html Sun Mar 04 14:52:24 2012 -0600
+++ b/gpp/templates/contests/contest_list.html Wed Mar 07 18:12:02 2012 -0600
@@ -1,4 +1,5 @@
{% extends 'base.html' %}
+{% load bio_tags %}
{% block title %}Contests{% endblock %}
{% block content %}