view gpp/templates/forums/topic.html @ 87:515d1daec811

Forums: added intra-page links for posts. Added last_page variable for topic. Conditionally display reply form using last_page.
author Brian Neal <bgneal@gmail.com>
date Sat, 12 Sep 2009 18:45:35 +0000
parents f81226b5e87b
children 021492db4aad
line wrap: on
line source
{% extends 'base.html' %}
{% load avatar_tags %}
{% block title %}Forums: {{ topic.name }}{% endblock %}
{% block content %}
<h2>Forums: {{ topic.name }}</h2>

<h3>
   <a href="{% url forums-index %}">SurfGuitar101 Forum Index</a> &raquo;
   <a href="{% url forums-forum_index slug=forum.slug %}">{{ forum.name }}</a> &raquo;
   <a href="{% url forums-topic_index id=topic.id %}">{{ topic.name }}</a>
</h3>

<div class="forum-block">
{% if last_page %}
<a href="#forum-reply-form">New Reply</a> &bull;
{% else %}
<a href="">New Reply</a> &bull;
{% endif %}
<a href="{% url forums-new_topic slug=forum.slug %}">New Topic</a>

<table class="forum-topic">
{% for post in posts %}
<tr class="forum-post">
   <td class="forum-post-author">
      <a name="p{{ post.id }}"></a>
      <a href="{% url bio-view_profile username=post.user.username %}">{{ post.user.username }}</a><br />
      {% avatar post.user %}
   </td>
   <td class="forum-post-body">
      <div class="forum-post-info quiet">
         <a href="{{ post.get_absolute_url }}"><img src="{{ MEDIA_URL }}icons/link.png" alt="Link" title="Link to this post" /></a>
         Posted on {{ post.creation_date|date:"M d, Y H:i" }}
      </div>
      <div class="forum-post-body">
         {{ post.html|safe }}
      </div>
   </td>
</tr>
{% endfor %}
</table>
{% if last_page and user.is_authenticated %}
<a name="forum-reply-form"></a>
<form action="" method="post">
<fieldset>
<legend>Reply to &quot;{{ topic.name }}&quot;</legend>
{{ form.as_p }}
<input type="submit" value="Submit Reply" />
</fieldset>
</form>
{% endif %}
</div>
{% endblock %}