add workflow buttons to comments viewlet (not working yet).

svn path=/plone.app.discussion/trunk/; revision=27408
This commit is contained in:
Timo Stollenwerk 2009-06-13 17:33:48 +00:00
parent 8fb254f73d
commit 22f50532ff
2 changed files with 11 additions and 7 deletions

View File

@ -98,12 +98,11 @@
</form>
<!-- Workflow actions (e.g. 'publish') -->
<!--
<form name=""
action=""
method="get"
style="display: inline;"
tal:repeat="action python:view.get_workflow_actions(reply)"
tal:repeat="action reply_dict/actions"
tal:attributes="action string:${reply/absolute_url}/content_status_modify;
name action/id">
<input type="hidden" name="workflow_action" tal:attributes="value action/id" />
@ -111,7 +110,7 @@
type="submit"
tal:attributes="value action/title"
/>
</form>-->
</form>
<a href="#" class="reply-to-comment-button" title="reply to this comment"
tal:condition="python:userHasReplyPermission and isDiscussionAllowed"

View File

@ -76,12 +76,17 @@ class CommentsViewlet(ViewletBase):
for r in conversation.getThreads():
comment_obj = r['comment']
actions = wf.listActionInfos(object=comment_obj)
return conversation.getThreads()
# list all possible workflow actions
actions = [a for a in wf.listActionInfos(object=comment_obj)
if a['category'] == 'workflow' and a['allowed']]
print actions
r = r.copy()
r['actions'] = actions
yield r
else:
return conversation.getThreads()
yield conversation.getThreads()
else:
return []
yield []
def get_commenter_home_url(self, username):
if username is None: