changeset 604:cee4ce4ee07b

bbb: show actions frame only if there are valid actions for the parser
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Fri, 15 Jun 2012 10:40:05 +0200
parents fa6bb1f3c86c
children c378af5f401b
files data/plugin/parser/bbb_create.py
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/data/plugin/parser/bbb_create.py	Thu Jun 14 13:47:12 2012 +0200
+++ b/data/plugin/parser/bbb_create.py	Fri Jun 15 10:40:05 2012 +0200
@@ -85,6 +85,7 @@
             return
 
         actions = []
+        actions_text = ""
         msg = "\n\n/!\ A Moderator has to start the meeting before someone else can join in!"
         if request.user.valid and request.user.may.read(pagename):
             if meeting_info:
@@ -113,8 +114,12 @@
                 # users with before rights should know to use commands of the menu
                 actions.append(u' . <<Action(edit, text="edit meeting parameter")>>')
                 actions.append(u' . <<Action(DeletePage, text="remove meeting permanently")>>')
-                
 
+            if actions:
+                actions_text = """{{{#!wiki dotted
+%(actions)s
+}}}
+""" % {"actions": '\n'.join(actions)}
 
         raw = u"""
 %(msg)s
@@ -123,13 +128,11 @@
 
 %(meeting_data)s
 
-{{{#!wiki dotted
-%(actions)s
-}}}
 
+%(actions_text)s
 """ % {"msg": msg,
        "meeting_data": meeting_data,
-       "actions": '\n'.join(actions)
+       "actions_text": actions_text,
       }