annotate gpp/templates/weblinks/link.html @ 318:c550933ff5b6

Fix a bug where you'd get an error when trying to delete a forum thread (topic does not exist). Apparently when you call topic.delete() the posts would get deleted, but the signal handler for each one would run, and it would try to update the topic's post count or something, but the topic was gone? Reworked the code a bit and explicitly delete the posts first. I also added a sync() call on the parent forum since post counts were not getting adjusted.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 Feb 2011 21:46:52 +0000
parents 88b2b9cb8c1f
children 3c48a555298d
rev   line source
bgneal@310 1 {% load url from future %}
gremmie@1 2 <dt>
bgneal@209 3 <h4><a href="{{ link.url }}">{{ link.title }}</a></h4>
gremmie@1 4 </dt>
gremmie@1 5 <dd>
gremmie@1 6 <p>{{ link.description }}</p>
bgneal@310 7 <form action="{% url 'weblinks-visit' link.id %}" method="post">{% csrf_token %}
gremmie@1 8 <table class="link-stats">
gremmie@1 9 <tr>
bgneal@310 10 <th>Added by:</th><td><a href="{% url 'bio-view_profile' link.user.username %}">{{ link.user.username }}</a></td>
bgneal@310 11 <th>Category:</th><td><a href="{% url 'weblinks-view_links' slug=link.category.slug sort='date' %}">{{ link.category.title }}</a></td>
bgneal@209 12 </tr>
bgneal@209 13 <tr>
bgneal@165 14 <th>Date Added:</th><td>{{ link.date_added|date:"M d, Y" }}</td>
gremmie@1 15 <th>Hits:</th><td>{{ link.hits }}</td>
bgneal@3 16 <td>
bgneal@312 17 <a href="#" class="weblinks-broken" id="link-{{ link.id }}"><img src="{{ STATIC_URL }}icons/link_break.png" alt="Broken Link" title="Report this link as broken" /></a>
bgneal@3 18 </td>
gremmie@1 19 </tr>
bgneal@165 20 <tr><td><input type="submit" value="Visit Site" /></td></tr>
gremmie@1 21 </table>
bgneal@165 22 </form>
gremmie@1 23 <br />
gremmie@1 24 </dd>