diff --git a/src/scriptform.py b/src/scriptform.py index 1e39289..b01c400 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -89,6 +89,50 @@ html_footer = ''' ''' +html_list = ''' +{header} +
+ {form_list} +
+{footer} +''' + +html_form = ''' +{header} +
+

{title}

+

{description}

+
+ + +
+
+{footer} +''' + +html_submit_response = ''' +{header} +
+

{title}

+

Result

+
{msg}
+ +
+{footer} +''' + class FormDefinition: """ @@ -323,15 +367,11 @@ class ScriptFormWebApp(WebAppHandler): name=form_name) ) - output = ''' - {header} -
- {form_list} -
- {footer} - '''.format(header=html_header.format(title=self.scriptform.title), - footer=html_footer, - form_list=''.join(h_form_list)) + output = html_list.format( + header=html_header.format(title=self.scriptform.title), + footer=html_footer, + form_list=''.join(h_form_list) + ) self.send_response(200) self.send_header('Content-type', 'text/html') #self.send_header('Expires', 'Mon, 30 Mar 2015 16:00:00 GMT') @@ -409,21 +449,7 @@ class ScriptFormWebApp(WebAppHandler): self.username not in form_def.allowed_users: raise Exception("Not authorized") - output = ''' - {header} -
-

{title}

-

{description}

-
- - -
-
- {footer} - '''.format( + output = html_form.format( header=html_header.format(title=self.scriptform.title), footer=html_footer, title=form_def.title,