All form Save and Reset buttons now built with same icon, color, size. Fixed bug on Organization add/edit form that prevented Reset button from working. Fixed Jobs drop-down navigation menu- icon was missing on some pages.

This commit is contained in:
Chris Houseknecht 2013-12-20 23:48:04 +00:00
parent d02d2ebf15
commit 7ef25fec57
14 changed files with 19 additions and 72 deletions

View File

@ -130,7 +130,7 @@ function OrganizationsAdd ($scope, $rootScope, $compile, $location, $log, $route
// Cancel
scope.formReset = function() {
$rootScope.flashMessage = null;
form.reset();
generator.reset();
};
}
@ -223,7 +223,7 @@ function OrganizationsEdit ($scope, $rootScope, $compile, $location, $log, $rout
// Reset the form
scope.formReset = function() {
$rootScope.flashMessage = null;
form.reset();
generator.reset();
for (var fld in master) {
scope[fld] = master[fld];
}

View File

@ -243,16 +243,11 @@ angular.module('CredentialFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -236,17 +236,11 @@ angular.module('GroupFormDefinition', [])
controlClass: 'col-lg-5',
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
'class': "btn btn-default",
icon: 'icon-undo',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -38,17 +38,11 @@ angular.module('HostGroupsFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -80,17 +80,11 @@ angular.module('HostFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -96,17 +96,11 @@ angular.module('InventoryFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -268,17 +268,11 @@ angular.module('JobTemplateFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -46,17 +46,11 @@ angular.module('OrganizationFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -91,17 +91,11 @@ angular.module('PermissionFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -200,17 +200,11 @@ angular.module('ProjectFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -58,17 +58,11 @@ angular.module('TeamFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -102,17 +102,11 @@ angular.module('UserFormDefinition', [])
buttons: { //for now always generates <button> tags
save: {
label: 'Save',
icon: 'icon-ok',
"class": 'btn-success',
ngClick: 'formSave()', //$scope.function to call on click, optional
ngDisabled: true //Disable when $pristine or $invalid, optional
},
reset: {
ngClick: 'formReset()',
label: 'Reset',
icon: 'icon-undo',
'class': 'btn btn-default',
ngDisabled: true //Disabled when $pristine
}
},

View File

@ -1202,10 +1202,22 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies', 'Utilities'])
html += "<div class=\"";
html += (this.form.buttons['controlClass']) ? this.form.buttons['controlClass'] : "col-lg-6";
html += " controls\">\n";
for (var btn in this.form.buttons) {
if (typeof this.form.buttons[btn] == 'object') {
var button = this.form.buttons[btn];
//button
// Set default color and label for Save and Reset
if (btn == 'save') {
button.label = 'Save';
button['class'] = 'btn-success';
}
if (btn == 'reset') {
button.label = 'Reset';
button['class'] = 'btn-default';
}
// Build button HTML
html += "<button type=\"button\" ";
html += "class=\"btn btn-sm";
html += (button['class']) ? " " + button['class'] : "";

View File

@ -148,7 +148,7 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
if (typeof navigation[itm] == 'object' && navigation[itm].active) {
html += "<a href=\"\" class=\"toggle\" ";
html += "data-toggle=\"dropdown\" ";
html += ">" + navigation[itm].label + " <i class=\"icon-chevron-sign-down crumb-icon\"></i></a>";
html += ">" + navigation[itm].label + " <i class=\"fa fa-chevron-circle-down crumb-icon\"></i></a>";
break;
}
}
@ -254,11 +254,11 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
awPopOver: list.selectInstructions,
dataPlacement: 'left',
dataContainer: 'body',
icon: "icon-question-sign",
icon: "fa-question-circle",
'class': 'btn-xs btn-help',
awToolTip: 'Click for help',
dataTitle: 'Help',
iconSize: 'large'
iconSize: 'fa-lg'
};
html += this.button(btn, 'select');
}
@ -409,7 +409,7 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
if (options.mode == 'select' && (options.selectButton == undefined || options.selectButton == true)) {
html += "<div class=\"navigation-buttons\">\n";
html += " <button class=\"btn btn-sm btn-primary pull-right\" aw-tool-tip=\"Complete your selection\" " +
"ng-click=\"finishSelection()\" ng-disabled=\"disableSelectBtn\"><i class=\"icon-check\"></i> Select</button>\n";
"ng-click=\"finishSelection()\" ng-disabled=\"disableSelectBtn\"><i class=\"fa fa-check\"></i> Select</button>\n";
html += "</div>\n";
}