Merge branch 'improve_ui'

* improve_ui:
  remove default readonly field support
  updated translations
  populate wikihomepage in dddatabuilder.py
  add input fields for wikihomepage and forumsid
  update translations
  hide showall field for non ECMAScript clients
  add checkbox and ECMAScript code to toggle display of all fields
  enable GPG fingerprint entry with disabled ECMAScript
  handle empty email field onBlur event correctly
This commit is contained in:
Jan Dittberner 2010-06-12 00:19:23 +02:00
commit 7d9e26c89b
6 changed files with 147 additions and 49 deletions

View file

@ -9,7 +9,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: ddportfolioservice 0.1\n" "Project-Id-Version: ddportfolioservice 0.1\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2010-06-04 00:25+0200\n" "POT-Creation-Date: 2010-06-12 00:15+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -240,8 +240,8 @@ msgstr ""
msgid "Alioth user name" msgid "Alioth user name"
msgstr "" msgstr ""
#: ddportfolioservice/model/urlbuilder.py:95 #: ddportfolioservice/model/urlbuilder.py:96
#: ddportfolioservice/model/urlbuilder.py:99 #: ddportfolioservice/model/urlbuilder.py:100
#, python-format #, python-format
msgid "Missing input: %s" msgid "Missing input: %s"
msgstr "" msgstr ""
@ -263,11 +263,11 @@ msgid ""
"Developer's or package maintainer's information regarding Debian." "Developer's or package maintainer's information regarding Debian."
msgstr "" msgstr ""
#: ddportfolioservice/templates/base.mako:41 #: ddportfolioservice/templates/base.mako:46
msgid "AGPL - Free Software" msgid "AGPL - Free Software"
msgstr "" msgstr ""
#: ddportfolioservice/templates/base.mako:43 #: ddportfolioservice/templates/base.mako:48
#, python-format #, python-format
msgid "" msgid ""
"The service is available under the terms of the <a " "The service is available under the terms of the <a "
@ -278,7 +278,7 @@ msgid ""
"href=\"http://git.or.cz\">git</a>." "href=\"http://git.or.cz\">git</a>."
msgstr "" msgstr ""
#: ddportfolioservice/templates/base.mako:44 #: ddportfolioservice/templates/base.mako:49
msgid "Copyright © 2009, 2010 Jan Dittberner" msgid "Copyright © 2009, 2010 Jan Dittberner"
msgstr "" msgstr ""
@ -295,39 +295,51 @@ msgstr ""
msgid "Email address:" msgid "Email address:"
msgstr "" msgstr ""
#: ddportfolioservice/templates/showform.mako:50 #: ddportfolioservice/templates/showform.mako:47
msgid "Show all form fields"
msgstr ""
#: ddportfolioservice/templates/showform.mako:54
msgid "Name:" msgid "Name:"
msgstr "" msgstr ""
#: ddportfolioservice/templates/showform.mako:60 #: ddportfolioservice/templates/showform.mako:64
msgid "GPG fingerprint:" msgid "GPG fingerprint:"
msgstr "" msgstr ""
#: ddportfolioservice/templates/showform.mako:75 #: ddportfolioservice/templates/showform.mako:79
msgid "Debian user name:" msgid "Debian user name:"
msgstr "" msgstr ""
#: ddportfolioservice/templates/showform.mako:90 #: ddportfolioservice/templates/showform.mako:94
msgid "Non DD email address:" msgid "Non DD email address:"
msgstr "" msgstr ""
#: ddportfolioservice/templates/showform.mako:105 #: ddportfolioservice/templates/showform.mako:109
msgid "Alioth user name:" msgid "Alioth user name:"
msgstr "" msgstr ""
#: ddportfolioservice/templates/showform.mako:117 #: ddportfolioservice/templates/showform.mako:125
msgid "Wiki user name:"
msgstr ""
#: ddportfolioservice/templates/showform.mako:140
msgid "Forum user id:"
msgstr ""
#: ddportfolioservice/templates/showform.mako:151
msgid "Output format:" msgid "Output format:"
msgstr "" msgstr ""
#: ddportfolioservice/templates/showform.mako:123 #: ddportfolioservice/templates/showform.mako:157
msgid "HTML" msgid "HTML"
msgstr "" msgstr ""
#: ddportfolioservice/templates/showform.mako:125 #: ddportfolioservice/templates/showform.mako:159
msgid "JSON" msgid "JSON"
msgstr "" msgstr ""
#: ddportfolioservice/templates/showform.mako:127 #: ddportfolioservice/templates/showform.mako:161
msgid "Build DD Portfolio URLs" msgid "Build DD Portfolio URLs"
msgstr "" msgstr ""

