add input fields for wikihomepage and forumsid
This commit is contained in:
parent
fe0291d59e
commit
4450a7ccfd
2 changed files with 46 additions and 13 deletions
|
@ -117,6 +117,36 @@ ${h.form(h.url_for(action='urllist'), method='get')}
|
|||
h.escape(request.params.get('username', None)),
|
||||
id='aliothusername')}<br />
|
||||
</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">
|
||||
<label for="mode_html">${_('Output format:')}
|
||||
% if 'mode' in c.messages['errors']:
|
||||
|
|
|
@ -21,15 +21,16 @@ License along with this program. If not, see
|
|||
</%doc>
|
||||
|
||||
var defaulthiddendivs = new Array(
|
||||
'#gpgfpfield');
|
||||
'#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield',
|
||||
'#aliothusernamefield', '#wikihomepagefield', '#forumsidfield');
|
||||
var defaultreadonlydivs = new Array(
|
||||
'#gpgfpfield');
|
||||
var maskedfielddivs = new Array(
|
||||
'#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield',
|
||||
'#aliothusernamefield');
|
||||
'#aliothusernamefield', '#wikihomepagefield', '#forumsidfield');
|
||||
var allfielddivs = new Array(
|
||||
'#namefield', '#gpgfpfield', '#usernamefield', '#nonddemailfield',
|
||||
'#aliothusernamefield');
|
||||
'#aliothusernamefield', '#wikihomepagefield', '#forumsidfield');
|
||||
|
||||
function updateFields(data, textStatus) {
|
||||
if (data.type == 2) { // DD
|
||||
|
@ -39,12 +40,15 @@ function updateFields(data, textStatus) {
|
|||
'readonly', 'readonly');
|
||||
$('#nonddemail').attr('value', data.email).focus();
|
||||
$('#aliothusername').attr('value', data.username);
|
||||
$('#wikihomepage').attr('value', data.wikihomepage);
|
||||
|
||||
$('#namefield').show();
|
||||
$('#gpgfpfield').show();
|
||||
$('#usernamefield').show();
|
||||
$('#nonddemailfield').show();
|
||||
$('#aliothusernamefield').show();
|
||||
$('#wikihomepagefield').show();
|
||||
$('#forumsidfield').show();
|
||||
|
||||
$('#nonddemail').focus().select();
|
||||
} else if (data.type == 1) { // DM
|
||||
|
@ -52,12 +56,15 @@ function updateFields(data, textStatus) {
|
|||
$('#gpgfp').attr('value', data.gpgfp);
|
||||
$('#username').attr('value', '');
|
||||
$('#nonddemail').attr('value', data.email).focus();
|
||||
$('#wikihomepage').attr('value', data.wikihomepage);
|
||||
|
||||
$('#namefield').show();
|
||||
$('#gpgfpfield').show();
|
||||
$('#usernamefield').hide();
|
||||
$('#nonddemailfield').hide();
|
||||
$('#aliothusernamefield').show();
|
||||
$('#wikihomepagefield').show();
|
||||
$('#forumsidfield').show();
|
||||
|
||||
$('#aliothusername').focus().select();
|
||||
} else {
|
||||
|
@ -71,6 +78,8 @@ function updateFields(data, textStatus) {
|
|||
$('#nonddemailfield').hide();
|
||||
$('#namefield').show();
|
||||
$('#aliothusernamefield').show();
|
||||
$('#wikihomepagefield').show();
|
||||
$('#forumsidfield').show();
|
||||
|
||||
$('#name').focus().select();
|
||||
}
|
||||
|
@ -103,19 +112,13 @@ function onBlurEmail() {
|
|||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var fields = new Array(
|
||||
'#namefield', '#usernamefield',
|
||||
'#nonddemailfield', '#aliothusernamefield');
|
||||
for (var index in fields) {
|
||||
if (!$(fields[index]).hasClass('witherrors')) {
|
||||
$(fields[index]).hide();
|
||||
}
|
||||
}
|
||||
for (var index in defaulthiddendivs) {
|
||||
if (!$(defaulthiddendivs[index]).hasClass('witherrors')) {
|
||||
$(defaulthiddendivs[index]).hide();
|
||||
}
|
||||
}
|
||||
for (var index in defaultreadonlydivs) {
|
||||
$(defaultreadonlydivs[index]).hide();
|
||||
$(defaultreadonlydivs[index]).attr('readonly', 'readonly');
|
||||
}
|
||||
|
||||
$('#showall').attr('checked', false).change(onChangeShowAll);
|
||||
|
|
Loading…
Reference in a new issue