mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 08:21:15 +03:00
create componentized tags
This commit is contained in:
parent
03d975e18d
commit
7292e00158
@ -37,11 +37,8 @@
|
||||
</form>
|
||||
|
||||
<div class="jobz-tagz">
|
||||
<div class="LabelList-tagContainer" ng-repeat="tag in vm.tags track by $index">
|
||||
<div class="LabelList-tag LabelList-tag--deletable"><span class="LabelList-name">{{ tag }}</span></div>
|
||||
<div class="LabelList-deleteContainer" ng-click="vm.removeSearchTag($index)">
|
||||
<i class="fa fa-times LabelList-tagDelete"></i>
|
||||
</div>
|
||||
<div class="TagComponentWrapper" ng-repeat="tag in vm.tags track by $index">
|
||||
<at-tag tag="tag" remove-tag="vm.removeSearchTag($index)"></at-tag>
|
||||
</div>
|
||||
<div><a href class="jobz-searchClearAll" ng-click="vm.clearSearch()" ng-show="!(vm.tags | isEmpty)">
|
||||
{{:: vm.strings.get('search.CLEAR_ALL') }}
|
||||
|
@ -8,6 +8,7 @@
|
||||
@import 'popover/_index';
|
||||
@import 'relaunchButton/_index';
|
||||
@import 'tabs/_index';
|
||||
@import 'tag/_index';
|
||||
@import 'truncate/_index';
|
||||
@import 'utility/_index';
|
||||
@import 'code-mirror/_index';
|
||||
|
@ -32,6 +32,7 @@ import sideNav from '~components/layout/side-nav.directive';
|
||||
import sideNavItem from '~components/layout/side-nav-item.directive';
|
||||
import tab from '~components/tabs/tab.directive';
|
||||
import tabGroup from '~components/tabs/group.directive';
|
||||
import tag from '~components/tag/tag.directive';
|
||||
import topNavItem from '~components/layout/top-nav-item.directive';
|
||||
import truncate from '~components/truncate/truncate.directive';
|
||||
import atCodeMirror from '~components/code-mirror';
|
||||
@ -78,6 +79,7 @@ angular
|
||||
.directive('atSideNavItem', sideNavItem)
|
||||
.directive('atTab', tab)
|
||||
.directive('atTabGroup', tabGroup)
|
||||
.directive('atTag', tag)
|
||||
.directive('atTopNavItem', topNavItem)
|
||||
.directive('atTruncate', truncate)
|
||||
.service('BaseInputController', BaseInputController)
|
||||
|
53
awx/ui/client/lib/components/tag/_index.less
Normal file
53
awx/ui/client/lib/components/tag/_index.less
Normal file
@ -0,0 +1,53 @@
|
||||
.TagComponentWrapper {
|
||||
padding: 5px;
|
||||
}
|
||||
.TagComponent {
|
||||
color: white;
|
||||
background: #337AB7;
|
||||
border-radius: @at-space;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-content: center;
|
||||
min-height: @at-space-4x;
|
||||
overflow: hidden;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.TagComponent-name {
|
||||
margin: @at-space @at-space-2x;
|
||||
align-self: center;
|
||||
word-break: break-word;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
||||
.TagComponent--cloud {
|
||||
&:before {
|
||||
content: '\f0c2';
|
||||
color: white;
|
||||
height: 20px;
|
||||
width: @at-space-4x;
|
||||
}
|
||||
}
|
||||
|
||||
.TagComponent--key {
|
||||
&:before {
|
||||
content: '\f084';
|
||||
color: white;
|
||||
height: @at-space-4x;
|
||||
width: @at-space-4x;
|
||||
}
|
||||
}
|
||||
|
||||
.TagComponent-button {
|
||||
padding: 0 @at-space;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.TagComponent-button:hover {
|
||||
cursor: pointer;
|
||||
border-color: @default-err;
|
||||
background-color: @default-err;
|
||||
}
|
16
awx/ui/client/lib/components/tag/tag.directive.js
Normal file
16
awx/ui/client/lib/components/tag/tag.directive.js
Normal file
@ -0,0 +1,16 @@
|
||||
const templateUrl = require('~components/tag/tag.partial.html');
|
||||
|
||||
function atTag () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
templateUrl,
|
||||
scope: {
|
||||
tag: '=',
|
||||
removeTag: '&?',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default atTag;
|
6
awx/ui/client/lib/components/tag/tag.partial.html
Normal file
6
awx/ui/client/lib/components/tag/tag.partial.html
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="TagComponent" ng-transclude>
|
||||
<div class="TagComponent-name">{{ tag }}</div>
|
||||
<div ng-if="removeTag" class="TagComponent-button" ng-click="removeTag(index)">
|
||||
<i class="fa fa-times TagComponent-button__delete"></i>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user