hintText form option

Add hintText:"some helpful text here" to a field in a form definition object. Form generator will display the text inside the <label> element on a new line with the fa-info-circle icon in a pleasant grey color.
This commit is contained in:
Chris Houseknecht 2014-07-30 18:35:31 -04:00
parent 5c7152dec1
commit 0a44de3346
3 changed files with 12 additions and 0 deletions

View File

@ -238,6 +238,7 @@ angular.module('CredentialFormDefinition', [])
variable: 'key_required',
init: true
},
hintText:"drag and drop an SSH private key file on the field below",
addRequired: false,
editRequired: false,
awDropFile: true,

View File

@ -480,6 +480,16 @@ dd {
padding-right: 10px;
}
.label-hint-text {
font-weight: normal;
color: @grey;
}
.label-hint-text:before {
/* for a line break before hintText */
content: '\A';
white-space: pre;
}
#group_form #group_tabs {
margin-top: 25px;
}

View File

@ -545,6 +545,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator
html += "<span class=\"label-text\">" + field.label + "</span>";
}
html += (field.awPopOver && !field.awPopOverRight) ? Attr(field, 'awPopOver', fld) : "";
html += (field.hintText) ? " <span class=\"label-hint-text\"><i class=\"fa fa-info-circle\"></i> Hint: " + field.hintText + "</span>" : "";
html += "</label>\n";
}
return html;