Credentials add\/edit now works. Ask checkbox is functional.

This commit is contained in:
chouseknecht
2013-05-10 04:09:28 -04:00
parent fdceb46c12
commit 0ff66f668d
6 changed files with 93 additions and 10 deletions

View File

@@ -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 && " +

View File

@@ -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') : "";