Restyled hosts side of inventory edit page. Still need to calc # or rows that resized host container can accommodate.

This commit is contained in:
chouseknecht
2014-05-20 15:28:23 -04:00
parent 3711409237
commit 4f88a0b582
4 changed files with 21 additions and 10 deletions

View File

@@ -21,7 +21,7 @@ angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationLis
}; };
}]) }])
.factory('SetGroupContainerHeight', [ 'GetGroupContainerHeight', function(GetGroupContainerHeight) { .factory('SetContainerHeights', [ 'GetGroupContainerHeight', function(GetGroupContainerHeight) {
return function() { return function() {
var height; var height;
if ($(window).width() > 1210) { 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').height('auto');
} }
$('#groups-container .list-table-container').mCustomScrollbar("update"); $('#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 () { return function () {
// Call to set or restore window resize // Call to set or restore window resize
SetGroupContainerHeight(); SetContainerHeights();
$(window).resize(_.debounce(function() { $(window).resize(_.debounce(function() {
// Hack to stop group-name div slipping to a new line // Hack to stop group-name div slipping to a new line
$('#groups_table .name-column').each(function () { $('#groups_table .name-column').each(function () {
@@ -51,7 +53,7 @@ angular.module('InventoryHelper', ['RestServices', 'Utilities', 'OrganizationLis
}); });
ApplyEllipsis('#groups_table .group-name a'); ApplyEllipsis('#groups_table .group-name a');
ApplyEllipsis('#hosts_table .host-name a'); ApplyEllipsis('#hosts_table .host-name a');
SetGroupContainerHeight(); SetContainerHeights();
}, 500)); }, 500));
}; };
} }

View File

@@ -50,8 +50,9 @@ angular.module('InventoryHostsDefinition', [])
}, },
fieldActions: { fieldActions: {
columnClass: 'col-lg-2 col-md-2 col-sm-2 col-xs-3', columnClass: 'col-lg-2 col-md-2 col-sm-2 col-xs-3',
label: false,
enabled_flag: { enabled_flag: {
iconClass: "{{ 'fa icon-enabled-' + host.enabled }}", iconClass: "{{ 'fa icon-enabled-' + host.enabled }}",

View File

@@ -1333,7 +1333,14 @@ input[type="checkbox"].checkbox-no-label {
overflow: auto; overflow: auto;
} }
.list-actions { .list-actions {
margin-bottom: 0; margin-bottom: 15px;
}
}
#hosts-container {
.list-table-container {
position: relative;
top: -15px;
} }
} }

View File

@@ -475,11 +475,12 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
} }
if (options.mode === 'select' || options.mode === 'lookup') { if (options.mode === 'select' || options.mode === 'lookup') {
html += "<th>Select</th>"; html += "<th>Select</th>";
} else if (options.mode === 'edit' && list.fieldActions && } else if (options.mode === 'edit' && list.fieldActions) {
(list.fieldActions.label === undefined || list.fieldActions.label)) {
html += "<th class=\"actions-column"; html += "<th class=\"actions-column";
html += (list.fieldActions && list.fieldActions.columnClass) ? " " + list.fieldActions.columnClass : ""; html += (list.fieldActions && list.fieldActions.columnClass) ? " " + list.fieldActions.columnClass : "";
html += "\">Actions</th>\n"; html += "\">";
html += (list.fieldActions.label === undefined || list.fieldActions.label) ? "Actions" : "";
html += "</th>\n";
} }
html += "</tr>\n"; html += "</tr>\n";
html += "</thead>\n"; html += "</thead>\n";