From a1fbfba850c12a6a5d116bb73fd5d04497272f34 Mon Sep 17 00:00:00 2001 From: Ken Hoes Date: Fri, 22 Apr 2016 11:37:40 -0400 Subject: [PATCH] Fixed title bar for hosts addition and edit in inventory section --- awx/ui/client/src/forms/Hosts.js | 2 + .../manage-hosts.directive.controller.js | 10 ++--- .../manage-hosts.directive.partial.html | 39 ++++++++----------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/awx/ui/client/src/forms/Hosts.js b/awx/ui/client/src/forms/Hosts.js index 4158917fc2..23df0f009d 100644 --- a/awx/ui/client/src/forms/Hosts.js +++ b/awx/ui/client/src/forms/Hosts.js @@ -20,6 +20,8 @@ export default well: false, formLabelSize: 'col-lg-3', formFieldSize: 'col-lg-9', + cancelButton: false, + showHeader: false, fields: { name: { diff --git a/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js b/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js index 87b706a48b..2940bf810c 100644 --- a/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js +++ b/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.controller.js @@ -30,23 +30,22 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam url, form_scope; var host_id = $stateParams.host_id || undefined; - + var hostName = ''; form_scope = generator.inject(HostForm, { - mode: 'edit', + mode: mode, id: 'host-panel-form', related: false, scope: scope, - cancelButton: false }); generator.reset(); - // Retrieve detail record and prepopulate the form if (mode === 'edit') { defaultUrl = GetBasePath('hosts') + host_id + '/'; Rest.setUrl(defaultUrl); Rest.get() .success(function(data) { + vm.hostName = data.name; var set, fld, related; for (fld in form.fields) { if (data[fld]) { @@ -187,7 +186,8 @@ function manageHostsDirectiveController($rootScope, $location, $log, $stateParam angular.extend(vm, { cancelPanel: cancelPanel, saveHost: saveHost, - mode: mode + mode: mode, + hostName: hostName }); } diff --git a/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.partial.html b/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.partial.html index 31c2249234..16bb9e16ac 100644 --- a/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.partial.html +++ b/awx/ui/client/src/inventories/manage/manage-hosts/directive/manage-hosts.directive.partial.html @@ -1,25 +1,20 @@
-
-
Create Host
-
- -
-
-
- -
- -
-
-
- - +
+
{{vm.hostName}}
+
Create Host
+
+ +
+
+
+
+
+ + +
-