-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ThieryMichel
committed
Mar 30, 2015
1 parent
59714bc
commit deb8f57
Showing
9 changed files
with
141 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/javascripts/ng-admin/Crud/batchDelete/BatchDeleteController.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*global define*/ | ||
|
||
define(function () { | ||
'use strict'; | ||
|
||
var BatchDeleteController = function ($scope, $stateParams, $filter, $anchorScroll, progression, view) { | ||
this.$scope = $scope; | ||
this.$stateParams = $stateParams; | ||
this.$filter = $filter; | ||
this.progression = progression; | ||
this.view = view; | ||
this.entity = view.getEntity(); | ||
this.selection = $stateParams.selection; | ||
this.title = view.title(); | ||
this.description = view.description(); | ||
this.actions = view.actions(); | ||
this.loadingPage = false; | ||
this.fields = this.$filter('orderElement')(view.fields()); | ||
|
||
$scope.$on('$destroy', this.destroy.bind(this)); | ||
}; | ||
|
||
BatchDeleteController.prototype.destroy = function () { | ||
this.$scope = undefined; | ||
this.$stateParams = undefined; | ||
this.$filter = undefined; | ||
this.$anchorScroll = undefined; | ||
}; | ||
|
||
BatchDeleteController.$inject = ['$scope', '$stateParams', '$filter', '$anchorScroll', 'progression', 'view']; | ||
|
||
return BatchDeleteController; | ||
}); |
32 changes: 32 additions & 0 deletions
32
src/javascripts/ng-admin/Crud/batchDelete/batchDelete.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<div class="row list-header"> | ||
<div class="col-lg-12"> | ||
<ma-view-actions override="batchDeleteController.actions" selection="batchDeleteController.selection" entity="batchDeleteController.entity"> | ||
<ma-list-button entity="entity"></ma-list-button> | ||
</ma-view-actions> | ||
|
||
<ma-view-batch-actions ng-if="batchDeleteController.selection" buttons="batchDeleteController.batchActions" selection="batchDeleteController.selection"></ma-view-batch-actions> | ||
<div class="page-header"> | ||
<h1 compile="batchDeleteController.title"> | ||
Delete {{ batchDeleteController.view.entity.name() | humanize | pluralize }} | ||
</h1> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-lg-12"> | ||
<p>Are you sure ?</p> | ||
<button class="btn btn-danger" ng-click="batchDeleteController.delete()">Yes</button> | ||
<button class="btn btn-default" ng-click="batchDeleteController.back()">No</button> | ||
</div> | ||
</div> | ||
|
||
<div class="row list-view" ng-class="'ng-admin-entity-' + batchDeleteController.entity.name()"> | ||
<div class="col-lg-12"> | ||
<ma-datagrid name="{{ batchDeleteController.view.name() }}" | ||
entries="batchDeleteController.selection" | ||
fields="::batchDeleteController.fields" | ||
entity="::batchDeleteController.entity"> | ||
</ma-datagrid> | ||
</div> | ||
</div> |
30 changes: 30 additions & 0 deletions
30
src/javascripts/ng-admin/Crud/button/maBatchDeleteButton.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*global define*/ | ||
|
||
define(function () { | ||
'use strict'; | ||
|
||
function maBatchDeleteButtonDirective($state) { | ||
return { | ||
restrict: 'E', | ||
scope: { | ||
'entity': '&', | ||
'selection': '&', | ||
}, | ||
link: function ($scope) { | ||
$scope.gotoBatchDelete = function () { | ||
var entity = $scope.entity(); | ||
$state.go('batchDelete', {selection: $scope.selection(), entity: entity.name()}); | ||
}; | ||
}, | ||
template: | ||
'<a ng-click="gotoBatchDelete()">' + | ||
'<span class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete' + | ||
'</a>' | ||
|
||
}; | ||
} | ||
|
||
maBatchDeleteButtonDirective.$inject = ['$state']; | ||
|
||
return maBatchDeleteButtonDirective; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import View from './View'; | ||
|
||
class BatchDeleteView extends View { | ||
constructor(name) { | ||
super(name); | ||
|
||
this._type = 'BatchDeleteView'; | ||
} | ||
} | ||
|
||
export default BatchDeleteView; |