mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 15:09:32 -02:30
create componentized tags
This commit is contained in:
@@ -37,11 +37,8 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="jobz-tagz">
|
<div class="jobz-tagz">
|
||||||
<div class="LabelList-tagContainer" ng-repeat="tag in vm.tags track by $index">
|
<div class="TagComponentWrapper" ng-repeat="tag in vm.tags track by $index">
|
||||||
<div class="LabelList-tag LabelList-tag--deletable"><span class="LabelList-name">{{ tag }}</span></div>
|
<at-tag tag="tag" remove-tag="vm.removeSearchTag($index)"></at-tag>
|
||||||
<div class="LabelList-deleteContainer" ng-click="vm.removeSearchTag($index)">
|
|
||||||
<i class="fa fa-times LabelList-tagDelete"></i>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div><a href class="jobz-searchClearAll" ng-click="vm.clearSearch()" ng-show="!(vm.tags | isEmpty)">
|
<div><a href class="jobz-searchClearAll" ng-click="vm.clearSearch()" ng-show="!(vm.tags | isEmpty)">
|
||||||
{{:: vm.strings.get('search.CLEAR_ALL') }}
|
{{:: vm.strings.get('search.CLEAR_ALL') }}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
@import 'popover/_index';
|
@import 'popover/_index';
|
||||||
@import 'relaunchButton/_index';
|
@import 'relaunchButton/_index';
|
||||||
@import 'tabs/_index';
|
@import 'tabs/_index';
|
||||||
|
@import 'tag/_index';
|
||||||
@import 'truncate/_index';
|
@import 'truncate/_index';
|
||||||
@import 'utility/_index';
|
@import 'utility/_index';
|
||||||
@import 'code-mirror/_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 sideNavItem from '~components/layout/side-nav-item.directive';
|
||||||
import tab from '~components/tabs/tab.directive';
|
import tab from '~components/tabs/tab.directive';
|
||||||
import tabGroup from '~components/tabs/group.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 topNavItem from '~components/layout/top-nav-item.directive';
|
||||||
import truncate from '~components/truncate/truncate.directive';
|
import truncate from '~components/truncate/truncate.directive';
|
||||||
import atCodeMirror from '~components/code-mirror';
|
import atCodeMirror from '~components/code-mirror';
|
||||||
@@ -78,6 +79,7 @@ angular
|
|||||||
.directive('atSideNavItem', sideNavItem)
|
.directive('atSideNavItem', sideNavItem)
|
||||||
.directive('atTab', tab)
|
.directive('atTab', tab)
|
||||||
.directive('atTabGroup', tabGroup)
|
.directive('atTabGroup', tabGroup)
|
||||||
|
.directive('atTag', tag)
|
||||||
.directive('atTopNavItem', topNavItem)
|
.directive('atTopNavItem', topNavItem)
|
||||||
.directive('atTruncate', truncate)
|
.directive('atTruncate', truncate)
|
||||||
.service('BaseInputController', BaseInputController)
|
.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>
|
||||||
Reference in New Issue
Block a user