mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-24 00:41:48 -05:00
Credentials add\/edit now works. Ask checkbox is functional.
This commit is contained in:
@@ -99,6 +99,9 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
|
||||
if (this.form.fields[fld].awPassMatch) {
|
||||
this.scope[this.form.name + '_form'][fld].$setValidity('awpassmatch', true);
|
||||
}
|
||||
if (this.form.fields[fld].ask) {
|
||||
this.scope[fld + '_ask'] = false;
|
||||
}
|
||||
}
|
||||
if (this.mode == 'add') {
|
||||
this.applyDefaults();
|
||||
@@ -164,6 +167,7 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
|
||||
html += ">\n";
|
||||
html += "<label class=\"control-label\" for=\"" + fld + '">' + field.label + '</label>' + "\n";
|
||||
html += "<div class=\"controls\">\n";
|
||||
html += (field.clear) ? "<div class=\"input-append\">\n" : "";
|
||||
html += "<input ";
|
||||
html += this.attr(field,'type');
|
||||
html += "ng-model=\"" + fld + '" ';
|
||||
@@ -176,7 +180,19 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
|
||||
html += (field.readonly) ? "readonly " : "";
|
||||
html += (field.awPassMatch) ? "awpassmatch=\"" + field.associated + "\" " : "";
|
||||
html += (field.capitalize) ? "capitalize " : "";
|
||||
html += "/><br />\n";
|
||||
html += (field.ask) ? "ng-disabled=\"" + fld + "_ask\" " : "";
|
||||
html += (field.associated && this.form.fields[field.associated].ask) ? "ng-disabled=\"" + field.associated + "_ask\" " : "";
|
||||
html += "/>";
|
||||
if (field.clear) {
|
||||
html += " \n<button class=\"btn\" ng-click=\"clear('" + fld + "','" + field.associated + "')\" " +
|
||||
"aw-tool-tip=\"Clear " + field.label + "\" id=\"" + fld + "-clear-btn\"><i class=\"icon-undo\"></i></button>\n";
|
||||
html += "</div>\n";
|
||||
}
|
||||
if (field.ask) {
|
||||
html += " \n<label class=\"checkbox inline ask-checkbox\"><input type=\"checkbox\" ng-model=\"" +
|
||||
fld + "_ask\" ng-change=\"ask('" + fld + "','" + field.associated + "')\" /> Ask at runtime?</label>";
|
||||
}
|
||||
html += "<br />\n";
|
||||
// Add error messages
|
||||
if ( (options.mode == 'add' && field.addRequired) || (options.mode == 'edit' && field.editRequired) ) {
|
||||
html += "<span class=\"error\" ng-show=\"" + this.form.name + '_form.' + fld + ".$dirty && " +
|
||||
|
||||
@@ -129,10 +129,11 @@ angular.module('ListGenerator', ['GeneratorHelpers',])
|
||||
if (options.mode != 'lookup') {
|
||||
//actions
|
||||
base = $location.path().replace(/^\//,'').split('/')[0];
|
||||
console.log('base: ' + base);
|
||||
html += "<div class=\"text-right\">\n";
|
||||
for (action in list.actions) {
|
||||
if (list.actions[action].mode == 'all' || list.actions[action].mode == options.mode) {
|
||||
if (list.basePaths && list.basePaths.indexOf(base) > -1) {
|
||||
if ( (list.basePaths == undefined) || (list.basePaths && list.basePaths.indexOf(base) > -1) ) {
|
||||
html += "<button " + this.attr(list.actions[action], 'ngClick') +
|
||||
this.attr(list.actions[action], 'class');
|
||||
html += (list.actions[action].awToolTip) ? this.attr(list.actions[action],'awToolTip') : "";
|
||||
|
||||
Reference in New Issue
Block a user