Mercurial > public > sg101
comparison gpp/templates/downloads/download.html @ 208:2022c0409296
Fix #76; use POST to get downloads to avoid having side-effects (updating hit count) on GETs.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 05 May 2010 03:12:15 +0000 |
parents | a5f27f25fa52 |
children | daa2916f5b34 |
comparison
equal
deleted
inserted
replaced
207:8bbefaa3e408 | 208:2022c0409296 |
---|---|
1 {% load comment_tags %} | 1 {% load comment_tags %} |
2 {% get_comment_count for download as comment_count %} | 2 {% get_comment_count for download as comment_count %} |
3 <dt> | 3 <dt> |
4 <a href="{% url downloads-download download.id %}">{{ download.title }}</a> | 4 {{ download.title }} |
5 </dt> | 5 </dt> |
6 <dd> | 6 <dd> |
7 {{ download.html|safe }} | 7 {{ download.html|safe }} |
8 <form action="{% url downloads-download download.id %}" method="post">{% csrf_token %} | |
8 <table> | 9 <table> |
9 <tr> | 10 <tr> |
10 <th>Added By:</th> | 11 <th>Added By:</th> |
11 <td><a href="{% url bio-view_profile download.user.username %}">{{ download.user.username }}</a></td> | 12 <td><a href="{% url bio-view_profile download.user.username %}">{{ download.user.username }}</a></td> |
12 <th>Date:</th><td>{{ download.date_added|date:"M d, Y" }}</td> | 13 <th>Date:</th><td>{{ download.date_added|date:"M d, Y" }}</td> |
13 <th>Size:</th><td>{{ download.size }}</td> | 14 <th>Size:</th><td>{{ download.size }}</td> |
14 </tr> | 15 </tr> |
15 <tr> | 16 <tr> |
16 <th>Category:</th><td>{{ download.category.title }}</td> | 17 <th>Category:</th><td>{{ download.category.title }}</td> |
17 <th>Hits:</th><td>{{ download.hits }}</td> | 18 <th>Downloads:</th><td>{{ download.hits }}</td> |
18 </tr> | 19 </tr> |
19 <tr> | 20 <tr> |
20 <th>Rating:</th><td><div class="rating" id="rating-{{ download.id }}">{{ download.average_score|floatformat }}</div></td> | 21 <th>Rating:</th><td><div class="rating" id="rating-{{ download.id }}">{{ download.average_score|floatformat }}</div></td> |
21 <th><img src="{{ MEDIA_URL }}icons/comments.png" alt="Comments" title="Comments" /> | 22 <th><img src="{{ MEDIA_URL }}icons/comments.png" alt="Comments" title="Comments" /> |
22 <a href="{% url downloads-details download.id %}">Comments</a>:</th><td>{{ comment_count }}</td> | 23 <a href="{% url downloads-details download.id %}">Comments</a>:</th><td>{{ comment_count }}</td> |
23 </tr> | 24 </tr> |
25 <tr><td><input type="submit" value="Download Now" /></td></tr> | |
24 </table> | 26 </table> |
27 </form> | |
25 </dd> | 28 </dd> |