Add username for and link to the Salsa service

Salsa will be gradually replacing the Alioth service.
This commit is contained in:
Paul Wise 2018-01-10 12:13:27 +08:00 committed by Jan Dittberner
parent c13b49b3ce
commit a627c20031
7 changed files with 25 additions and 4 deletions

View file

@ -56,6 +56,9 @@ class DeveloperData(FlaskForm):
]) ])
username = StringField('username', validators=[Optional(), PlainText()]) username = StringField('username', validators=[Optional(), PlainText()])
nonddemail = StringField('nonddemail', validators=[Optional(), Email()]) nonddemail = StringField('nonddemail', validators=[Optional(), Email()])
salsausername = StringField('salsausername', validators=[
Optional(), PlainText()
])
aliothusername = StringField('aliothusername', validators=[ aliothusername = StringField('aliothusername', validators=[
Optional(), PlainText() Optional(), PlainText()
]) ])

View file

@ -78,6 +78,8 @@ db.pattern=https://db.debian.org/search.cgi?uid=%(username)s&dosearch=Search
db.optional=true db.optional=true
webid.pattern=http://webid.debian.net/maintainers/%(username)s webid.pattern=http://webid.debian.net/maintainers/%(username)s
webid.optional=true webid.optional=true
salsa.pattern=https://salsa.debian.org/%(salsausername)s
salsa.optional=true
alioth.pattern=https://alioth.debian.org/users/%(aliothusername)s/ alioth.pattern=https://alioth.debian.org/users/%(aliothusername)s/
alioth.optional=true alioth.optional=true
wiki.pattern=https://wiki.debian.org/%(wikihomepage)s wiki.pattern=https://wiki.debian.org/%(wikihomepage)s

View file

@ -45,6 +45,7 @@ _FIELDNAMES_MAP = {
'gpgfp': N_('GPG fingerprint'), 'gpgfp': N_('GPG fingerprint'),
'username': N_('Debian user name'), 'username': N_('Debian user name'),
'nonddemail': N_('Non Debian email address'), 'nonddemail': N_('Non Debian email address'),
'salsausername': N_('Salsa user name'),
'aliothusername': N_('Alioth user name'), 'aliothusername': N_('Alioth user name'),
} }

View file

@ -67,6 +67,13 @@ with this program. If not, see <https://www.gnu.org/licenses/>.
</label><br /> </label><br />
{{ form.nonddemail }} {{ form.nonddemail }}
</div> </div>
<div id="salsausernamefield"{% if form.salsausername.errors %} class="witherrors"{% endif %}>
<label for="salsausername">{{ _('Salsa user name:') }}{% if form.salsausername.errors %}<br />
<span class="errormsg">{{ form.salsausername.errors|join(', ') }}</span>
{% endif %}
</label><br />
{{ form.salsausername }}
</div>
<div id="aliothusernamefield"{% if form.aliothusername.errors %} class="witherrors"{% endif %}> <div id="aliothusernamefield"{% if form.aliothusername.errors %} class="witherrors"{% endif %}>
<label for="aliothusername">{{ _('Alioth user name:') }}{% if form.aliothusername.errors %}<br /> <label for="aliothusername">{{ _('Alioth user name:') }}{% if form.aliothusername.errors %}<br />
<span class="errormsg">{{ form.aliothusername.errors|join(', ') }}</span> <span class="errormsg">{{ form.aliothusername.errors|join(', ') }}</span>

View file

