comparison 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
comparison
equal deleted inserted replaced
328:3f9b9fd54b01 329:000c006fee97
5 <td class="forum-post-author"> 5 <td class="forum-post-author">
6 <a name="p{{ post.id }}"></a> 6 <a name="p{{ post.id }}"></a>
7 <a href="{% url 'bio-view_profile' username=post.user.username %}" title="View Profile for {{ post.user.username }}">{{ post.user.username }}</a><br /> 7 <a href="{% url 'bio-view_profile' username=post.user.username %}" title="View Profile for {{ post.user.username }}">{{ post.user.username }}</a><br />
8 <a href="{% url 'bio-view_profile' username=post.user.username %}">{% avatar post.user %}</a> 8 <a href="{% url 'bio-view_profile' username=post.user.username %}">{% avatar post.user %}</a>
9 Joined: {{ post.user.date_joined|date:"M d, Y" }}<br /> 9 Joined: {{ post.user.date_joined|date:"M d, Y" }}<br />
10 Posts: {{ post.user_profile.forum_post_count }}<br /> 10 Posts: {{ post.user.user_profile.forum_post_count }}<br />
11 {% if post.user_profile.location %} 11 {% if post.user.user_profile.location %}
12 Location: {{ post.user_profile.location }}<br /> 12 Location: {{ post.user.user_profile.location }}<br />
13 {% endif %} 13 {% endif %}
14 {% for bo in post.user_profile.badge_ownership %} 14 {% for bo in post.user.user_profile.badge_ownership %}
15 <img src="{{ bo.badge.image.url }}" alt="{{ bo.badge_count_str }}" title="{{ bo.badge_count_str }}" /> 15 <img src="{{ bo.badge.image.url }}" alt="{{ bo.badge_count_str }}" title="{{ bo.badge_count_str }}" />
16 {% endfor %} 16 {% endfor %}
17 {% if user.is_authenticated %} 17 {% if user.is_authenticated %}
18 <p> 18 <p>
19 <a href="{% url 'messages-compose_to' post.user.username %}"> 19 <a href="{% url 'messages-compose_to' post.user.username %}">
20 <img src="{{ STATIC_URL }}icons/note.png" alt="PM" title="Send Private Message to {{ post.user.username }}" /></a> 20 <img src="{{ STATIC_URL }}icons/note.png" alt="PM" title="Send Private Message to {{ post.user.username }}" /></a>
21 {% if not post.user_profile.hide_email %}<a href="mailto:{{ post.user.email }}"> 21 {% if not post.user.user_profile.hide_email %}<a href="mailto:{{ post.user.email }}">
22 <img src="{{ STATIC_URL }}icons/email.png" alt="Email" title="Send Email to {{ post.user.username}}" /></a>{% endif %} 22 <img src="{{ STATIC_URL }}icons/email.png" alt="Email" title="Send Email to {{ post.user.username}}" /></a>{% endif %}
23 </p> 23 </p>
24 {% endif %} 24 {% endif %}
25 </td> 25 </td>
26 <td class="forum-post-body"> 26 <td class="forum-post-body">
27 <div class="forum-post-info quiet{% if post.user_profile.is_stranger %} stranger{% endif %}"> 27 <div class="forum-post-info quiet{% if post.user.user_profile.is_stranger %} stranger{% endif %}">
28 {% if post.unread %}<img src="{{ STATIC_URL }}icons/new.png" alt="New" title="New" />{% endif %} 28 {% if post.unread %}<img src="{{ STATIC_URL }}icons/new.png" alt="New" title="New" />{% endif %}
29 <a href="{{ post.get_absolute_url }}"><img src="{{ STATIC_URL }}icons/link.png" alt="Link" title="Link to this post" /></a> 29 <a href="{{ post.get_absolute_url }}"><img src="{{ STATIC_URL }}icons/link.png" alt="Link" title="Link to this post" /></a>
30 Posted on {% forum_date post.creation_date user %} 30 Posted on {% forum_date post.creation_date user %}
31 {% if can_moderate %}from IP: <a href="{% url 'forums-post_ip_info' post.id %}">{{ post.user_ip }}</a>{% endif %} 31 {% if can_moderate %}from IP: <a href="{% url 'forums-post_ip_info' post.id %}">{{ post.user_ip }}</a>{% endif %}
32 </div> 32 </div>
33 <div class="forum-post-body"> 33 <div class="forum-post-body">
34 {{ post.html|safe }} 34 {{ post.html|safe }}
35 {% if post.user_profile.signature_html %} 35 {% if post.user.user_profile.signature_html %}
36 &mdash;{{ post.user_profile.signature_html|safe }} 36 &mdash;{{ post.user.user_profile.signature_html|safe }}
37 {% endif %} 37 {% endif %}
38 {% if post.has_been_edited %} 38 {% if post.has_been_edited %}
39 <p class="small quiet">Last edited: {{ post.update_date|date:"M d, Y H:i:s" }}</p> 39 <p class="small quiet">Last edited: {{ post.update_date|date:"M d, Y H:i:s" }}</p>
40 {% endif %} 40 {% endif %}
41 </div> 41 </div>
55 title="Flag this post as spam, abuse, or a violation of site rules."> 55 title="Flag this post as spam, abuse, or a violation of site rules.">
56 <img src="{{ STATIC_URL }}icons/flag_red.png" alt="Flag" /></a> 56 <img src="{{ STATIC_URL }}icons/flag_red.png" alt="Flag" /></a>
57 {% if can_moderate %} 57 {% if can_moderate %}
58 <a href="#" class="post-delete" id="dp-{{ post.id }}" 58 <a href="#" class="post-delete" id="dp-{{ post.id }}"
59 title="Delete this post"><img src="{{ STATIC_URL }}icons/cross.png" alt="Delete post" /></a> 59 title="Delete this post"><img src="{{ STATIC_URL }}icons/cross.png" alt="Delete post" /></a>
60 {% if post.user != user and post.user_profile.is_stranger %} 60 {% if post.user != user and post.user.user_profile.is_stranger %}
61 <br /> 61 <br />
62 <span class="quiet">Stranger options:</span> 62 <span class="quiet">Stranger options:</span>
63 <a href="{% url 'forums-stranger' post.id %}" title="This stranger seems legitimate"> 63 <a href="{% url 'forums-stranger' post.id %}" title="This stranger seems legitimate">
64 <img src="{{ STATIC_URL }}icons/tick.png" alt="Acquaintance" /></a> 64 <img src="{{ STATIC_URL }}icons/tick.png" alt="Acquaintance" /></a>
65 <a href="{% url 'forums-spammer' post.id %}" title="This is spam"> 65 <a href="{% url 'forums-spammer' post.id %}" title="This is spam">