Start of account management.
This commit is contained in:
parent
c11de84241
commit
ea875ca816
@ -46,23 +46,39 @@ class AccountController(BaseController):
|
||||
c.timezones = all_timezones
|
||||
return render(u'/account/index.mako')
|
||||
|
||||
@jsvalidate(u'account-account')
|
||||
def index_jsschema(self):
|
||||
return {
|
||||
u'account-nick': JSString(required=True,
|
||||
message=u'You need to type in a nick.'),
|
||||
u'account-email': JSEmail(required=True,
|
||||
message=u'You need to supply a valid e-mail address.')
|
||||
}
|
||||
|
||||
def register(self):
|
||||
c.page_title = u'Register'
|
||||
return render(u'/account/register.mako')
|
||||
|
||||
@jsvalidate(u'register-form')
|
||||
@jsvalidate(u'account-register')
|
||||
def register_jsschema(self):
|
||||
return {
|
||||
u'register-email': JSEmail(required=True, message=u'You haven\'t typed in an e-mail address.'),
|
||||
u'register-password': JSString(required=True, message=u'You haven\'t typed in a password.'),
|
||||
u'register-confirm': JSString(required=True, equalTo=u'#password', message=u'Your passwords don\'t match.')
|
||||
u'register-email': JSEmail(required=True,
|
||||
message=u'You haven\'t typed in an e-mail address.'),
|
||||
u'register-password': JSString(required=True,
|
||||
message=u'You haven\'t typed in a password.'),
|
||||
u'register-confirm': JSString(required=True, equalTo=u'#password',
|
||||
message=u'Your passwords don\'t match.')
|
||||
}
|
||||
|
||||
def register_schema(self):
|
||||
return {
|
||||
'register-email': Email(not_empty=True, messages={'empty': u'You haven\'t typed in an e-mail address.'}),
|
||||
'register-password': UnicodeString(not_empty=True, messages={'empty': u'You haven\'t typed in a password.'}),
|
||||
'confirm-password': [FieldsMatch('register-password', 'register-confirm', messages={'invalid': u'Your passwords don\'t match.'})]
|
||||
'register-email': Email(not_empty=True,
|
||||
messages={'empty': u'You haven\'t typed in an e-mail address.'}),
|
||||
'register-password': UnicodeString(not_empty=True,
|
||||
messages={'empty': u'You haven\'t typed in a password.'}),
|
||||
'confirm-password': [
|
||||
FieldsMatch('register-password', 'register-confirm',
|
||||
messages={'invalid': u'Your passwords don\'t match.'})]
|
||||
}
|
||||
|
||||
def register_POST(self):
|
||||
|
@ -103,6 +103,7 @@ users_table = Table(u'users', metadata,
|
||||
Column(u'first_name', Unicode(100), default=u''),
|
||||
Column(u'last_name', Unicode(100), default=u''),
|
||||
Column(u'homepage', Unicode(200), default=u''),
|
||||
Column(u'timezone', Unicode(200), default=u'UTC'),
|
||||
Column(u'activation_key', Unicode(40), default=None)
|
||||
)
|
||||
|
||||
|
@ -393,6 +393,19 @@ fieldset {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.form-select {
|
||||
color: #fff;
|
||||
background-color: #1f1f1f;
|
||||
font-size: 1.2em;
|
||||
border: 1px solid #454545;
|
||||
padding: 3px 5px;
|
||||
}
|
||||
|
||||
.form-select option {
|
||||
background-color: #1f1f1f;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.form-text {
|
||||
font-size: 1.5em;
|
||||
padding: 4px 6px;
|
||||
|
@ -30,7 +30,7 @@
|
||||
<label for="account-timezone">Timezone:</label>
|
||||
<select name="account-timezone" id="account-timezone" class="form-select">
|
||||
% for timezone in c.timezones:
|
||||
<option>${timezone.zone}</option>
|
||||
<option value="${timezone}">${timezone}</option>
|
||||
% endfor
|
||||
</select>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user