mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 04:47:44 -02:30
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:
@@ -238,6 +238,7 @@ angular.module('CredentialFormDefinition', [])
|
|||||||
variable: 'key_required',
|
variable: 'key_required',
|
||||||
init: true
|
init: true
|
||||||
},
|
},
|
||||||
|
hintText:"drag and drop an SSH private key file on the field below",
|
||||||
addRequired: false,
|
addRequired: false,
|
||||||
editRequired: false,
|
editRequired: false,
|
||||||
awDropFile: true,
|
awDropFile: true,
|
||||||
|
|||||||
@@ -480,6 +480,16 @@ dd {
|
|||||||
padding-right: 10px;
|
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 {
|
#group_form #group_tabs {
|
||||||
margin-top: 25px;
|
margin-top: 25px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -545,6 +545,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'Utilities', 'ListGenerator
|
|||||||
html += "<span class=\"label-text\">" + field.label + "</span>";
|
html += "<span class=\"label-text\">" + field.label + "</span>";
|
||||||
}
|
}
|
||||||
html += (field.awPopOver && !field.awPopOverRight) ? Attr(field, 'awPopOver', fld) : "";
|
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";
|
html += "</label>\n";
|
||||||
}
|
}
|
||||||
return html;
|
return html;
|
||||||
|
|||||||
Reference in New Issue
Block a user