From 4f88a0b582f4f79cd5551d54067cdffca5e81eb1 Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Tue, 20 May 2014 15:28:23 -0400 Subject: [PATCH] Restyled hosts side of inventory edit page. Still need to calc # or rows that resized host container can accommodate. --- awx/ui/static/js/helpers/inventory.js | 12 +++++++----- awx/ui/static/js/lists/InventoryHosts.js | 3 ++- awx/ui/static/less/ansible-ui.less | 9 ++++++++- awx/ui/static/lib/ansible/list-generator.js | 7 ++++--- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/awx/ui/static/js/helpers/inventory.js b/awx/ui/static/js/helpers/inventory.js index bfbff2bf58..f2f69139d5 100644 --- a/awx/ui/static/js/helpers/inventory.js +++ b/awx/ui/static/js/helpers/inventory.js @@ -21,7 +21,7 @@ angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationLis }; }]) -.factory('SetGroupContainerHeight', [ 'GetGroupContainerHeight', function(GetGroupContainerHeight) { +.factory('SetContainerHeights', [ 'GetGroupContainerHeight', function(GetGroupContainerHeight) { return function() { var height; if ($(window).width() > 1210) { @@ -32,13 +32,15 @@ angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationLis $('#groups-container .list-table-container').height('auto'); } $('#groups-container .list-table-container').mCustomScrollbar("update"); + $('#hosts-container .well').height( $('#groups-container').height() - 39 ); }; }]) -.factory('WatchInventoryWindowResize', ['ApplyEllipsis', 'SetGroupContainerHeight', - function (ApplyEllipsis, SetGroupContainerHeight) { + +.factory('WatchInventoryWindowResize', ['ApplyEllipsis', 'SetContainerHeights', + function (ApplyEllipsis, SetContainerHeights) { return function () { // Call to set or restore window resize - SetGroupContainerHeight(); + SetContainerHeights(); $(window).resize(_.debounce(function() { // Hack to stop group-name div slipping to a new line $('#groups_table .name-column').each(function () { @@ -51,7 +53,7 @@ angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationLis }); ApplyEllipsis('#groups_table .group-name a'); ApplyEllipsis('#hosts_table .host-name a'); - SetGroupContainerHeight(); + SetContainerHeights(); }, 500)); }; } diff --git a/awx/ui/static/js/lists/InventoryHosts.js b/awx/ui/static/js/lists/InventoryHosts.js index 664efa2160..707804e7cb 100644 --- a/awx/ui/static/js/lists/InventoryHosts.js +++ b/awx/ui/static/js/lists/InventoryHosts.js @@ -50,8 +50,9 @@ angular.module('InventoryHostsDefinition', []) }, fieldActions: { - + columnClass: 'col-lg-2 col-md-2 col-sm-2 col-xs-3', + label: false, enabled_flag: { iconClass: "{{ 'fa icon-enabled-' + host.enabled }}", diff --git a/awx/ui/static/less/ansible-ui.less b/awx/ui/static/less/ansible-ui.less index 7680e313ae..0ba62f4570 100644 --- a/awx/ui/static/less/ansible-ui.less +++ b/awx/ui/static/less/ansible-ui.less @@ -1333,7 +1333,14 @@ input[type="checkbox"].checkbox-no-label { overflow: auto; } .list-actions { - margin-bottom: 0; + margin-bottom: 15px; + } + } + + #hosts-container { + .list-table-container { + position: relative; + top: -15px; } } diff --git a/awx/ui/static/lib/ansible/list-generator.js b/awx/ui/static/lib/ansible/list-generator.js index 63fa260497..dee5c9b8fb 100644 --- a/awx/ui/static/lib/ansible/list-generator.js +++ b/awx/ui/static/lib/ansible/list-generator.js @@ -475,11 +475,12 @@ angular.module('ListGenerator', ['GeneratorHelpers']) } if (options.mode === 'select' || options.mode === 'lookup') { html += "Select"; - } else if (options.mode === 'edit' && list.fieldActions && - (list.fieldActions.label === undefined || list.fieldActions.label)) { + } else if (options.mode === 'edit' && list.fieldActions) { html += "Actions\n"; + html += "\">"; + html += (list.fieldActions.label === undefined || list.fieldActions.label) ? "Actions" : ""; + html += "\n"; } html += "\n"; html += "\n";