Author: justi9
Date: 2009-09-01 11:30:49 -0400 (Tue, 01 Sep 2009)
New Revision: 3608
Modified:
mgmt/trunk/cumin/python/cumin/account/widgets.py
mgmt/trunk/cumin/python/cumin/account/widgets.strings
Log:
Restore the appearance of the login form
Modified: mgmt/trunk/cumin/python/cumin/account/widgets.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/account/widgets.py 2009-08-31 21:01:53 UTC (rev 3607)
+++ mgmt/trunk/cumin/python/cumin/account/widgets.py 2009-09-01 15:30:49 UTC (rev 3608)
@@ -141,27 +141,24 @@
def __init__(self, app, name):
super(LoginForm, self).__init__(app, name)
- self.__login_invalid = Attribute(app, "login_invalid")
- self.add_attribute(self.__login_invalid)
+ self.login_invalid = Attribute(app, "login_invalid")
+ self.add_attribute(self.login_invalid)
- self.fields = FormFieldSet(app, "fields")
- self.add_child(self.fields)
+ self.user_name = StringInput(app, "user_name")
+ self.user_name.size = 20
+ self.add_child(self.user_name)
- self.__name = self.Name(app, "name")
- self.fields.add_field(self.__name)
- self.__name.input.size = 20
+ self.password = PasswordInput(app, "password")
+ self.password.size = 20
+ self.add_child(self.password)
- self.__password = self.Password(app, "password")
- self.fields.add_field(self.__password)
- self.__password.input.size = 20
+ self.submit = self.Submit(app, "submit")
+ self.add_child(self.submit)
- self.__submit = self.Submit(app, "submit")
- self.add_child(self.__submit)
-
def do_process(self, session):
- if self.__submit.get(session):
- name = self.__name.get(session)
- password = self.__password.get(session)
+ if self.submit.get(session):
+ name = self.user_name.get(session)
+ password = self.password.get(session)
self.check(session)
@@ -169,7 +166,7 @@
try:
user = Subject.selectBy(name=name)[0]
except IndexError:
- self.__login_invalid.set(session, True)
+ self.login_invalid.set(session, True)
return
crypted = user.password
@@ -184,7 +181,7 @@
self.page.set_redirect_url(session, url)
else:
- self.__login_invalid.set(session, True)
+ self.login_invalid.set(session, True)
def render_operator_link(self, session):
email = self.app.config.operator_email
@@ -195,17 +192,9 @@
return "site operator"
def render_login_invalid(self, session):
- if self.__login_invalid.get(session):
+ if self.login_invalid.get(session):
return self.get_string("login_invalid")
- class Name(StringField):
- def render_title(self, session):
- return "User Name"
-
- class Password(PasswordField):
- def render_title(self, session):
- return "Password"
-
class Submit(FormButton):
def render_content(self, session):
return "Submit"
Modified: mgmt/trunk/cumin/python/cumin/account/widgets.strings
===================================================================
--- mgmt/trunk/cumin/python/cumin/account/widgets.strings 2009-08-31 21:01:53 UTC (rev
3607)
+++ mgmt/trunk/cumin/python/cumin/account/widgets.strings 2009-09-01 15:30:49 UTC (rev
3608)
@@ -24,6 +24,10 @@
margin: 0 0.25em 0 0;
}
+form.LoginForm h2 {
+ font-size: 0.9em;
+}
+
form.LoginForm input {
width: 12em;
}
@@ -51,8 +55,14 @@
{login_invalid}
- {fields}
+ <h2>User Name</h2>
+ <div class="iblock">{user_name}</div>
+
+ <h2>Password</h2>
+
+ <div class="iblock">{password}</div>
+
<div class="buttons">{submit}</div>
<div>{hidden_inputs}</div>
@@ -60,7 +70,6 @@
<script type="text/javascript">
$("{id}").elements[0].focus();
-
</script>
[LoginForm.login_invalid]