508 Fixes
Addresses #1021 mostly by adding label tags, generating unique element ids as needed. In the process, moved the label text that gets set in the ___ContentTypeView.js files to the respective handlebar templates; the text was static as far as I could tell. There are additional minor 508 improvements that can be made with the tables (scope tags, header attributes)
This commit is contained in:
@@ -7,7 +7,7 @@ Handlebars.registerHelper('sanitize', function(html) {
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('renderTextParam', function(param) {
|
||||
var result, type = 'text';
|
||||
var result, type = 'text', idAtt = '';
|
||||
var isArray = param.type.toLowerCase() === 'array' || param.allowMultiple;
|
||||
var defaultValue = isArray && Array.isArray(param.default) ? param.default.join('\n') : param.default;
|
||||
|
||||
@@ -16,11 +16,15 @@ Handlebars.registerHelper('renderTextParam', function(param) {
|
||||
}
|
||||
|
||||
if(param.format && param.format === 'password') {
|
||||
type = 'password';
|
||||
type = 'password';
|
||||
}
|
||||
|
||||
if(param.valueId) {
|
||||
idAtt = ' id=\'' + param.valueId + '\'';
|
||||
}
|
||||
|
||||
if(isArray) {
|
||||
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'';
|
||||
result = '<textarea class=\'body-textarea' + (param.required ? ' required' : '') + '\' name=\'' + param.name + '\'' + idAtt;
|
||||
result += ' placeholder=\'Provide multiple values in new lines' + (param.required ? ' (at least one required).' : '.') + '\'>';
|
||||
result += defaultValue + '</textarea>';
|
||||
} else {
|
||||
@@ -29,7 +33,7 @@ Handlebars.registerHelper('renderTextParam', function(param) {
|
||||
parameterClass += ' required';
|
||||
}
|
||||
result = '<input class=\'' + parameterClass + '\' minlength=\'' + (param.required ? 1 : 0) + '\'';
|
||||
result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'';
|
||||
result += ' name=\'' + param.name +'\' placeholder=\'' + (param.required ? '(required)' : '') + '\'' + idAtt;
|
||||
result += ' type=\'' + type + '\' value=\'' + defaultValue + '\'/>';
|
||||
}
|
||||
return new Handlebars.SafeString(result);
|
||||
|
||||
Reference in New Issue
Block a user