1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

Fixing related tab empty list styling

This commit is contained in:
Jared Tabor 2016-05-10 16:03:36 -04:00
parent ba1e4cb19a
commit ac2e334186
3 changed files with 47 additions and 41 deletions

View File

@ -167,6 +167,13 @@ export default
scope[iterator + 'ShowStartBtn'] = false;
}
if(scope[iterator + 'SearchValue'] && scope[iterator + 'SearchValue'] !== '') {
scope[iterator + '_active_search'] = true;
}
else {
scope[iterator + '_active_search'] = false;
}
if (iterator === 'host') {
if (scope.hostSearchField === 'has_active_failures') {
if (scope.hostSearchSelectValue && scope.hostSearchSelectValue.value === 1) {
@ -230,7 +237,6 @@ export default
url += (url.match(/\/$/)) ? '?' : '&';
url += scope[iterator + 'SearchParams'];
url += (scope[iterator + '_page_size']) ? '&page_size=' + scope[iterator + '_page_size'] : "";
scope[iterator + '_active_search'] = true;
RefreshRelated({ scope: scope, set: set, iterator: iterator, url: url });
};

View File

@ -119,7 +119,7 @@ export default ['$log', '$cookieStore', '$compile', '$window', '$rootScope', '$l
// Go back to most recent navigation path
$location.path(lastPath());
} else {
$location.url('/home?login=true');
$location.url('/home');
}
})
.error(function () {

View File

@ -1780,61 +1780,61 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
actionButtons += ActionButton(collection
.actions[act]);
});
var hideOnSuperuser = (hideOnSuperuser === true) ? true : false;
html += `
<div class=\"row\"
ng-show=\"${collection.hideSearchAndActions ? false : true}\">
<div class=\"col-lg-8 col-md-8 col-sm-8 col-xs-12\"
ng-show=\"${collection.iterator}Loading == true ||
${collection.iterator}_active_search == true || (
${collection.iterator}Loading == false &&
${collection.iterator}_active_search == false &&
${collection.iterator}_total_rows > 0)\"
ng-hide=\"is_superuser && ${collection.hideOnSuperuser}\"
>
${tagSearch}
</div>
<div class=\"col-lg-4 col-md-4 col-sm-4 col-xs-12\">
<div class=\"list-actions\">
${actionButtons}
</div>
</div>
</div>
<div class=\"row\"
ng-show=\"${collection.hideSearchAndActions ? false : true}\">
<div class=\"col-lg-8 col-md-8 col-sm-8 col-xs-12\"
ng-show=\"${collection.iterator}Loading == true ||
${collection.iterator}_active_search == true || (
${collection.iterator}Loading == false &&
${collection.iterator}_active_search == false &&
${collection.iterator}_total_rows > 0) &&
!(is_superuser && ${hideOnSuperuser})\">
${tagSearch}
</div>
<div class=\"col-lg-4 col-md-4 col-sm-4 col-xs-12\">
<div class=\"list-actions\">
${actionButtons}
</div>
</div>
</div>
`;
// Message for when a search returns no results. This should only get shown after a search is executed with no results.
var hideOnSuperuser = (hideOnSuperuser === true) ? true : false;
html += `
<div
class=\"row\"
ng-show=\" ${collection.iterator}Loading == false &&
${collection.iterator}_active_search == true &&
${itm}.length == 0 &&
!(is_superuser && ${collection.hideOnSuperuser})\">
<div class=\"col-lg-12 List-searchNoResults\">
No records matched your search.
</div>
</div>
<div
class=\"row\"
ng-show=\" ${collection.iterator}Loading == false &&
${collection.iterator}_active_search == true &&
${itm}.length == 0 &&
!(is_superuser && ${collection.hideOnSuperuser})\">
<div class=\"col-lg-12 List-searchNoResults\">
No records matched your search.
</div>
</div>
`;
// Show the "no items" box when loading is done and the user isn't actively searching and there are no results
html += "<div class=\"List-noItems\" ng-show=\"" + collection.iterator + "Loading == false && " + collection.iterator + "_active_search == false && " + collection.iterator + "_total_rows < 1\">PLEASE ADD ITEMS TO THIS LIST</div>";
html += `
<div class=\"List-noItems\" ng-show=\"is_superuser\">
System Administrators have access to all ${collection.iterator}s
</div>
<div class=\"List-noItems\" ng-show=\"is_superuser\">
System Administrators have access to all ${collection.iterator}s
</div>
`;
// Start the list
html += `
<div class=\"list-wrapper\"
ng-show=\"(${collection.iterator}Loading == true ||
(${collection.iterator}Loading == false && ${itm}.length > 0)) &&
!(is_superuser && ${collection.hideOnSuperuser})\">
<table id=\"${itm}_table\" class=\"${collection.iterator} List-table\">
<thead>
<tr class=\"List-tableHeaderRow\">
<div class=\"list-wrapper\"
ng-show=\"(${collection.iterator}Loading == true ||
(${collection.iterator}Loading == false && ${itm}.length > 0)) &&
!(is_superuser && ${collection.hideOnSuperuser})\">
<table id=\"${itm}_table\" class=\"${collection.iterator} List-table\">
<thead>
<tr class=\"List-tableHeaderRow\">
`;
html += (collection.index === undefined || collection.index !== false) ? "<th class=\"col-xs-1\">#</th>\n" : "";
for (fld in collection.fields) {