view sg101/templates/contests/contest_detail.html @ 682:25a408bb71a3

For Django 1.5.2; remove 'load url from future' tag.
author Brian Neal <bgneal@gmail.com>
date Mon, 19 Aug 2013 21:04:27 -0500
parents 69e8aa135c2e
children 5977b43499f7
line wrap: on
line source
{% extends 'base.html' %}
{% load bio_tags %}
{% load core_tags %}
{% block custom_meta %}
{% open_graph_meta_tags contest %}
{% endblock %}
{% block title %}Contests: {{ contest.title }}{% endblock %}
{% block custom_js %}
<script type="text/javascript">
   var contest_id = {{ contest.id }};
</script>
<script type="text/javascript" src="{{ STATIC_URL }}js/contests/contests.js"></script>
{% endblock %}

{% block content %}
<h2><a href="{% url 'contests-index' %}">Contests</a></h2>
<h3><a href="{% url 'contests-contest' slug=contest.slug %}">{{ contest.title }}</a></h3>
<div>
   {{ contest.description|safe }}
   <br clear="all" />
</div>

<h4>Contest Dates</h4>
<p>
{% if contest.is_active %}
This contest began on {{ contest.creation_date|date:"F d, Y" }} and ends on
{{ contest.end_date|date:"F d, Y" }}.
{% else %}
This contest ran from {{ contest.creation_date|date:"F d, Y" }} to
{{ contest.end_date|date:"F d, Y" }}.
{% endif %}
</p>

{% if contest.can_enter %}
<h4>Contest Entry</h4>
<p id="contest-entry">
{% if user.is_authenticated %}
   {% if user in contest.contestants.all %}
      You are currently entered into this contest.<br />
      <button id="contest-button">Withdraw from this contest</button>
   {% else %}
      You are not participating in this contest.<br />
      <button id="contest-button">Please enter me into this contest!</button>
   {% endif %}
{% else %}
   Please <a href="{% url 'accounts-login' %}?next={{ contest.get_absolute_url }}">login</a>
   to enter this contest.
{% endif %}
</p>
{% endif %}

<h4>Contest Winner</h4>
<p>
{% 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 <strong>{{ contest.winner.username }}</strong>!
{% else %}
A contest winner will be determined sometime on or after {{ contest.end_date|date:"l, F d, Y" }}.
Please check back later.
{% endif %}
</p>
<hr />
{% social_sharing contest.title contest.get_absolute_url %}
{% endblock %}