From 44775f691bad52bb8700a8d4fd60c7b37a181a3c Mon Sep 17 00:00:00 2001 From: Greg Considine Date: Fri, 17 Mar 2017 13:42:18 -0400 Subject: [PATCH 1/4] Add correct styling for home dashboard popover --- awx/ui/client/legacy-styles/ansible-ui.less | 28 +++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index 9deeb361a9..cc8380c721 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -1955,9 +1955,6 @@ tr td button i { padding-left: 15px; padding-right: 15px; } - - - } // lists.less uses 600px as the breakpoint, doing same for consistency @@ -1970,15 +1967,26 @@ tr td button i { .nvtooltip { border-radius: 4px; - padding: 3px 10px; -} -.nvtooltip td.value { - padding-right: 0px; -} + td.value { + padding-right: 0px; + } -.nvtooltip p { - padding: 3px 0px; + p { + padding: 3px 0px; + } + + & > table > thead > tr > td { + font-weight: 700; + + &:first-child { + padding-top: 0; + } + } + + & > table > tbody > tr:last-child > td { + padding-bottom: 0; + } } .nvd3 g.nv-groups path.nv-line { From 10a51c72f056c2c1c2206f5fa1137684575428ce Mon Sep 17 00:00:00 2001 From: Greg Considine Date: Tue, 21 Mar 2017 11:43:39 -0400 Subject: [PATCH 2/4] Add toggle switch for YAML,JSON selection --- awx/ui/client/legacy-styles/ansible-ui.less | 1 + awx/ui/client/legacy-styles/forms.less | 22 ++++++++++++++++ awx/ui/client/src/shared/form-generator.js | 28 +++++++++++++++------ 3 files changed, 43 insertions(+), 8 deletions(-) diff --git a/awx/ui/client/legacy-styles/ansible-ui.less b/awx/ui/client/legacy-styles/ansible-ui.less index cc8380c721..6459b5ca60 100644 --- a/awx/ui/client/legacy-styles/ansible-ui.less +++ b/awx/ui/client/legacy-styles/ansible-ui.less @@ -2296,3 +2296,4 @@ html input[disabled] { .CodeMirror--disabled .CodeMirror-cursors { display: none; } + diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 23f49bde58..4ee8ecfa6e 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -478,6 +478,28 @@ input[type='radio']:checked:before { width: 100%; display: block !important; } + +.Form-inputLabelContainer[for=variables] { + width: auto; + display: inline-block !important; +} + +.FormToggle {} +.FormToggle-container { + float: right; + margin: 0 0 0 10px; + padding-bottom: 5px; + + .btn.btn-xs { + padding: 0px 10px; + } + + input { + visibility: hidden; + position: absolute; + } +} + .Form-inputLabel{ text-transform: uppercase; color: @default-interface-txt; diff --git a/awx/ui/client/src/shared/form-generator.js b/awx/ui/client/src/shared/form-generator.js index a1a2a6761f..4030aa2183 100644 --- a/awx/ui/client/src/shared/form-generator.js +++ b/awx/ui/client/src/shared/form-generator.js @@ -659,14 +659,26 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += (field.hintText) ? "\n\t\t\n\t\t\t\n\t\t\t\n\t\t\tHint: " + field.hintText + "\n\t\t" : ""; // Variable editing if (fld === "variables" || fld === "extra_vars" || _.last(fld.split('_')) === 'variables' || fld === 'source_vars') { - html += "
" + - " YAML\n"; - html += " JSON\n"; - html += "
\n"; + let parseTypeId = `${form.name}_${fld}_parse_type`; + let parseTypeName = field.parseTypeName || 'parseType'; + let getToggleClass = (primary, secondary) => `{ + 'btn-primary': ${parseTypeName} === '${primary}', + 'btn-default' : ${parseTypeName} === '${secondary}' + }`; + let toggleLeftClass = getToggleClass('yaml', 'json'); + let toggleRightClass = getToggleClass('json', 'yaml'); + + html += ` +
+
+ + +
+
`; } if (field.labelAction) { From 7d4b3a08f25aeaf75c2f2ad77a9c2a82b2cde6f5 Mon Sep 17 00:00:00 2001 From: Greg Considine Date: Tue, 21 Mar 2017 13:39:05 -0400 Subject: [PATCH 3/4] Remove inner border on toggles --- awx/ui/client/legacy-styles/forms.less | 13 +++++++++++-- .../client/src/portal-mode/portal-mode.block.less | 9 +++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/legacy-styles/forms.less b/awx/ui/client/legacy-styles/forms.less index 4ee8ecfa6e..6dbf25d1c7 100644 --- a/awx/ui/client/legacy-styles/forms.less +++ b/awx/ui/client/legacy-styles/forms.less @@ -490,14 +490,23 @@ input[type='radio']:checked:before { margin: 0 0 0 10px; padding-bottom: 5px; - .btn.btn-xs { - padding: 0px 10px; + label { + &:first-child { + border-right: none; + } + &:last-child { + border-left: none; + } } input { visibility: hidden; position: absolute; } + + .btn.btn-xs { + padding: 0px 10px; + } } .Form-inputLabel{ diff --git a/awx/ui/client/src/portal-mode/portal-mode.block.less b/awx/ui/client/src/portal-mode/portal-mode.block.less index aad0710d95..40b232bf4b 100644 --- a/awx/ui/client/src/portal-mode/portal-mode.block.less +++ b/awx/ui/client/src/portal-mode/portal-mode.block.less @@ -23,6 +23,15 @@ align-items: center; justify-content: center; + .PortalMode-filter > button { + &:first-child { + border-right: none; + } + &:last-child { + border-left: none; + } + } + .btn.btn-xs { padding: 1px 10px; } From 6b6cf9aecc6e87c840b70cc5f289b7a74d44ac37 Mon Sep 17 00:00:00 2001 From: Greg Considine Date: Thu, 23 Mar 2017 09:42:22 -0400 Subject: [PATCH 4/4] Adjust BEM naming of portal component --- .../portal-mode-layout.partial.html | 4 ++-- .../src/portal-mode/portal-mode.block.less | 23 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/awx/ui/client/src/portal-mode/portal-mode-layout.partial.html b/awx/ui/client/src/portal-mode/portal-mode-layout.partial.html index 5781c920ad..823097661d 100644 --- a/awx/ui/client/src/portal-mode/portal-mode-layout.partial.html +++ b/awx/ui/client/src/portal-mode/portal-mode-layout.partial.html @@ -8,9 +8,9 @@
+ 'btn-default' : activeFilter != 'user' }" ng-click='filterUser()' class="btn btn-xs PortalMode-filterButton--edges" translate>My Jobs + 'btn-default' : activeFilter != 'all'}" ng-click='filterAll()' class="btn btn-xs PortalMode-filterButton--edges" translate>All Jobs