mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 00:38:45 -03:30
Refactor component folder structure
This commit is contained in:
@@ -1,4 +0,0 @@
|
|||||||
.at-Button {
|
|
||||||
padding: @at-padding-xs @at-padding-md;
|
|
||||||
padding-bottom: @at-padding-xs + 1;
|
|
||||||
}
|
|
||||||
17
awx/ui/client/components/_common.less
Normal file
17
awx/ui/client/components/_common.less
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
.at-Button(@bg, @bg-hover: @bg, @color, @color-hover: @color) {
|
||||||
|
color: @color;
|
||||||
|
background-color: @bg;
|
||||||
|
padding: @at-padding-xs @at-padding-md;
|
||||||
|
padding-bottom: @at-padding-xs + 1;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @color-hover;
|
||||||
|
background-color: @bg-hover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.at-Button--success { .at-Button(@at-success, @at-success-dark, @at-white) }
|
||||||
|
.at-Button--link { .at-Button(@at-link, @at-link-dark, @at-white) }
|
||||||
|
.at-Button--danger { .at-Button(@at-danger, @at-danger, @at-white) }
|
||||||
|
.at-Button--light { .at-Button(@at-white, @at-gray-light, @at-gray-dark) }
|
||||||
|
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
@import '_badge';
|
@import '_common';
|
||||||
@import '_button';
|
@import 'badge/_index';
|
||||||
@import '_input';
|
@import 'input/_index';
|
||||||
@import '_panel';
|
@import 'panel/_index';
|
||||||
|
@import 'toggle/_index';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ function atBadge () {
|
|||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
transclude: true,
|
transclude: true,
|
||||||
templateUrl: 'static/partials/components/badge.partial.html',
|
templateUrl: 'static/partials/components/badge/badge.partial.html',
|
||||||
scope: {
|
scope: {
|
||||||
config: '='
|
config: '='
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
import badge from './badge.directive';
|
import badge from './badge/badge.directive';
|
||||||
import inputSearch from './input-search.directive';
|
import inputSearch from './input/search.directive';
|
||||||
import panel from './panel.directive';
|
import panel from './panel/panel.directive';
|
||||||
import panelHeading from './panel-heading.directive';
|
import panelHeading from './panel/heading.directive';
|
||||||
import panelBody from './panel-body.directive';
|
import panelBody from './panel/body.directive';
|
||||||
|
import toggleButton from './toggle/button.directive';
|
||||||
|
import toggleContent from './toggle/content.directive';
|
||||||
|
|
||||||
angular
|
angular
|
||||||
.module('at.components', [])
|
.module('at.components', [])
|
||||||
@@ -10,5 +12,8 @@ angular
|
|||||||
.directive('atInputSearch', inputSearch)
|
.directive('atInputSearch', inputSearch)
|
||||||
.directive('atPanel', panel)
|
.directive('atPanel', panel)
|
||||||
.directive('atPanelHeading', panelHeading)
|
.directive('atPanelHeading', panelHeading)
|
||||||
.directive('atPanelBody', panelBody);
|
.directive('atPanelBody', panelBody)
|
||||||
|
.directive('atToggleButton', toggleButton)
|
||||||
|
.directive('atToggleContent', toggleContent);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
.at-InputSearch-field {
|
.at-InputSearch-field {
|
||||||
.at-placeholder;
|
.at-placeholder;
|
||||||
|
|
||||||
border-color: @at-gray-lighter;
|
border-color: @at-gray-light;
|
||||||
background-color: @at-white;
|
background-color: @at-white;
|
||||||
font-size: @at-font-md;
|
font-size: @at-font-md;
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.at-InputSearch-field:focus {
|
.at-InputSearch-field:focus {
|
||||||
border-color: @at-gray-lighter;
|
border-color: @at-gray-light;
|
||||||
}
|
}
|
||||||
|
|
||||||
.at-Input-searchButton {
|
.at-Input-searchButton {
|
||||||
@@ -9,7 +9,7 @@ function atInputSearch () {
|
|||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
transclude: true,
|
transclude: true,
|
||||||
templateUrl: 'static/partials/components/input-search.partial.html',
|
templateUrl: 'static/partials/components/input/search.partial.html',
|
||||||
link,
|
link,
|
||||||
scope: {
|
scope: {
|
||||||
config: '='
|
config: '='
|
||||||
@@ -2,7 +2,7 @@ function atPanelBody () {
|
|||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
transclude: true,
|
transclude: true,
|
||||||
templateUrl: 'static/partials/components/panel-body.partial.html'
|
templateUrl: 'static/partials/components/panel/body.partial.html'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@ function atPanelHeading () {
|
|||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
transclude: true,
|
transclude: true,
|
||||||
templateUrl: 'static/partials/components/panel-heading.partial.html',
|
templateUrl: 'static/partials/components/panel/heading.partial.html',
|
||||||
scope: {
|
scope: {
|
||||||
config: '='
|
config: '='
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@ function atPanel () {
|
|||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
transclude: true,
|
transclude: true,
|
||||||
templateUrl: 'static/partials/components/panel.partial.html'
|
templateUrl: 'static/partials/components/panel/panel.partial.html'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
32
awx/ui/client/components/toggle/_index.less
Normal file
32
awx/ui/client/components/toggle/_index.less
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
.at-ToggleButton {
|
||||||
|
&, &:focus {
|
||||||
|
border-color: @at-gray-light;
|
||||||
|
background-color: @at-white;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: @at-gray-lighter;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:hover {
|
||||||
|
border-color: @at-gray-light;
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.at-ToggleButton--show {
|
||||||
|
&, &:hover, &:focus {
|
||||||
|
background-color: @at-link;
|
||||||
|
border-color: @at-link;
|
||||||
|
color: @at-white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.at-ToggleContent-well {
|
||||||
|
margin: @at-margin-sm 0 0 0;
|
||||||
|
padding: @at-padding-md;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
background-color: @at-gray-lightest;
|
||||||
|
color: @at-gray-dark;
|
||||||
|
}
|
||||||
12
awx/ui/client/components/toggle/button.directive.js
Normal file
12
awx/ui/client/components/toggle/button.directive.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
function atToggleButton () {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
transclude: true,
|
||||||
|
templateUrl: 'static/partials/components/toggle/button.partial.html',
|
||||||
|
scope: {
|
||||||
|
config: '='
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default atToggleButton;
|
||||||
9
awx/ui/client/components/toggle/button.partial.html
Normal file
9
awx/ui/client/components/toggle/button.partial.html
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<button class="btn btn-default at-Button at-ToggleButton"
|
||||||
|
ng-class="{ 'at-ToggleButton--show': config.show }"
|
||||||
|
ng-click="config.show = !config.show">
|
||||||
|
<span ng-if="config.button">
|
||||||
|
{{ config.button.text }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<ng-transclude ng-if="!config.button"></ng-transclude>
|
||||||
|
</button>
|
||||||
12
awx/ui/client/components/toggle/content.directive.js
Normal file
12
awx/ui/client/components/toggle/content.directive.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
function atToggleContent () {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
transclude: true,
|
||||||
|
templateUrl: 'static/partials/components/toggle/content.partial.html',
|
||||||
|
scope: {
|
||||||
|
config: '='
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default atToggleContent;
|
||||||
10
awx/ui/client/components/toggle/content.partial.html
Normal file
10
awx/ui/client/components/toggle/content.partial.html
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<div ng-show="config.show" class="row">
|
||||||
|
<div ng-if="config.content" class="col-sm-12">
|
||||||
|
<div class="well at-ToggleContent-well">
|
||||||
|
{{ config.content.text }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ng-transclude ng-if="!config.content"></ng-transclude>
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -13,11 +13,12 @@ function IndexController () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
vm.key = {
|
vm.key = {
|
||||||
on: false,
|
id: 'key-group',
|
||||||
|
show: false,
|
||||||
button: {
|
button: {
|
||||||
text: 'Key'
|
text: 'Key'
|
||||||
},
|
},
|
||||||
body: {
|
content: {
|
||||||
text: 'Yadda yadda yadda'
|
text: 'Yadda yadda yadda'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,21 +2,18 @@
|
|||||||
<at-panel-heading config="vm.panel.heading"></at-panel-heading>
|
<at-panel-heading config="vm.panel.heading"></at-panel-heading>
|
||||||
<at-panel-body config="vm.panel.body">
|
<at-panel-body config="vm.panel.body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-5">
|
<div class="col-sm-5">
|
||||||
<at-input-search config="vm.panel.search"></at-input-search>
|
<at-input-search config="vm.panel.search"></at-input-search>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1 at-u-noPadding">
|
<div class="col-sm-1 at-u-noPadding">
|
||||||
<button class="btn btn-default at-Button" ng-click="vm.key.on = !vm.key.on">
|
<at-toggle-button config="vm.key"></at-toggle-button>
|
||||||
{{ vm.key.button.text }}
|
</div>
|
||||||
|
<div class="col-sm-1 pull-right">
|
||||||
|
<button class="btn at-Button--success pull-right">
|
||||||
|
+ ADD
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="vm.key.on" class="row">
|
<at-toggle-content config="vm.key"></at-toggle-content>
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="well">
|
|
||||||
{{ vm.key.body.text }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</at-panel-body>
|
</at-panel-body>
|
||||||
</at-panel>
|
</at-panel>
|
||||||
|
|||||||
@@ -12,12 +12,12 @@
|
|||||||
|
|
||||||
.at-buttonColor () {
|
.at-buttonColor () {
|
||||||
background-color: @at-white;
|
background-color: @at-white;
|
||||||
border-color: @at-gray-lighter;
|
border-color: @at-gray-light;
|
||||||
color: @at-gray;
|
color: @at-gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
.at-buttonColorHover () {
|
.at-buttonColorHover () {
|
||||||
background-color: @at-gray-lightest;
|
background-color: @at-gray-lighter;
|
||||||
border-color: @at-gray-lighter;
|
border-color: @at-gray-light;
|
||||||
color: @at-gray;
|
color: @at-gray;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,19 @@
|
|||||||
@at-white: #ffffff;
|
@at-white: #ffffff;
|
||||||
@at-gray-lightest: #fafafa;
|
|
||||||
@at-gray-lighter: #b7b7b7;
|
@at-gray-lightest: #f6f6f6;
|
||||||
|
@at-gray-lighter: #fafafa;
|
||||||
|
@at-gray-light: #b7b7b7;
|
||||||
@at-gray: #848992;
|
@at-gray: #848992;
|
||||||
@at-gray-dark: #707070;
|
@at-gray-dark: #707070;
|
||||||
|
|
||||||
|
@at-link: #337AB7;
|
||||||
|
@at-link-dark: #286090;
|
||||||
|
|
||||||
|
@at-success: #5CB85C;
|
||||||
|
@at-success-dark: #449D44;
|
||||||
|
|
||||||
|
@at-danger: #449D44;
|
||||||
|
|
||||||
@at-font-sm: 12px;
|
@at-font-sm: 12px;
|
||||||
@at-font-md: 14px;
|
@at-font-md: 14px;
|
||||||
@at-font-lg: 16px;
|
@at-font-lg: 16px;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ module.exports = {
|
|||||||
}, {
|
}, {
|
||||||
cwd: 'client/components',
|
cwd: 'client/components',
|
||||||
expand: true,
|
expand: true,
|
||||||
src: ['*.partial.html'],
|
src: ['**/*.partial.html'],
|
||||||
dest: 'static/partials/components/'
|
dest: 'static/partials/components/'
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
partials: {
|
partials: {
|
||||||
files: [
|
files: [
|
||||||
'client/components/*.partial.html',
|
'client/components/**/*.partial.html',
|
||||||
'client/src/**/*.partial.html'
|
'client/src/**/*.partial.html'
|
||||||
],
|
],
|
||||||
tasks: ['newer:copy:partials']
|
tasks: ['newer:copy:partials']
|
||||||
|
|||||||
Reference in New Issue
Block a user