# HG changeset patch # User Brian Neal # Date 1253154027 0 # Node ID 08ddfd835305ddb700a4280e1fc9d0f7e74a67a0 # Parent 59688577a8f14d4bdf1e1e5f26d87be775ebfbfb Forums: Added icons for forum post moderation tools. Still need to add functionality that goes behind these. diff -r 59688577a8f1 -r 08ddfd835305 gpp/forums/templatetags/forum_tags.py --- 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, + } diff -r 59688577a8f1 -r 08ddfd835305 gpp/templates/forums/display_post.html --- 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 %} - {{ post.user.username }}
- {% avatar post.user %} + {{ post.user.username }}
+ {% avatar post.user %} Joined: {{ post.user.date_joined|date:"M d, Y" }}
Posts: {{ post.user.get_profile.forum_post_count }}
Location: {{ post.user.get_profile.location }}
@@ -13,15 +14,19 @@ Link Posted on {{ post.creation_date|date:"M d, Y H:i" }} {% if can_moderate %}from IP: {{ post.user_ip }}{% endif %} -
{{ post.html|safe }}
+ Reply with quote + {% post_edit_button post user can_moderate MEDIA_URL %} + {% if can_moderate %} Flag + Delete post + {% endif %}
diff -r 59688577a8f1 -r 08ddfd835305 gpp/templates/forums/post_edit_button.html --- /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 %} +Edit post +{% endif %} diff -r 59688577a8f1 -r 08ddfd835305 media/css/base.css --- a/media/css/base.css Thu Sep 17 01:44:51 2009 +0000 +++ b/media/css/base.css Thu Sep 17 02:20:27 2009 +0000 @@ -229,6 +229,9 @@ padding-top: 5px; text-align: right; } +div.forum-post-info-tools img { + padding-left: 1em; +} .forums-post-navigation { text-align: right; } diff -r 59688577a8f1 -r 08ddfd835305 media/icons/comment.png Binary file media/icons/comment.png has changed diff -r 59688577a8f1 -r 08ddfd835305 media/icons/page_edit.png Binary file media/icons/page_edit.png has changed