Applied same navigation/drop-down changes to jobs that we applied to inventory.

This commit is contained in:
chouseknecht
2013-09-20 16:42:58 -04:00
parent c47168dce2
commit 93e53034c1
7 changed files with 64 additions and 24 deletions

View File

@@ -275,7 +275,8 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
Rest.get({ params: {id: id} }) Rest.get({ params: {id: id} })
.success( function(data, status, headers, config) { .success( function(data, status, headers, config) {
LoadBreadCrumbs({ path: '/job_templates/' + id, title: data.id + ' - ' + data.summary_fields.job_template.name }); //LoadBreadCrumbs({ path: '/jobs/' + id, title: data.id + ' - ' + data.summary_fields.job_template.name });
LoadBreadCrumbs();
for (var fld in form.fields) { for (var fld in form.fields) {
if (fld != 'variables' && data[fld] !== null && data[fld] !== undefined) { if (fld != 'variables' && data[fld] !== null && data[fld] !== undefined) {

View File

@@ -16,8 +16,14 @@ angular.module('JobFormDefinition', [])
well: true, well: true,
twoColumns: true, twoColumns: true,
navigationLinks: { navigationLinks: {
details: {
href: "/#/jobs/{{ job_id }}",
label: 'Details',
icon: 'icon-zoom-in',
active: true,
ngShow: "job_id !== null"
},
hosts: { hosts: {
href: "/#/jobs/{{ job_id }}/job_host_summaries", href: "/#/jobs/{{ job_id }}/job_host_summaries",
label: 'Hosts', label: 'Hosts',
@@ -30,7 +36,6 @@ angular.module('JobFormDefinition', [])
} }
}, },
fields: { fields: {
name: { name: {
label: 'Job Template', label: 'Job Template',

View File

@@ -22,12 +22,19 @@ angular.module('JobEventsListDefinition', [])
details: { details: {
href: "/#/jobs/{{ job_id }}", href: "/#/jobs/{{ job_id }}",
label: 'Details', label: 'Details',
icon: 'icon-zoom-in' icon: 'icon-zoom-in',
ngShow: "job_id !== null"
}, },
summary: { hosts: {
href: "/#/jobs/{{ job_id }}/job_host_summaries", href: "/#/jobs/{{ job_id }}/job_host_summaries",
label: 'Hosts', label: 'Hosts',
icon: 'icon-laptop' icon: 'icon-laptop'
},
events: {
href: "/#/jobs/{{ job_id }}/job_events",
label: 'Events',
active: true,
icon: 'icon-list-ul'
} }
}, },

View File

@@ -23,11 +23,16 @@ angular.module('JobHostDefinition', [])
icon: 'icon-zoom-in', icon: 'icon-zoom-in',
ngShow: "job_id !== null" ngShow: "job_id !== null"
}, },
hosts: {
href: "/#/jobs/{{ job_id }}/job_host_summaries",
label: 'Hosts',
active: true,
icon: 'icon-laptop'
},
events: { events: {
href: "/#/jobs/{{ job_id }}/job_events", href: "/#/jobs/{{ job_id }}/job_events",
label: 'Events', label: 'Events',
icon: 'icon-list-ul', icon: 'icon-list-ul'
ngShow: "job_id !== null"
} }
}, },

View File

@@ -95,7 +95,7 @@ angular.module('JobsListDefinition', [])
type: 'DropDown', type: 'DropDown',
label: 'View', label: 'View',
icon: 'icon-zoom-in', icon: 'icon-zoom-in',
'class': 'btn-xs', 'class': 'btn-default btn-xs',
options: [ options: [
{ ngClick: "viewSummary(\{{ job.id \}\}, '\{\{ job.summary_fields.job_template.name \}\}')", label: 'Host Summary', { ngClick: "viewSummary(\{{ job.id \}\}, '\{\{ job.summary_fields.job_template.name \}\}')", label: 'Host Summary',
ngHide: "job.status == 'new'" }, ngHide: "job.status == 'new'" },

View File

@@ -823,6 +823,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
if (field.type == 'custom') { if (field.type == 'custom') {
html += "<div class=\"text-right " + getLabelWidth(); html += "<div class=\"text-right " + getLabelWidth();
html += (field.labelClass) ? " " + field.labelClass : ""; html += (field.labelClass) ? " " + field.labelClass : "";
html += "\" ";
html += (field.labelNGClass) ? "ng-class=\"" + field.labelNGClass + "\" " : ""; html += (field.labelNGClass) ? "ng-class=\"" + field.labelNGClass + "\" " : "";
html += ">\n"; html += ">\n";
html += (field.awPopOver) ? this.attr(field, 'awPopOver', fld) : ""; html += (field.awPopOver) ? this.attr(field, 'awPopOver', fld) : "";
@@ -832,7 +833,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += '</label>' + "\n"; html += '</label>' + "\n";
html += "</div>\n"; html += "</div>\n";
html += "<div "; html += "<div ";
html += "id=\"" + this.field.name + "_" + fld + "\" "; html += "id=\"" + form.name + "_" + fld + "\" ";
html += (field.controlNGClass) ? "ng-class=\"" + field.controlNGClass + "\" " : ""; html += (field.controlNGClass) ? "ng-class=\"" + field.controlNGClass + "\" " : "";
html += "class=\"" + getFieldWidth() + "\">\n"; html += "class=\"" + getFieldWidth() + "\">\n";
html += field.control; html += field.control;
@@ -864,7 +865,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
break; break;
} }
} }
html += "<ul class=\"dropdown-menu pull-right\" role=\"menu\">\n"; html += "<ul class=\"dropdown-menu\" role=\"menu\">\n";
for (var itm in navigation) { for (var itm in navigation) {
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"" + html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"" +
navigation[itm].href + "\" "; navigation[itm].href + "\" ";

View File

@@ -105,14 +105,44 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
html += "<div class=\"nav-path\">\n"; html += "<div class=\"nav-path\">\n";
html += "<ul class=\"breadcrumb\">\n"; html += "<ul class=\"breadcrumb\">\n";
html += "<li ng-repeat=\"crumb in breadcrumbs\"><a href=\"{{ '#' + crumb.path }}\">{{ crumb.title | capitalize }}</a></li>\n"; html += "<li ng-repeat=\"crumb in breadcrumbs\"><a href=\"{{ '#' + crumb.path }}\">{{ crumb.title | capitalize }}</a></li>\n";
html += "<li class=\"active\">";
if (options.mode == 'select') { if (list.navigationLinks) {
html += list.selectTitle; var navigation = list.navigationLinks;
html += "<li class=\"active\"> </li>\n";
html += "</ul>\n";
html += "<div class=\"dropdown\">\n";
for (var itm in navigation) {
if (navigation[itm].active) {
html += "<a href=\"\" class=\"toggle\" ";
html += "data-toggle=\"dropdown\" ";
html += ">" + navigation[itm].label + " <i class=\"icon-chevron-sign-down\"></i></a>";
break;
}
}
html += "<ul class=\"dropdown-menu\" role=\"menu\">\n";
for (var itm in navigation) {
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"" +
navigation[itm].href + "\" ";
html += (navigation[itm].active) ? "class=\"active\" " : "";
html += ">";
html += navigation[itm].label;
html += (navigation[itm].active) ? " <i class=\"icon-angle-left\"></i>" : "";
html += "</a></li>\n";
}
html += "</ul>\n";
html += "</div><!-- dropdown -->\n";
html += "</div><!-- nav-path -->\n";
} }
else { else {
html += list.editTitle; html += "<li class=\"active\">";
if (options.mode == 'select') {
html += list.selectTitle;
}
else {
html += list.editTitle;
}
html += "</li>\n</ul>\n</div>\n";
} }
html += "</li>\n</ul>\n</div>\n";
} }
if (options.mode == 'edit' && list.editInstructions) { if (options.mode == 'edit' && list.editInstructions) {
@@ -122,19 +152,10 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
html += "</div>\n"; html += "</div>\n";
} }
if (options.mode != 'lookup' && list.navigationLinks) {
html += "<div class=\"navigation-links text-right\">\n";
for (var link in list.navigationLinks) {
html += NavigationLink(list.navigationLinks[link]);
}
html += "</div>\n";
}
if (options.mode != 'lookup' && (list.well == undefined || list.well == 'true')) { if (options.mode != 'lookup' && (list.well == undefined || list.well == 'true')) {
html += "<div class=\"well\">\n"; html += "<div class=\"well\">\n";
} }
if (options.mode == 'lookup' || options.id != undefined) { if (options.mode == 'lookup' || options.id != undefined) {
html += SearchWidget({ iterator: list.iterator, template: list, mini: true , size: 'col-lg-8' }); html += SearchWidget({ iterator: list.iterator, template: list, mini: true , size: 'col-lg-8' });
} }