View file

@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: ddportfolioservice 0.1\n" "Project-Id-Version: ddportfolioservice 0.1\n"
"Report-Msgid-Bugs-To: jan@dittberner.info\n" "Report-Msgid-Bugs-To: jan@dittberner.info\n"
"POT-Creation-Date: 2009-01-20 23:13+0100\n" "POT-Creation-Date: 2009-01-20 23:13+0100\n"
"PO-Revision-Date: 2010-06-04 00:27+0200\n" "PO-Revision-Date: 2010-06-12 00:15+0200\n"
"Last-Translator: Jan Dittberner <jan@dittberner.info>\n" "Last-Translator: Jan Dittberner <jan@dittberner.info>\n"
"Language-Team: de <de@li.org>\n" "Language-Team: de <de@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n"
@ -214,10 +214,11 @@ msgstr "Besitz von debian.net-Domains"
msgid "" msgid ""
"<a href=\"http://wiki.debian.org/qa.debian.org/MIATeam\">MIA</a> database" "<a href=\"http://wiki.debian.org/qa.debian.org/MIATeam\">MIA</a> database"
" information" " information"
msgstr "Informationen in der <a href=\"http://wiki.debian.org/qa.debian.org/MIATeam\">MIA</a>-Datenbank" msgstr ""
"Informationen in der <a "
"href=\"http://wiki.debian.org/qa.debian.org/MIATeam\">MIA</a>-Datenbank"
#: ddportfolioservice/controllers/ddportfolio.py:107 #: ddportfolioservice/controllers/ddportfolio.py:107
#| msgid "Enter your personal information"
msgid "Group membership information" msgid "Group membership information"
msgstr "Information über Gruppenmitgliedschaften" msgstr "Information über Gruppenmitgliedschaften"
@ -253,8 +254,8 @@ msgstr "Nicht-DD E-Mailadresse:"
msgid "Alioth user name" msgid "Alioth user name"
msgstr "Alioth-Benutzername" msgstr "Alioth-Benutzername"
#: ddportfolioservice/model/urlbuilder.py:95 #: ddportfolioservice/model/urlbuilder.py:96
#: ddportfolioservice/model/urlbuilder.py:99 #: ddportfolioservice/model/urlbuilder.py:100
#, python-format #, python-format
msgid "Missing input: %s" msgid "Missing input: %s"
msgstr "Fehlende Eingabe: %s" msgstr "Fehlende Eingabe: %s"
@ -281,11 +282,11 @@ msgstr ""
"Informationen im Bezug auf Debian für Debian-Entwickler und Paketbetreuer" "Informationen im Bezug auf Debian für Debian-Entwickler und Paketbetreuer"
" erzeugt werden." " erzeugt werden."
#: ddportfolioservice/templates/base.mako:41 #: ddportfolioservice/templates/base.mako:46
msgid "AGPL - Free Software" msgid "AGPL - Free Software"
msgstr "AGPL - Freie Software" msgstr "AGPL - Freie Software"
#: ddportfolioservice/templates/base.mako:43 #: ddportfolioservice/templates/base.mako:48
#, python-format #, python-format
msgid "" msgid ""
"The service is available under the terms of the <a " "The service is available under the terms of the <a "
@ -303,7 +304,7 @@ msgstr ""
"<a href=\"http://git.or.cz\">git</a> <a href=\"%s\">den Quelltext " "<a href=\"http://git.or.cz\">git</a> <a href=\"%s\">den Quelltext "
"herunterladen</a>." "herunterladen</a>."
#: ddportfolioservice/templates/base.mako:44 #: ddportfolioservice/templates/base.mako:49
msgid "Copyright © 2009, 2010 Jan Dittberner" msgid "Copyright © 2009, 2010 Jan Dittberner"
msgstr "Copyright © 2009, 2010 Jan Dittberner" msgstr "Copyright © 2009, 2010 Jan Dittberner"
@ -320,39 +321,51 @@ msgstr "Debian-Entwicklerportfolio"
msgid "Email address:" msgid "Email address:"
msgstr "E-Mailadresse:" msgstr "E-Mailadresse:"
#: ddportfolioservice/templates/showform.mako:50 #: ddportfolioservice/templates/showform.mako:47
msgid "Show all form fields"
msgstr "Alle Formularfelder anzeigen"
#: ddportfolioservice/templates/showform.mako:54
msgid "Name:" msgid "Name:"
msgstr "Name:" msgstr "Name:"
#: ddportfolioservice/templates/showform.mako:60 #: ddportfolioservice/templates/showform.mako:64
msgid "GPG fingerprint:" msgid "GPG fingerprint:"
msgstr "GPG-Fingerabdruck:" msgstr "GPG-Fingerabdruck:"
#: ddportfolioservice/templates/showform.mako:75 #: ddportfolioservice/templates/showform.mako:79
msgid "Debian user name:" msgid "Debian user name:"
msgstr "Debian-Benutzername:" msgstr "Debian-Benutzername:"
#: ddportfolioservice/templates/showform.mako:90 #: ddportfolioservice/templates/showform.mako:94
msgid "Non DD email address:" msgid "Non DD email address:"
msgstr "Nicht-DD-E-Mailadresse" msgstr "Nicht-DD-E-Mailadresse"
#: ddportfolioservice/templates/showform.mako:105 #: ddportfolioservice/templates/showform.mako:109
msgid "Alioth user name:" msgid "Alioth user name:"
msgstr "Alioth-Benutzername:" msgstr "Alioth-Benutzername:"
#: ddportfolioservice/templates/showform.mako:117 #: ddportfolioservice/templates/showform.mako:125
msgid "Wiki user name:"
msgstr "Wiki-Benutzername:"
#: ddportfolioservice/templates/showform.mako:140
msgid "Forum user id:"
msgstr "Forumsbenutzernummer:"
#: ddportfolioservice/templates/showform.mako:151
msgid "Output format:" msgid "Output format:"
msgstr "Ausgabeformat:" msgstr "Ausgabeformat:"
#: ddportfolioservice/templates/showform.mako:123 #: ddportfolioservice/templates/showform.mako:157
msgid "HTML" msgid "HTML"
msgstr "HTML" msgstr "HTML"
#: ddportfolioservice/templates/showform.mako:125 #: ddportfolioservice/templates/showform.mako:159
msgid "JSON" msgid "JSON"
msgstr "JSON" msgstr "JSON"
#: ddportfolioservice/templates/showform.mako:127 #: ddportfolioservice/templates/showform.mako:161
msgid "Build DD Portfolio URLs" msgid "Build DD Portfolio URLs"
msgstr "Debian-Entwicklerportfolio-URLs bauen" msgstr "Debian-Entwicklerportfolio-URLs bauen"

