You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/02/11 20:53:06 UTC

[4/4] git commit: [#284] ticket:257 show unmoderated comments to moderators

Updated Branches:
  refs/heads/master 2ee14f666 -> 73a74278f


[#284] ticket:257 show unmoderated comments to moderators


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/627bcf55
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/627bcf55
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/627bcf55

Branch: refs/heads/master
Commit: 627bcf55d9ddf6c20273acb394774527be30d3c6
Parents: 2ee14f6
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Wed Jan 30 11:41:48 2013 +0400
Committer: Cory Johns <jo...@geek.net>
Committed: Mon Feb 11 19:52:19 2013 +0000

----------------------------------------------------------------------
 Allura/allura/templates/widgets/post_widget.html   |   12 ++++++++++--
 .../forgediscussion/tests/functional/test_forum.py |    9 +++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/627bcf55/Allura/allura/templates/widgets/post_widget.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/post_widget.html b/Allura/allura/templates/widgets/post_widget.html
index 8bb31d1..5160a1d 100644
--- a/Allura/allura/templates/widgets/post_widget.html
+++ b/Allura/allura/templates/widgets/post_widget.html
@@ -22,8 +22,8 @@
        </p>
       </div>
       <div class="grid-14" style="width: {{indent == 0 and 525 or (indent <= 40 and 515-indent*10 or 65)}}px">
-        <div class="display_post">
-          {% if value.status == 'pending' %}
+        <div class="display_post{%if (value.status == 'pending') and h.has_access(value, 'moderate')()%} moderate{%endif%}">
+          {% if (value.status == 'pending') and not h.has_access(value, 'moderate')() %}
             <b>Post awaiting moderation.</b>
           {% else %}
             {% if show_subject %}
@@ -130,3 +130,11 @@
   </div>
   {% endif %}
 </div>
+
+{% block extra_css %}
+<style type="text/css">
+    div.moderate {
+        color:grey;
+    }
+</style>
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/627bcf55/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
index 3c6700e..e2ea957 100644
--- a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
@@ -419,9 +419,14 @@ class TestForum(TestController):
         params[f.find('textarea')['name']] = 'Post content'
         params[f.find('select')['name']] = 'testforum'
         params[f.find('input',{'style':'width: 90%'})['name']] = 'Test Thread'
-        r = self.app.post('/discussion/save_new_topic', params=params,
-                extra_environ=dict(username='*anonymous')).follow()
+        thread = self.app.post('/discussion/save_new_topic', params=params,
+                               extra_environ=dict(username='*anonymous')).follow()
+
+        r = self.app.get(thread.request.url, extra_environ=dict(username='*anonymous'))
         assert 'Post awaiting moderation' in r
+        r = self.app.get(thread.request.url)
+        assert '<div class="display_post moderate">' in r
+        assert 'Post content' in r
         r = self.app.get('/discussion/testforum/moderate/')
         post = FM.ForumPost.query.get(text='Post content')
         link = '<a href="%s">[%s]</a>' % (post.thread.url() + '?limit=25#' + post.slug, post.shorthand_id())