Mercurial > public > sg101
changeset 105:08ddfd835305
Forums: Added icons for forum post moderation tools. Still need to add functionality that goes behind these.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 17 Sep 2009 02:20:27 +0000 |
parents | 59688577a8f1 |
children | cb72577785df |
files | gpp/forums/templatetags/forum_tags.py gpp/templates/forums/display_post.html gpp/templates/forums/post_edit_button.html media/css/base.css media/icons/comment.png media/icons/page_edit.png |
diffstat | 6 files changed, 23 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/gpp/forums/templatetags/forum_tags.py Thu Sep 17 01:44:51 2009 +0000 +++ b/gpp/forums/templatetags/forum_tags.py Thu Sep 17 02:20:27 2009 +0000 @@ -17,3 +17,12 @@ @register.inclusion_tag('forums/pagination.html') def forum_page_navigation(page): return {'page': page} + + +@register.inclusion_tag('forums/post_edit_button.html') +def post_edit_button(post, user, can_moderate, media_url): + show_button = post.user.id == user.id or can_moderate + return { + 'show_button': show_button, + 'MEDIA_URL': media_url, + }
--- a/gpp/templates/forums/display_post.html Thu Sep 17 01:44:51 2009 +0000 +++ b/gpp/templates/forums/display_post.html Thu Sep 17 02:20:27 2009 +0000 @@ -1,9 +1,10 @@ {% load avatar_tags %} +{% load forum_tags %} <tr class="forum-post {% cycle 'odd' 'even' %}"> <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 %} + <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.get_profile.forum_post_count }}<br /> Location: {{ post.user.get_profile.location }}<br /> @@ -13,15 +14,19 @@ <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" }} {% if can_moderate %}from IP: {{ post.user_ip }}{% endif %} - </div> <div class="forum-post-body"> {{ post.html|safe }} </div> <div class="forum-post-info-tools"> + <a href=""><img src="{{ MEDIA_URL }}icons/comment.png" alt="Reply with quote" title="Reply with quote" /></a> + {% post_edit_button post user can_moderate MEDIA_URL %} + {% if can_moderate %} <a href="#" class="post-flag" id="fp-{{ post.id }}" title="Flag this post as spam, abuse, or a violation of site rules."> <img src="{{ MEDIA_URL }}icons/flag_red.png" alt="Flag" /></a> + <a href=""><img src="{{ MEDIA_URL }}icons/cross.png" alt="Delete post" title="Delete post" /></a> + {% endif %} </div> </td> </tr>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gpp/templates/forums/post_edit_button.html Thu Sep 17 02:20:27 2009 +0000 @@ -0,0 +1,3 @@ +{% if show_button %} +<a href=""><img src="{{ MEDIA_URL }}icons/page_edit.png" alt="Edit post" title="Edit post" /></a> +{% endif %}