View file

@ -22,12 +22,15 @@
# #
"""This file contains code to build a representation of a person based """This file contains code to build a representation of a person based
on keyring data associated to a given email address.""" on keyring data associated to a given email address."""
import logging
from ddportfolioservice.model import keyfinder from ddportfolioservice.model import keyfinder
TYPE_NO = 0 TYPE_NO = 0
TYPE_DM = 1 TYPE_DM = 1
TYPE_DD = 2 TYPE_DD = 2
log = logging.getLogger(__name__)
def build_data(email_address): def build_data(email_address):
"""Build a DD data structure from a given email address.""" """Build a DD data structure from a given email address."""
@ -43,4 +46,9 @@ def build_data(email_address):
fields['type'] = TYPE_DM fields['type'] = TYPE_DM
else: else:
fields['type'] = TYPE_NO fields['type'] = TYPE_NO
if fields['name']:
log.debug('generate wikihomepage from name')
fields['wikihomepage'] = "".join(
[part.capitalize() for part in fields['name'].split()])
return fields return fields

View file

@ -42,6 +42,10 @@ ${h.form(h.url_for(action='urllist'), method='get')}
${h.text('email', ${h.text('email',
h.escape(request.params.get('email', None), True), id='email')}<br /> h.escape(request.params.get('email', None), True), id='email')}<br />
</div> </div>
<div id="showallfield" class="hidden">
${h.checkbox('showall', value='1', checked=False, id='showall')}
<label for="showall">${_(u'Show all form fields')}</label><br />
</div>
<div id="namefield" \ <div id="namefield" \
% if 'name' in c.messages['errors']: % if 'name' in c.messages['errors']:
class="witherrors" \ class="witherrors" \
@ -56,7 +60,7 @@ ${h.form(h.url_for(action='urllist'), method='get')}
${h.text('name', ${h.text('name',
h.escape(request.params.get('name', None)), id='name')}<br /> h.escape(request.params.get('name', None)), id='name')}<br />
</div> </div>
<div id="gpgfpfield" class="hidden"> <div id="gpgfpfield">
<label for="gpgfp">${_('GPG fingerprint:')} <label for="gpgfp">${_('GPG fingerprint:')}
% if 'gpgfp' in c.messages['errors']: % if 'gpgfp' in c.messages['errors']:
<br /> <br />
@ -65,7 +69,7 @@ ${h.form(h.url_for(action='urllist'), method='get')}
</label><br /> </label><br />
${h.text('gpgfp', ${h.text('gpgfp',
h.escape(request.params.get('gpgfp', None)), h.escape(request.params.get('gpgfp', None)),
id='gpgfp', readonly='readonly')}<br /> id='gpgfp')}<br />
</div> </div>
<div id="usernamefield" \ <div id="usernamefield" \
% if 'username' in c.messages['errors']: % if 'username' in c.messages['errors']:
@ -113,6 +117,36 @@ ${h.form(h.url_for(action='urllist'), method='get')}
h.escape(request.params.get('username', None)), h.escape(request.params.get('username', None)),
id='aliothusername')}<br /> id='aliothusername')}<br />
</div> </div>
<div id="wikihomepagefield" \
% if 'wikihomepage' in c.messages['errors']:
class="witherrors"
% endif
>
<label for="wikihomepage">${_('Wiki user name:')}
% if 'wikihomepage' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['wikihomepage'] | h}</span>
% endif
</label><br />
${h.text('wikihomepage',
h.escape(request.params.get('wikihomepage', None)),
id='wikihomepage')}<br />
</div>
<div id="forumsidfield" \
% if 'forumsid' in c.messages['errors']:
class="witherrors"
% endif
>
<label for="forumsid">${_('Forum user id:')}
% if 'forumsid' in c.messages['errors']:
<br />
<span class="errormsg">${c.messages['errors']['forumsid'] | h}</span>
% endif
</label><br />
${h.text('forumsid',
h.escape(request.params.get('forumsid', None)),
id='forumsid')}<br />
</div>
<div id="modefield"> <div id="modefield">
<label for="mode_html">${_('Output format:')} <label for="mode_html">${_('Output format:')}
% if 'mode' in c.messages['errors']: % if 'mode' in c.messages['errors']:

