diff --git a/pygameweb/comment/views.py b/pygameweb/comment/views.py index 27d1d5e..c1e3783 100644 --- a/pygameweb/comment/views.py +++ b/pygameweb/comment/views.py @@ -66,7 +66,10 @@ def mark_comment(comment_post_id, action): flash('Comment marked spam.') elif action == 'approve': comment.is_approved = True - flash('Comment marked spam.') + flash('Comment approved.') + elif action == 'unapprove': + comment.is_approved = False + flash('Comment unapproved.') else: abort(404) diff --git a/pygameweb/templates/comment/recent.html b/pygameweb/templates/comment/recent.html index b4ad833..dbf9921 100644 --- a/pygameweb/templates/comment/recent.html +++ b/pygameweb/templates/comment/recent.html @@ -29,7 +29,6 @@
approved? | name | message | created_at | @@ -39,13 +38,6 @@
---|---|---|---|
- {% if post.is_approved %} - - {% else %} - - {% endif %} - |
{{ post.author.name }}
{{ post.thread.link_path }}
@@ -54,10 +46,15 @@ Newest Comments | {{ post.created_at }} |
{{ mark_post_button(post, 'spam', 'Spam') }}
- {{ mark_post_button(post, 'delete', 'Delete') }} - - {{ mark_post_button(post, 'approve', 'Approve') }} + + {% if post.is_approved is none %} + {{ mark_post_button(post, 'approve', 'Approve') }} + {% elif post.is_approved %} + {{ mark_post_button(post, 'unapprove', 'UnApprove') }} + {% else %} + {{ mark_post_button(post, 'approve', 'Approve') }} + {% endif %} |