# HG changeset patch # User Timothy Clemans # Date 1219662478 25200 # Node ID aa016698c71abcd2cd0217069677d7021b3ef81a # Parent 758e810565059c533029db42a4abaad2b678716f #3937 1 diff -r 758e81056505 -r aa016698c71a sage/server/notebook/template.py --- a/sage/server/notebook/template.py Sat Aug 23 10:43:42 2008 -0700 +++ b/sage/server/notebook/template.py Mon Aug 25 04:07:58 2008 -0700 @@ -31,6 +31,6 @@ # Define variables for each template G = globals() -templates = ['login', 'yes_no', 'registration'] +templates = ['login', 'yes_no', 'registration', 'account_settings'] for name in templates: G[name] = PageTemplate('%s.html'%name) \ No newline at end of file diff -r 758e81056505 -r aa016698c71a sage/server/notebook/twist.py --- a/sage/server/notebook/twist.py Sat Aug 23 10:43:42 2008 -0700 +++ b/sage/server/notebook/twist.py Mon Aug 25 04:07:58 2008 -0700 @@ -884,7 +884,7 @@ elif request.args['Newpass'][0] != request.args['RetypePass'][0]: error = 'The passwords you entered do not match.' - if not error: #webbrowser may auto fill in "old password" even though the user may nto want to change her passwords + if not error: #webbrowser may auto fill in "old password" even though the user may not want to change her password notebook.change_password(self.username, request.args['Newpass'][0]) redirect_to_logout = True if notebook.conf()['email']: @@ -901,102 +901,13 @@ if redirect_to_home: return http.RedirectResponse('/home/%s' % self.username) - s = """ - - - - Account Settings - - - - - -

Account Settings

- -
- -
-

Change Auto-Save Interval

-
-Minutes:
' - if notebook.conf()['email']: - email_section = """ -
-

Change E-mail Address

- -
- - -
Current e-mail:%s
%s
New e-mail:
-
-
-
- """ % ('None' if notebook.user(self.username)._User__email == '' else notebook.user(self.username)._User__email, 'Not confirmed' if not notebook.user(self.username).is_email_confirmed() else 'Confirmed') - else: email_section = '' - s += """ -
-

Change Password

-
- Old password:
- New password:
- Retype new password: -
-
- - %s -
- """ % email_section - s += '' % self.username - s += """ -
-
- - -""" - return http.Response(stream=s) + template_dict = {} + template_dict['autosave_intervals'] = ((i, ' selected') if notebook.user(self.username)['autosave_interval']/60 == i else (i, '') for i in range(1, 10, 2)) + template_dict['email'] = notebook.conf()['email'] + if template_dict['email']: + template_dict['email_address'] = 'None' if not notebook.user(self.username)._User__email else notebook.user(self.username)._User__email + template_dict['email_confirmed'] = 'Not confirmed' if not notebook.user(self.username).is_email_confirmed() else 'Confirmed' + return http.Response(stream=template.account_settings(**template_dict)) ######################################################## # Set output type of a cell