add non DD email field

- add field in form
- use field for NM page URL
- change spelling from E-Mail to Email
This commit is contained in:
Jan Dittberner 2009-01-22 21:45:04 +01:00
parent 67a945dd49
commit 33d1037de5
4 changed files with 16 additions and 4 deletions

View file

@ -67,7 +67,7 @@ alioth.pattern=http://alioth.debian.org/~%(aliothusername)s/
[membership]
urls=nm,db,alioth
nm.pattern=https://nm.debian.org/nmstatus.php?email=%(email)s
nm.pattern=https://nm.debian.org/nmstatus.php?email=%(nonddemail)s
db.pattern=http://db.debian.org/search.cgi?uid=%(username)s&dosearch=Search
alioth.pattern=http://alioth.debian.org/users/%(aliothusername)s/

View file

@ -32,5 +32,6 @@ class DeveloperData(formencode.Schema):
formencode.validators.MinLength(32),
formencode.validators.MaxLength(32))
username = formencode.validators.PlainText()
nonddemail = formencode.validators.Email()
aliothusername = formencode.validators.PlainText()
mode = formencode.validators.OneOf([u'json', u'html'], not_empty=True)

View file

@ -37,10 +37,11 @@ my_config = ConfigParser()
my_config.readfp(pkg_resources.resource_stream(__name__, 'ddportfolio.ini'))
_FIELDNAMES_MAP = {
'email' : N_('E-Mail address'),
'email' : N_('Email address'),
'name' : N_('Name'),
'gpgfp' : N_('GPG fingerprint'),
'username' : N_('Debian user name'),
'nonddemail' : N_('Non DD email address'),
'aliothusername' : N_('Alioth user name'),
}
@ -69,6 +70,6 @@ def build_urls(fields):
False, qfields)])
except InterpolationMissingOptionError, e:
data.append(['error', section, url,
_('Missing field %s') % \
_('Missing input: %s') % \
_(_FIELDNAMES_MAP[e.reference])])
return data

View file

@ -30,7 +30,7 @@ License along with this program. If not, see
<fieldset id="ddportfolio">
<legend>${_('Debian Developer Portfolio')}</legend>
<div id="emailfield">
<label for="email">${_('E-Mail address:')}
<label for="email">${_('Email address:')}
% if 'email' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['email']}</span>
@ -66,6 +66,16 @@ License along with this program. If not, see
${h.text_field('username',
value=request.params.get('username', None))}<br />
</div>
<div id="nonddemailfield">
<label for="nonddemail">${_('Non DD email address:')}
% if 'nonddemail' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['nonddemail']}</span>
% endif
</label><br />
${h.text_field('nonddemail',
value=request.params.get('nonddemail', None))}<br />
</div>
<div id="aliothusernamefield">
<label for="aliothusername">${_('Alioth user name:')}
% if 'aliothusername' in c.messages['errors']: