From 1abb6e8ffb7840dfc6124a6c7cd5653e1cb27d62 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 21 Jun 2016 13:49:36 -0700 Subject: [PATCH] Related tab-search-bars 100% width w/o actions If there are no actions like ADD, then the search bar should be 100% width --- awx/ui/client/src/shared/form-generator.js | 28 +++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index 9c82498e24..bb7e76a0b3 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -1793,7 +1793,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat form = params.form, itm = params.related, collection = form.related[itm], - act, fld, cnt, base, fAction; + act, fld, cnt, base, fAction, width; if (collection.instructions) { html += "
\n"; @@ -1817,10 +1817,18 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat }); var hideOnSuperuser = (hideOnSuperuser === true) ? true : false; + if(actionButtons.length === 0 ){ + // The search bar should be full width if there are no + // action buttons + width = "col-lg-12 col-md-12 col-sm-12 col-xs-12"; + } + else { + width = "col-lg-8 col-md-8 col-sm-8 col-xs-12"; + } html += `
-
0) && !(is_superuser && ${hideOnSuperuser})\"> ${tagSearch} +
`; + + if(actionButtons.length>0){ + html += `
+
+ ${actionButtons}
-
-
- ${actionButtons} -
-
-
- `; +
`; + } + html += "
"; // Message for when a search returns no results. This should only get shown after a search is executed with no results.