User:Chaotic Enby/Unblock wizard.js: Difference between revisions

From Test Wiki
Content deleted Content added
only shows required fields and those that have been filled
No edit summary
Line 516: Line 516:
unblock += '\n{{Help me}}\n' + 'I would like a more detailed explanation for my block.' + '\n~~' + '~~';
unblock += '\n{{Help me}}\n' + 'I would like a more detailed explanation for my block.' + '\n~~' + '~~';
}
}
break;
case "Username":
unblock += '\n{{unblock-un|username=' + ui.itemsInput[0].getValue() + '}} ~~' + '~~\n';
break;
break;
default:
default:
unblock += '\n{{unblock|reason=';
unblockStart = '\n{{unblock|reason=';
for(var [i, label] of questionLabels.entries()){
for(var [i, label] of questionLabels.entries()){
if(required[label] || ui.itemsInput[i].getValue()) {
if(required[label] || ui.itemsInput[i].getValue()) {
if(label == "username") {
unblock += "'''''" + msg(label + '-label') + "'''''" + "{{pb}}" + ui.itemsInput[i].getValue() + "{{pb}}";
unblockStart = '\n{{unblock-un|username=' + ui.itemsInput[i].getValue() + '|reason=';
} else {
unblock += "'''''" + msg(label + '-label') + "'''''" + "{{pb}}" + ui.itemsInput[i].getValue() + "{{pb}}";
}
}
}
}
}
unblock += '}} ~~' + '~~\n';
unblock = unblockStart + unblock + '}} ~~' + '~~\n';
}
}