Added timezones

This commit is contained in:
Raoul Snyman 2010-03-02 16:00:05 +02:00
parent ec49c6da34
commit c11de84241
4 changed files with 39 additions and 15 deletions

View File

@ -27,6 +27,7 @@ from urlparse import urlsplit
from datetime import datetime from datetime import datetime
from formencode.validators import Int from formencode.validators import Int
from pytz import all_timezones
from scribeengine.lib.base import * from scribeengine.lib.base import *
from scribeengine.lib.validation.client import JSString, JSEmail from scribeengine.lib.validation.client import JSString, JSEmail
@ -42,6 +43,7 @@ class AccountController(BaseController):
@authenticate() @authenticate()
def index(self): def index(self):
c.page_title = u'My Account' c.page_title = u'My Account'
c.timezones = all_timezones
return render(u'/account/index.mako') return render(u'/account/index.mako')
def register(self): def register(self):

View File

@ -384,17 +384,6 @@ fieldset {
padding: 0; padding: 0;
} }
fieldset.form-details {
background: url(../images/img05.gif) no-repeat left 1.5em;
padding: 13px 20px 0 20px;
}
fieldset.form-details legend {
font-size: 1.2em;
margin-left: 0;
padding-left: 0;
}
.form-text, .form-text,
.form-password, .form-password,
.form-textarea { .form-textarea {
@ -434,6 +423,24 @@ fieldset.form-details legend {
margin-top: 0.2em; margin-top: 0.2em;
} }
fieldset.form-details {
padding: 10px;
}
fieldset.form-details legend {
background: url(../images/img05.gif) no-repeat left top;
color: #fff;
font-size: 1.5em;
line-height: 50px;
margin: 0 -10px;
padding-left: 1em;
width: 593px;
}
fieldset.form-details .form-text {
width: 573px;
}
#register-now { #register-now {
margin-left: 1em; margin-left: 1em;
} }

View File

@ -2,24 +2,37 @@
<%include file="/flash.mako"/> <%include file="/flash.mako"/>
<div class="post"> <div class="post">
<h2 class="title">My Account</h2> <h2 class="title">My Account</h2>
<p>This is your account page. Update your details by changing them below and clicking the Save button.</p>
<%include file="/errors.mako"/> <%include file="/errors.mako"/>
<form id="account-account" action="${h.url_for(controller=u'account', action=u'index')}" method="post"> <form id="account-account" action="${h.url_for(controller=u'account', action=u'index')}" method="post">
<fieldset class="form-details"> <fieldset class="form-details">
<legend>Required Details</legend> <legend>Required Details</legend>
<div class="form-item"> <div class="form-item">
<label for="account-nick">Nick:</label> <label for="account-nick">Nick:</label>
<input type="text" name="account-nick" id="account-nick" class="form-text" /> <input type="text" name="account-nick" id="account-nick" class="form-text" value="${c.current_user.nick}" />
</div> </div>
<div class="form-item"> <div class="form-item">
<label for="account-email">E-mail:</label> <label for="account-email">E-mail:</label>
<input type="text" name="account-email" id="account-email" class="form-text" /> <input type="text" name="account-email" id="account-email" class="form-text" value="${c.current_user.email}" />
</div> </div>
</fieldset> </fieldset>
<fieldset class="form-details"> <fieldset class="form-details">
<legend>Personal Details</legend> <legend>Personal Details</legend>
<div class="form-item"> <div class="form-item">
<label for="account-first_name">First Name:</label> <label for="account-first_name">First Name:</label>
<input type="text" name="account-first_name" id="account-first_name" class="form-text" /> <input type="text" name="account-first_name" id="account-first_name" class="form-text" value="${c.current_user.first_name}" />
</div>
<div class="form-item">
<label for="account-last_name">Last Name:</label>
<input type="text" name="account-last_name" id="account-last_name" class="form-text" value="${c.current_user.last_name}" />
</div>
<div class="form-item">
<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>
% endfor
</select>
</div> </div>
</fieldset> </fieldset>
<fieldset> <fieldset>

View File

@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
try: try:
from setuptools import setup, find_packages from setuptools import setup, find_packages
except ImportError: except ImportError:
@ -28,7 +29,8 @@ setup(
"Pylons==0.9.7", "Pylons==0.9.7",
"SQLAlchemy>=0.5,<0.6", "SQLAlchemy>=0.5,<0.6",
"TurboMail>=3.0,<3.1", "TurboMail>=3.0,<3.1",
"MonthDelta>=0.9,<0.10" "MonthDelta>=0.9,<0.10",
"pytz"
], ],
setup_requires=["PasteScript>=1.6.3"], setup_requires=["PasteScript>=1.6.3"],
packages=find_packages(exclude=['ez_setup']), packages=find_packages(exclude=['ez_setup']),