diff gpp/templates/forums/display_post.html @ 329:000c006fee97

Various small changes to reduce database hits.
author Brian Neal <bgneal@gmail.com>
date Wed, 23 Feb 2011 03:40:18 +0000
parents 88b2b9cb8c1f
children cfad8d605cb8
line wrap: on
line diff
--- a/gpp/templates/forums/display_post.html	Tue Feb 22 05:40:29 2011 +0000
+++ b/gpp/templates/forums/display_post.html	Wed Feb 23 03:40:18 2011 +0000
@@ -7,24 +7,24 @@
       <a href="{% url 'bio-view_profile' username=post.user.username %}" title="View Profile for {{ post.user.username }}">{{ post.user.username }}</a><br />
       <a href="{% url 'bio-view_profile' username=post.user.username %}">{% avatar post.user %}</a>
       Joined: {{ post.user.date_joined|date:"M d, Y" }}<br />
-      Posts: {{ post.user_profile.forum_post_count }}<br />
-      {% if post.user_profile.location %}
-      Location: {{ post.user_profile.location }}<br />
+      Posts: {{ post.user.user_profile.forum_post_count }}<br />
+      {% if post.user.user_profile.location %}
+      Location: {{ post.user.user_profile.location }}<br />
       {% endif %}
-      {% for bo in post.user_profile.badge_ownership %}
+      {% for bo in post.user.user_profile.badge_ownership %}
          <img src="{{ bo.badge.image.url }}" alt="{{ bo.badge_count_str }}" title="{{ bo.badge_count_str }}" />
       {% endfor %}
       {% if user.is_authenticated %}
       <p>
       <a href="{% url 'messages-compose_to' post.user.username %}">
       <img src="{{ STATIC_URL }}icons/note.png" alt="PM" title="Send Private Message to {{ post.user.username }}" /></a>
-      {% if not post.user_profile.hide_email %}<a href="mailto:{{ post.user.email }}">
+      {% if not post.user.user_profile.hide_email %}<a href="mailto:{{ post.user.email }}">
          <img src="{{ STATIC_URL }}icons/email.png" alt="Email" title="Send Email to {{ post.user.username}}" /></a>{% endif %}
       </p>
       {% endif %}
    </td>
    <td class="forum-post-body">
-      <div class="forum-post-info quiet{% if post.user_profile.is_stranger %} stranger{% endif %}">
+      <div class="forum-post-info quiet{% if post.user.user_profile.is_stranger %} stranger{% endif %}">
       {% if post.unread %}<img src="{{ STATIC_URL }}icons/new.png" alt="New" title="New" />{% endif %}
       <a href="{{ post.get_absolute_url }}"><img src="{{ STATIC_URL }}icons/link.png" alt="Link" title="Link to this post" /></a>
          Posted on {% forum_date post.creation_date user %}
@@ -32,8 +32,8 @@
       </div>
       <div class="forum-post-body">
          {{ post.html|safe }}
-         {% if post.user_profile.signature_html %}
-            &mdash;{{ post.user_profile.signature_html|safe }}
+         {% if post.user.user_profile.signature_html %}
+            &mdash;{{ post.user.user_profile.signature_html|safe }}
          {% endif %}
          {% if post.has_been_edited %}
          <p class="small quiet">Last edited: {{ post.update_date|date:"M d, Y H:i:s" }}</p>
@@ -57,7 +57,7 @@
       {% if can_moderate %}
       <a href="#" class="post-delete" id="dp-{{ post.id }}"
          title="Delete this post"><img src="{{ STATIC_URL }}icons/cross.png" alt="Delete post" /></a>
-         {% if post.user != user and post.user_profile.is_stranger %}
+         {% if post.user != user and post.user.user_profile.is_stranger %}
          <br />
          <span class="quiet">Stranger options:</span>
          <a href="{% url 'forums-stranger' post.id %}" title="This stranger seems legitimate">