mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-01 20:31:49 -05:00
Update project structure
This commit is contained in:
7
awx/ui/client/lib/components/action/_index.less
Normal file
7
awx/ui/client/lib/components/action/_index.less
Normal file
@@ -0,0 +1,7 @@
|
||||
.at-ActionGroup {
|
||||
margin-top: @at-space-6x;
|
||||
|
||||
button:last-child {
|
||||
margin-left: @at-space-5x;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
function atActionGroup (pathService) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
transclude: true,
|
||||
replace: true,
|
||||
templateUrl: pathService.getPartialPath('components/action/action-group'),
|
||||
scope: {
|
||||
col: '@',
|
||||
pos: '@'
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
atActionGroup.$inject = ['PathService'];
|
||||
|
||||
export default atActionGroup;
|
||||
@@ -0,0 +1,5 @@
|
||||
<div class="col-xs-{{ col }} at-ActionGroup">
|
||||
<div class="pull-{{ pos }}">
|
||||
<ng-transclude></ng-transclude>
|
||||
</div>
|
||||
</div>
|
||||
49
awx/ui/client/lib/components/action/action.directive.js
Normal file
49
awx/ui/client/lib/components/action/action.directive.js
Normal file
@@ -0,0 +1,49 @@
|
||||
let $state;
|
||||
|
||||
function applyCancelProperties (scope) {
|
||||
scope.text = scope.config.text || 'CANCEL';
|
||||
scope.fill = 'Hollow';
|
||||
scope.color = 'white';
|
||||
scope.disabled = false;
|
||||
scope.action = () => $state.go('^');
|
||||
}
|
||||
|
||||
function applySaveProperties (scope) {
|
||||
scope.text = 'SAVE';
|
||||
scope.fill = '';
|
||||
scope.color = 'green';
|
||||
scope.disabled = true;
|
||||
}
|
||||
|
||||
function link (scope, el, attrs, form) {
|
||||
form.use('action', scope, el);
|
||||
|
||||
switch(scope.config.type) {
|
||||
case 'cancel':
|
||||
applyCancelProperties(scope);
|
||||
break;
|
||||
case 'save':
|
||||
applySaveProperties(scope);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function atFormAction (_$state_, pathService) {
|
||||
$state = _$state_;
|
||||
|
||||
return {
|
||||
restrict: 'E',
|
||||
transclude: true,
|
||||
replace: true,
|
||||
require: '^^at-form',
|
||||
templateUrl: pathService.getPartialPath('components/action/action'),
|
||||
link,
|
||||
scope: {
|
||||
config: '='
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
atFormAction.$inject = ['$state', 'PathService'];
|
||||
|
||||
export default atFormAction;
|
||||
4
awx/ui/client/lib/components/action/action.partial.html
Normal file
4
awx/ui/client/lib/components/action/action.partial.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<button class="btn at-Button{{ fill }}--{{ color }}" ng-disabled="disabled"
|
||||
ng-class="{ 'at-Button--disabled': disabled }" ng-click="action()">
|
||||
{{ text }}
|
||||
</button>
|
||||
Reference in New Issue
Block a user