From 93e53034c19009b72d0e09ca47bcdb0e0d2a3445 Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Fri, 20 Sep 2013 16:42:58 -0400 Subject: [PATCH] Applied same navigation/drop-down changes to jobs that we applied to inventory. --- awx/ui/static/js/controllers/Jobs.js | 3 +- awx/ui/static/js/forms/Jobs.js | 9 +++- awx/ui/static/js/lists/JobEvents.js | 11 ++++- awx/ui/static/js/lists/JobHosts.js | 9 +++- awx/ui/static/js/lists/Jobs.js | 2 +- awx/ui/static/lib/ansible/form-generator.js | 5 ++- awx/ui/static/lib/ansible/list-generator.js | 49 +++++++++++++++------ 7 files changed, 64 insertions(+), 24 deletions(-) diff --git a/awx/ui/static/js/controllers/Jobs.js b/awx/ui/static/js/controllers/Jobs.js index e8d17b4fe2..4ab6a78299 100644 --- a/awx/ui/static/js/controllers/Jobs.js +++ b/awx/ui/static/js/controllers/Jobs.js @@ -275,7 +275,8 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams, Rest.get({ params: {id: id} }) .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) { if (fld != 'variables' && data[fld] !== null && data[fld] !== undefined) { diff --git a/awx/ui/static/js/forms/Jobs.js b/awx/ui/static/js/forms/Jobs.js index c165e85a42..70d082a9c4 100644 --- a/awx/ui/static/js/forms/Jobs.js +++ b/awx/ui/static/js/forms/Jobs.js @@ -15,9 +15,15 @@ angular.module('JobFormDefinition', []) name: 'jobs', well: true, twoColumns: true, - navigationLinks: { + details: { + href: "/#/jobs/{{ job_id }}", + label: 'Details', + icon: 'icon-zoom-in', + active: true, + ngShow: "job_id !== null" + }, hosts: { href: "/#/jobs/{{ job_id }}/job_host_summaries", label: 'Hosts', @@ -30,7 +36,6 @@ angular.module('JobFormDefinition', []) } }, - fields: { name: { label: 'Job Template', diff --git a/awx/ui/static/js/lists/JobEvents.js b/awx/ui/static/js/lists/JobEvents.js index 9348afa261..7246c6bf78 100644 --- a/awx/ui/static/js/lists/JobEvents.js +++ b/awx/ui/static/js/lists/JobEvents.js @@ -22,12 +22,19 @@ angular.module('JobEventsListDefinition', []) details: { href: "/#/jobs/{{ job_id }}", label: 'Details', - icon: 'icon-zoom-in' + icon: 'icon-zoom-in', + ngShow: "job_id !== null" }, - summary: { + hosts: { href: "/#/jobs/{{ job_id }}/job_host_summaries", label: 'Hosts', icon: 'icon-laptop' + }, + events: { + href: "/#/jobs/{{ job_id }}/job_events", + label: 'Events', + active: true, + icon: 'icon-list-ul' } }, diff --git a/awx/ui/static/js/lists/JobHosts.js b/awx/ui/static/js/lists/JobHosts.js index 5bb8d84565..8dfeca0f2d 100644 --- a/awx/ui/static/js/lists/JobHosts.js +++ b/awx/ui/static/js/lists/JobHosts.js @@ -23,11 +23,16 @@ angular.module('JobHostDefinition', []) icon: 'icon-zoom-in', ngShow: "job_id !== null" }, + hosts: { + href: "/#/jobs/{{ job_id }}/job_host_summaries", + label: 'Hosts', + active: true, + icon: 'icon-laptop' + }, events: { href: "/#/jobs/{{ job_id }}/job_events", label: 'Events', - icon: 'icon-list-ul', - ngShow: "job_id !== null" + icon: 'icon-list-ul' } }, diff --git a/awx/ui/static/js/lists/Jobs.js b/awx/ui/static/js/lists/Jobs.js index faeb38c979..08f64ebb3e 100644 --- a/awx/ui/static/js/lists/Jobs.js +++ b/awx/ui/static/js/lists/Jobs.js @@ -95,7 +95,7 @@ angular.module('JobsListDefinition', []) type: 'DropDown', label: 'View', icon: 'icon-zoom-in', - 'class': 'btn-xs', + 'class': 'btn-default btn-xs', options: [ { ngClick: "viewSummary(\{{ job.id \}\}, '\{\{ job.summary_fields.job_template.name \}\}')", label: 'Host Summary', ngHide: "job.status == 'new'" }, diff --git a/awx/ui/static/lib/ansible/form-generator.js b/awx/ui/static/lib/ansible/form-generator.js index 00dba415ef..2ad63a61b8 100644 --- a/awx/ui/static/lib/ansible/form-generator.js +++ b/awx/ui/static/lib/ansible/form-generator.js @@ -823,6 +823,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) if (field.type == 'custom') { html += "
\n"; html += field.control; @@ -864,7 +865,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) break; } } - html += "
\n"; } else { - html += list.editTitle; + html += "
  • "; + if (options.mode == 'select') { + html += list.selectTitle; + } + else { + html += list.editTitle; + } + html += "
  • \n\n\n"; } - html += "\n\n\n"; } if (options.mode == 'edit' && list.editInstructions) { @@ -122,18 +152,9 @@ angular.module('ListGenerator', ['GeneratorHelpers']) html += "\n"; } - if (options.mode != 'lookup' && list.navigationLinks) { - html += "\n"; - } - if (options.mode != 'lookup' && (list.well == undefined || list.well == 'true')) { html += "
    \n"; } - if (options.mode == 'lookup' || options.id != undefined) { html += SearchWidget({ iterator: list.iterator, template: list, mini: true , size: 'col-lg-8' });