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/04 21:49:48 UTC
git commit: [#2154] ticket:254 added link back to the thread for
discussion moderation
Updated Branches:
refs/heads/master 31b664b50 -> 59a9c268f
[#2154] ticket:254 added link back to the thread for discussion moderation
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/59a9c268
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/59a9c268
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/59a9c268
Branch: refs/heads/master
Commit: 59a9c268f7b6ec06935efc3edcbe365314a57c4b
Parents: 31b664b
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Thu Jan 31 15:30:52 2013 +0400
Committer: Cory Johns <jo...@geek.net>
Committed: Mon Feb 4 20:31:21 2013 +0000
----------------------------------------------------------------------
.../allura/templates/widgets/moderate_posts.html | 10 ++++++++--
.../forgediscussion/tests/functional/test_forum.py | 7 ++++++-
2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59a9c268/Allura/allura/templates/widgets/moderate_posts.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/moderate_posts.html b/Allura/allura/templates/widgets/moderate_posts.html
index 9b02452..6a1c87b 100644
--- a/Allura/allura/templates/widgets/moderate_posts.html
+++ b/Allura/allura/templates/widgets/moderate_posts.html
@@ -18,7 +18,7 @@
<th>Subject</th>
<th>Text</th>
<th>Attachments</th>
- {% if c.app.config.tool_name != 'Discussion' %}<th>Artifact</th>{% endif %}
+ <th>Artifact</th>
</tr>
</thead>
<tbody>
@@ -36,7 +36,13 @@
<td>{{post.thread.subject or '(no subject)'}}</td>
<td>{{h.text.truncate(post.text,200)}}</td>
<td>{{post.attachments|length}}</td>
- {% if c.app.config.tool_name != 'Discussion' %}<td><a href="{{post.thread.artifact.url()}}">[{{post.thread.artifact.shorthand_id()}}]</a></td>{% endif %}
+ <td>
+ {% if c.app.config.tool_name.lower() != 'discussion' %}
+ <a href="{{post.thread.artifact.url()}}">[{{post.thread.artifact.shorthand_id()}}]</a>
+ {%else%}
+ <a href="{{post.url_paginated()}}">[{{post.shorthand_id()}}]</a>
+ {% endif %}
+ </td>
</tr>
{% endfor %}
</tbody>
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/59a9c268/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 62febb0..3c6700e 100644
--- a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
@@ -363,7 +363,8 @@ class TestForum(TestController):
r = self.app.get('/discussion/testforum/moderate')
slug = r.html.find('input', {'name': 'post-0.full_slug'})
if slug is None: slug = '' #FIXME this makes the test keep passing, but clearly something isn't found
- r = self.app.post('/discussion/testforum/moderate/save_moderation', params={
+ r = self.app.post('/discussion/testforum/moderate/save_'
+ 'moderation', params={
'post-0.full_slug': slug,
'post-0.checked': 'on',
'delete': 'Delete Marked'})
@@ -421,6 +422,10 @@ class TestForum(TestController):
r = self.app.post('/discussion/save_new_topic', params=params,
extra_environ=dict(username='*anonymous')).follow()
assert 'Post awaiting moderation' 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())
+ assert link in r, link
@mock.patch('forgediscussion.controllers.root.g.spam_checker')
def test_thread(self, spam_checker):