@ -19,13 +19,13 @@ with this program. If not, see <https://www.gnu.org/licenses/>.
#} #}
var defaulthiddendivs = new Array( var defaulthiddendivs = new Array(
'#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield', '#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield',
'#aliothusernamefield', '#wikihomepagefield', '#forumsidfield'); '#salsausernamefield', '#aliothusernamefield', '#wikihomepagefield', '#forumsidfield');
var maskedfielddivs = new Array( var maskedfielddivs = new Array(
'#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield', '#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield',
'#aliothusernamefield', '#wikihomepagefield', '#forumsidfield'); '#salsausernamefield', '#aliothusernamefield', '#wikihomepagefield', '#forumsidfield');
var allfielddivs = new Array( var allfielddivs = new Array(
'#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield', '#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield',
'#aliothusernamefield', '#wikihomepagefield', '#forumsidfield'); '#salsausernamefield', '#aliothusernamefield', '#wikihomepagefield', '#forumsidfield');
function updateFields(data, textStatus) { function updateFields(data, textStatus) {
if (data.type == 2) { // DD if (data.type == 2) { // DD
@ -34,6 +34,7 @@ function updateFields(data, textStatus) {
$('#username').prop('value', data.username).prop( $('#username').prop('value', data.username).prop(
'readonly', 'readonly'); 'readonly', 'readonly');
$('#nonddemail').prop('value', data.email).focus(); $('#nonddemail').prop('value', data.email).focus();
$('#salsausername').prop('value', data.username);
$('#aliothusername').prop('value', data.username); $('#aliothusername').prop('value', data.username);
$('#wikihomepage').prop('value', data.wikihomepage); $('#wikihomepage').prop('value', data.wikihomepage);
@ -41,6 +42,7 @@ function updateFields(data, textStatus) {
$('#gpgfpfield').show(); $('#gpgfpfield').show();
$('#usernamefield').show(); $('#usernamefield').show();
$('#nonddemailfield').show(); $('#nonddemailfield').show();
$('#salsausernamefield').show();
$('#aliothusernamefield').show(); $('#aliothusernamefield').show();
$('#wikihomepagefield').show(); $('#wikihomepagefield').show();
$('#forumsidfield').show(); $('#forumsidfield').show();
@ -57,11 +59,12 @@ function updateFields(data, textStatus) {
$('#gpgfpfield').show(); $('#gpgfpfield').show();
$('#usernamefield').hide(); $('#usernamefield').hide();
$('#nonddemailfield').hide(); $('#nonddemailfield').hide();
$('#salsausernamefield').show();
$('#aliothusernamefield').show(); $('#aliothusernamefield').show();
$('#wikihomepagefield').show(); $('#wikihomepagefield').show();
$('#forumsidfield').show(); $('#forumsidfield').show();
$('#aliothusername').focus().select(); $('#salsausername').focus().select();
} else { } else {
$('#nonddemail').prop('value', data.email); $('#nonddemail').prop('value', data.email);
$('#name').removeAttr('readonly'); $('#name').removeAttr('readonly');
@ -72,6 +75,7 @@ function updateFields(data, textStatus) {
$('#gpgfpfield').hide(); $('#gpgfpfield').hide();
$('#nonddemailfield').hide(); $('#nonddemailfield').hide();
$('#namefield').show(); $('#namefield').show();
$('#salsausernamefield').show();
$('#aliothusernamefield').show(); $('#aliothusernamefield').show();
$('#wikihomepagefield').show(); $('#wikihomepagefield').show();
$('#forumsidfield').show(); $('#forumsidfield').show();

View file

@ -89,6 +89,7 @@ developer name on all bug logs)'),
'dbfinger': N_('DB information via finger'), 'dbfinger': N_('DB information via finger'),
'db': N_('DB information via HTTP'), 'db': N_('DB information via HTTP'),
'webid': N_('FOAF profile'), 'webid': N_('FOAF profile'),
'salsa': N_('Salsa'),
'alioth': N_('Alioth'), 'alioth': N_('Alioth'),
'wiki': N_('Wiki'), 'wiki': N_('Wiki'),
'forum': N_('Forum'), 'forum': N_('Forum'),
@ -126,6 +127,7 @@ DM_TUPLES = (('name', 'name'),
#: list of field name tuples for Debian Developers #: list of field name tuples for Debian Developers
DD_TUPLES = (('username', 'username'), DD_TUPLES = (('username', 'username'),
('salsausername', 'username'),
('aliothusername', 'username')) ('aliothusername', 'username'))

View file

@ -132,6 +132,7 @@ that are filled at runtime:
================== ======================================== ================== ========================================
Placeholder Replacement Placeholder Replacement
================== ======================================== ================== ========================================
%(salsausername)s user name on `salsa.debian.org`_
%(aliothusername)s user name on `alioth.debian.org`_ %(aliothusername)s user name on `alioth.debian.org`_
%(email)s email address (URL encoded) %(email)s email address (URL encoded)
%(emailnoq)s email address %(emailnoq)s email address
@ -143,6 +144,7 @@ Placeholder Replacement
%(wikihomepage)s full name in camel case (i.e. JohnSmith) %(wikihomepage)s full name in camel case (i.e. JohnSmith)
================== ======================================== ================== ========================================
.. _salsa.debian.org: https://salsa.debian.org/
.. _alioth.debian.org: https://alioth.debian.org/ .. _alioth.debian.org: https://alioth.debian.org/
The replacement of placeholders is performed in the The replacement of placeholders is performed in the