Author: justi9
Date: 2007-10-15 16:10:11 -0400 (Mon, 15 Oct 2007)
New Revision: 1075
Modified:
mgmt/cumin/python/cumin/server.py
mgmt/cumin/python/cumin/server.strings
Log:
Adds text boxes with values to the property edit form.
Modified: mgmt/cumin/python/cumin/server.py
===================================================================
--- mgmt/cumin/python/cumin/server.py 2007-10-15 19:35:52 UTC (rev 1074)
+++ mgmt/cumin/python/cumin/server.py 2007-10-15 20:10:11 UTC (rev 1075)
@@ -132,16 +132,25 @@
self.profile.set_value("profile")
self.add_child(self.profile)
+ self.pvalue = TextInput(app, "profile_value", self)
+ self.add_child(self.pvalue)
+
self.server = RadioInput(app, "server", self)
self.server.set_parameter(self.source)
self.server.set_value("server")
self.add_child(self.server)
+ self.svalue = TextInput(app, "server_value", self)
+ self.add_child(self.svalue)
+
self.local = RadioInput(app, "local", self)
self.local.set_parameter(self.source)
self.local.set_value("local")
self.add_child(self.local)
+ self.lvalue = TextInput(app, "local_value", self)
+ self.add_child(self.lvalue)
+
def get_object(self, session, object):
return self.param.get(session)
@@ -154,6 +163,21 @@
frame.show_view(branch)
session.set_redirect(branch.marshal())
+ def process_submit(self, session, prop):
+ if self.source.get(session) == "profile":
+ prop.value = self.pvalue.get(session)
+ elif self.source.get(session) == "server":
+ prop.value = self.svalue.get(session)
+ elif self.source.get(session) == "local":
+ prop.value = self.lvalue.get(session)
+ else:
+ raise Exception()
+
+ self.process_cancel(session, prop)
+
+ def process_display(self, session, prop):
+ self.lvalue.set(session, prop.value)
+
def render_title(self, session, prop):
return "Edit Property '%s'" % prop.name
Modified: mgmt/cumin/python/cumin/server.strings
===================================================================
--- mgmt/cumin/python/cumin/server.strings 2007-10-15 19:35:52 UTC (rev 1074)
+++ mgmt/cumin/python/cumin/server.strings 2007-10-15 20:10:11 UTC (rev 1075)
@@ -41,8 +41,13 @@
<td><a class="action"
href="{item_edit_href}">Edit</a></td>
</tr>
+[ServerConfigPropertyForm.css]
+.ServerConfigPropertyForm div.value {
+ margin: 1em 2em;
+}
+
[ServerConfigPropertyForm.html]
-<form id="{id}" class="mform" method="post"
action="?">
+<form id="{id}" class="ServerConfigPropertyForm mform"
method="post" action="?">
<div class="head">
<h1>{title}</h1>
</div>
@@ -50,13 +55,16 @@
<span class="legend">Value</span>
<fieldset>
<div class="field">
- {profile} Use profile value
+ {profile} Use the value from the server profile
+ <div class="value">{profile_value}</div>
</div>
<div class="field">
- {server} Use current server value
+ {server} Use the actual value currently set on the server
+ <div class="value">{server_value}</div>
</div>
<div class="field">
- {local} Set a custom value
+ {local} Set a new value
+ <div class="value">{local_value}</div>
</div>
</fieldset>
Show replies by date