Author: justi9
Date: 2009-04-28 15:57:33 -0400 (Tue, 28 Apr 2009)
New Revision: 3342
Modified:
mgmt/trunk/cumin/python/cumin/usergrid/main.py
mgmt/trunk/cumin/python/cumin/usergrid/submission.py
mgmt/trunk/cumin/resources/app.css
mgmt/trunk/mint/python/mint/model.py
Log:
Initial submit form
Modified: mgmt/trunk/cumin/python/cumin/usergrid/main.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/usergrid/main.py 2009-04-28 19:16:26 UTC (rev 3341)
+++ mgmt/trunk/cumin/python/cumin/usergrid/main.py 2009-04-28 19:57:33 UTC (rev 3342)
@@ -5,6 +5,8 @@
from submission import *
+from wooly.widgets import *
+
strings = StringCatalog(__file__)
class MainPage(CuminPage, ModeSet):
@@ -15,6 +17,9 @@
self.add_mode(self.main)
self.set_default_frame(self.main)
+ self.submission_add = SubmissionForm(app, "submissionadd")
+ self.add_mode(self.submission_add)
+
def render_title(self, session):
return "MRG Grid"
@@ -42,12 +47,19 @@
def __init__(self, app, name):
super(SubmissionFrame, self).__init__(app, name)
- form = SubmissionForm(app, "form")
- self.add_child(form)
+ link = self.SubmissionAddLink(app, "add")
+ self.add_child(link)
def render_title(self, session):
return "Submissions"
+ class SubmissionAddLink(Link):
+ def render_content(self, session):
+ return "Create New Submission"
+
+ def edit_session(self, session):
+ self.page.submission_add.show(session)
+
class TemplateFrame(Widget):
def render_title(self, session):
return "Templates"
Modified: mgmt/trunk/cumin/python/cumin/usergrid/submission.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/usergrid/submission.py 2009-04-28 19:16:26 UTC (rev
3341)
+++ mgmt/trunk/cumin/python/cumin/usergrid/submission.py 2009-04-28 19:57:33 UTC (rev
3342)
@@ -11,12 +11,56 @@
def __init__(self, app, name):
super(SubmissionForm, self).__init__(app, name)
+ self.template = self.TemplateField(app, "template")
+ self.add_field(self.template)
+
self.description = self.DescriptionField(app, "description")
+ self.description.input.size = 50
self.add_field(self.description)
self.command = self.CommandField(app, "command")
+ self.command.input.size = 50
self.add_field(self.command)
+ self.args = self.ArgumentsField(app, "args")
+ self.args.input.size = 50
+ self.add_field(self.args)
+
+ self.inputs = self.InputsField(app, "inputs")
+ self.add_field(self.inputs)
+
+ self.outputs = self.OutputsField(app, "outputs")
+ self.add_field(self.outputs)
+
+ self.options = self.OptionsField(app, "options")
+ self.add_field(self.options)
+
+ def render_title(self, session):
+ return "Create submission to pool 'wingspan'"
+
+ class TemplateField(FormField):
+ def __init__(self, app, name):
+ super(SubmissionForm.TemplateField, self).__init__(app, name)
+
+ param = Parameter(app, "param")
+ self.add_parameter(param)
+
+ self.input = self.TemplateSet(app, "inputs", param)
+ self.add_child(self.input)
+
+ def render_title(self, session):
+ return "Template"
+
+ class TemplateSet(OptionInputSet):
+ def do_get_items(self, session):
+ return ("Standard scene render", "Experimental")
+
+ def render_item_value(self, session, item):
+ return item
+
+ def render_item_content(self, session, item):
+ return item
+
class DescriptionField(StringField):
def render_title(self, session):
return "Description"
@@ -24,3 +68,33 @@
class CommandField(StringField):
def render_title(self, session):
return "Command"
+
+ class ArgumentsField(StringField):
+ def render_title(self, session):
+ return "Arguments"
+
+ class InputsField(MultilineStringField):
+ def render_title(self, session):
+ return "Inputs"
+
+ class OutputsField(MultilineStringField):
+ def render_title(self, session):
+ return "Outputs"
+
+ class OptionsField(CheckboxField):
+ def __init__(self, app, name):
+ super(SubmissionForm.OptionsField, self).__init__(app, name)
+
+ self.add_option(self.SaveAsTemplate(app, "template"))
+ self.add_option(self.UseCloud(app, "cloud"))
+
+ def render_title(self, session):
+ return "Options"
+
+ class SaveAsTemplate(CheckboxFieldOption):
+ def render_title(self, session):
+ return "Save as template"
+
+ class UseCloud(CheckboxFieldOption):
+ def render_title(self, session):
+ return "Use cloud"
Modified: mgmt/trunk/cumin/resources/app.css
===================================================================
--- mgmt/trunk/cumin/resources/app.css 2009-04-28 19:16:26 UTC (rev 3341)
+++ mgmt/trunk/cumin/resources/app.css 2009-04-28 19:57:33 UTC (rev 3342)
@@ -182,6 +182,8 @@
width: 50em;
border: 1px solid #ddd;
background-color: #fff;
+ -moz-border-radius: 0.4em;
+ -webkit-border-radius: 0.4em;
}
form.mform fieldset {
@@ -201,7 +203,9 @@
form.mform .head {
font-weight: bold;
color: white;
- background-color: #685b8a;
+ background-color: #87a;
+ -moz-border-radius: 0.3em 0.3em 0 0;
+ -webkit-border-radius: 0.3em 0.3em 0 0;
/* background-color: #564979; */
}
Modified: mgmt/trunk/mint/python/mint/model.py
===================================================================
--- mgmt/trunk/mint/python/mint/model.py 2009-04-28 19:16:26 UTC (rev 3341)
+++ mgmt/trunk/mint/python/mint/model.py 2009-04-28 19:57:33 UTC (rev 3342)
@@ -371,7 +371,7 @@
def methodResponse(self, broker, seq, response):
# XXX don't do this via the update thread?
- if not self.updateThread.isAlive():
+ if not self.app.updateThread.isAlive():
return
mbroker = self.getMintBrokerByQmfBroker(broker)