[rhmessaging-commits] rhmessaging commits: r3740 - in mgmt/trunk: wooly/python/wooly and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Dec 14 13:31:27 EST 2009


Author: justi9
Date: 2009-12-14 13:31:27 -0500 (Mon, 14 Dec 2009)
New Revision: 3740

Modified:
   mgmt/trunk/cumin/python/cumin/grid/submission.py
   mgmt/trunk/wooly/python/wooly/forms.py
   mgmt/trunk/wooly/python/wooly/forms.strings
Log:
Add help text to the submission add form; enhance field form to show required and help text

Modified: mgmt/trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/grid/submission.py	2009-12-14 16:19:49 UTC (rev 3739)
+++ mgmt/trunk/cumin/python/cumin/grid/submission.py	2009-12-14 18:31:27 UTC (rev 3740)
@@ -130,36 +130,46 @@
 
         self.scheduler = SchedulerSelectField(app, "scheduler", self.pool)
         self.scheduler.required = True
+        self.scheduler.help = "Create submission at this scheduler"
         self.main.add_field(self.scheduler)
 
         self.description = self.DescriptionField(app, "description")
         self.description.input.size = 50
         self.description.required = True
+        self.description.help = "This text will identify the submission"
         self.main.add_field(self.description)
 
         self.command = self.CommandField(app, "command")
         self.command.input.columns = 50
         self.command.required = True
+        self.command.help = "The path to the executable and any arguments"
         self.main.add_field(self.command)
 
         self.requirements = self.RequirementsField(app, "requirements")
         self.requirements.input.columns = 50
+        self.requirements.help = "Attributes controlling where and when " + \
+            "this submission will run"
+        
         self.main.add_field(self.requirements)
 
         self.directory = self.WorkingDirectoryField(app, "directory")
         self.directory.input.size = 50
+        self.directory.help = "Run the process in this directory"
         self.extra.add_field(self.directory)
 
         self.stdin = self.StdinField(app, "stdin")
         self.stdin.input.size = 50
+        self.stdin.help = "Get process input from this file"
         self.extra.add_field(self.stdin)
 
         self.stdout = self.StdoutField(app, "stdout")
         self.stdout.input.size = 50
+        self.stdout.help = "Send process output to this file"
         self.extra.add_field(self.stdout)
 
         self.stderr = self.StderrField(app, "stderr")
         self.stderr.input.size = 50
+        self.stderr.help = "Send error output to this file"
         self.extra.add_field(self.stderr)
 
         #self.options = self.OptionsField(app, "options")

Modified: mgmt/trunk/wooly/python/wooly/forms.py
===================================================================
--- mgmt/trunk/wooly/python/wooly/forms.py	2009-12-14 16:19:49 UTC (rev 3739)
+++ mgmt/trunk/wooly/python/wooly/forms.py	2009-12-14 18:31:27 UTC (rev 3740)
@@ -276,6 +276,7 @@
         self.form = None
 
         self.required = False
+        self.help = None
 
     def init(self):
         super(FormField, self).init()
@@ -289,8 +290,12 @@
     def check(self, session):
         pass
 
+    def render_required(self, session, *args):
+        if self.required:
+            return "<span style=\"color: #c33\">*</span>"
+
     def render_help(self, session, *args):
-        pass
+        return self.help
 
     def render_form_field_class(self, session, *args):
         return self.css_class

Modified: mgmt/trunk/wooly/python/wooly/forms.strings
===================================================================
--- mgmt/trunk/wooly/python/wooly/forms.strings	2009-12-14 16:19:49 UTC (rev 3739)
+++ mgmt/trunk/wooly/python/wooly/forms.strings	2009-12-14 18:31:27 UTC (rev 3740)
@@ -113,7 +113,7 @@
 [FormField.html]
 <tr>
   <th>
-    <div class="title">{title}</div>
+    <div class="title">{title}{required}</div>
     <div class="help">{help}</div>
   </th>
   <td>{inputs}</td>
@@ -128,29 +128,29 @@
 table.FormFieldSet > tbody > tr {
     padding: 2em;
     border-top: 1px dotted #ccc;
+    vertical-align: top;
 }
 
 table.FormFieldSet > tbody > tr > th,
 table.FormFieldSet > tbody > tr > td {
-    padding: 0.5em 0;
+    padding: 0.5em 0.5em 0.5em 0;
     border-top: 1px dotted #ccc;
     margin: 0.25em 0;
 }
 
 table.FormFieldSet > tbody > tr:first-child > th {
     border-top: hidden;
-    width: 25%;
+    width: 33%;
 }
 
 table.FormFieldSet > tbody > tr:first-child > td {
     border-top: hidden;
-    width: 75%;
+    width: 67%;
 }
 
 table.FormFieldSet > tbody > tr > th {
-    width: 25%;
+    width: 33%;
     text-align: left;
-    vertical-align: top;
 }
 
 table.FormFieldSet > tbody > tr > th > div.title {
@@ -158,8 +158,13 @@
     font-size: 0.9em;
 }
 
+table.FormFieldSet > tbody > tr > th > div.help {
+    font-weight: normal;
+    font-size: 0.7em;
+}
+
 table.FormFieldSet > tbody > tr > td {
-    width: 75%;
+    width: 67%;
 }
 
 [FormFieldSet.html]



More information about the rhmessaging-commits mailing list