View file

@ -20,6 +20,16 @@ License along with this program. If not, see
<http://www.gnu.org/licenses/>. <http://www.gnu.org/licenses/>.
</%doc> </%doc>
var defaulthiddendivs = new Array(
'#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield',
'#aliothusernamefield', '#wikihomepagefield', '#forumsidfield');
var maskedfielddivs = new Array(
'#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield',
'#aliothusernamefield', '#wikihomepagefield', '#forumsidfield');
var allfielddivs = new Array(
'#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield',
'#aliothusernamefield', '#wikihomepagefield', '#forumsidfield');
function updateFields(data, textStatus) { function updateFields(data, textStatus) {
if (data.type == 2) { // DD if (data.type == 2) { // DD
$('#name').attr('value', data.name).attr('readonly', 'readonly'); $('#name').attr('value', data.name).attr('readonly', 'readonly');
@ -28,12 +38,15 @@ function updateFields(data, textStatus) {
'readonly', 'readonly'); 'readonly', 'readonly');
$('#nonddemail').attr('value', data.email).focus(); $('#nonddemail').attr('value', data.email).focus();
$('#aliothusername').attr('value', data.username); $('#aliothusername').attr('value', data.username);
$('#wikihomepage').attr('value', data.wikihomepage);
$('#namefield').show(); $('#namefield').show();
$('#gpgfpfield').show(); $('#gpgfpfield').show();
$('#usernamefield').show(); $('#usernamefield').show();
$('#nonddemailfield').show(); $('#nonddemailfield').show();
$('#aliothusernamefield').show(); $('#aliothusernamefield').show();
$('#wikihomepagefield').show();
$('#forumsidfield').show();
$('#nonddemail').focus().select(); $('#nonddemail').focus().select();
} else if (data.type == 1) { // DM } else if (data.type == 1) { // DM
@ -41,12 +54,15 @@ function updateFields(data, textStatus) {
$('#gpgfp').attr('value', data.gpgfp); $('#gpgfp').attr('value', data.gpgfp);
$('#username').attr('value', ''); $('#username').attr('value', '');
$('#nonddemail').attr('value', data.email).focus(); $('#nonddemail').attr('value', data.email).focus();
$('#wikihomepage').attr('value', data.wikihomepage);
$('#namefield').show(); $('#namefield').show();
$('#gpgfpfield').show(); $('#gpgfpfield').show();
$('#usernamefield').hide(); $('#usernamefield').hide();
$('#nonddemailfield').hide(); $('#nonddemailfield').hide();
$('#aliothusernamefield').show(); $('#aliothusernamefield').show();
$('#wikihomepagefield').show();
$('#forumsidfield').show();
$('#aliothusername').focus().select(); $('#aliothusername').focus().select();
} else { } else {
@ -60,12 +76,27 @@ function updateFields(data, textStatus) {
$('#nonddemailfield').hide(); $('#nonddemailfield').hide();
$('#namefield').show(); $('#namefield').show();
$('#aliothusernamefield').show(); $('#aliothusernamefield').show();
$('#wikihomepagefield').show();
$('#forumsidfield').show();
$('#name').focus().select(); $('#name').focus().select();
} }
} }
function onChangeShowAll(event) {
if ($('#showall').attr('checked')) {
for (var fielddiv in allfielddivs) {
$(allfielddivs[fielddiv]).show();
}
} else {
for (var fielddiv in maskedfielddivs) {
$(maskedfielddivs[fielddiv]).hide();
}
}
}
function onBlurEmail() { function onBlurEmail() {
if ($.trim($('#email').attr('value')).length > 0) {
$.ajax({ $.ajax({
'url' : '${h.url_for(action='fetchdddata')}', 'url' : '${h.url_for(action='fetchdddata')}',
'data' : {'email' : $('#email').attr('value')}, 'data' : {'email' : $('#email').attr('value')},
@ -76,16 +107,16 @@ function onBlurEmail() {
} }
}); });
} }
}
$(document).ready(function() { $(document).ready(function() {
var fields = new Array( for (var index in defaulthiddendivs) {
'#namefield', '#usernamefield', if (!$(defaulthiddendivs[index]).hasClass('witherrors')) {
'#nonddemailfield', '#aliothusernamefield'); $(defaulthiddendivs[index]).hide();
for (var index in fields) {
if (!$(fields[index]).hasClass('witherrors')) {
$(fields[index]).hide();
} }
} }
$('#showall').attr('checked', false).change(onChangeShowAll);
$('#showallfield').show();
$('#email').blur(onBlurEmail).focus(); $('#email').blur(onBlurEmail).focus();
}); });