feat(about): admin remove maker group

This commit is contained in:
OldHawk
2017-10-20 22:43:22 +08:00
parent b86931b68a
commit fea63b3518
3 changed files with 39 additions and 4 deletions

View File

@@ -7,11 +7,11 @@
AboutController.$inject = ['$scope', '$state', 'getStorageLangService', 'MeanTorrentConfig', 'AdminService', 'MakerGroupService', 'DebugConsoleService', 'marked',
'localStorageService', '$translate', '$compile', 'Authentication', 'DownloadService', 'TorrentGetInfoServices', 'ResourcesTagsServices',
'uibButtonConfig', '$window', '$timeout', 'TorrentsService'];
'uibButtonConfig', '$window', '$timeout', 'TorrentsService', 'ModalConfirmService', 'NotifycationService'];
function AboutController($scope, $state, getStorageLangService, MeanTorrentConfig, AdminService, MakerGroupService, mtDebug, marked,
localStorageService, $translate, $compile, Authentication, DownloadService, TorrentGetInfoServices, ResourcesTagsServices,
uibButtonConfig, $window, $timeout, TorrentsService) {
uibButtonConfig, $window, $timeout, TorrentsService, ModalConfirmService, NotifycationService) {
var vm = this;
vm.DLS = DownloadService;
vm.TGI = TorrentGetInfoServices;
@@ -215,6 +215,29 @@
});
};
/**
* beginRemoveMakerGroup
* @param m
*/
vm.beginRemoveMakerGroup = function (m) {
var modalOptions = {
closeButtonText: $translate.instant('ABOUT.DELETE_CONFIRM_CANCEL'),
actionButtonText: $translate.instant('ABOUT.DELETE_CONFIRM_OK'),
headerText: $translate.instant('ABOUT.DELETE_CONFIRM_HEADER_TEXT'),
bodyText: $translate.instant('ABOUT.DELETE_CONFIRM_BODY_TEXT')
};
ModalConfirmService.showModal({}, modalOptions)
.then(function (result) {
m.$remove(function (res) {
NotifycationService.showSuccessNotify('ABOUT.DELETE_SUCCESSFULLY');
$state.go('about.maker');
}, function (res) {
NotifycationService.showErrorNotify(res.data.message, 'ABOUT.DELETE_FAILED');
});
});
};
/**
* getOperList
*/

View File

@@ -482,7 +482,13 @@
BTN_REMOVE_GROUP: 'Remove Group',
MAKER_TORRENTS_LIST_ERROR: 'Maker group torrents list error',
MAKER_TORRENTS_IS_LOADING: 'Maker group torrents is loading...',
MAKER_TORRENTS_IS_EMPTY: 'No torrents of this maker group is founded!'
MAKER_TORRENTS_IS_EMPTY: 'No torrents of this maker group is founded!',
DELETE_CONFIRM_OK: 'Delete',
DELETE_CONFIRM_CANCEL: 'Cancel',
DELETE_CONFIRM_HEADER_TEXT: 'Delete Confirm',
DELETE_CONFIRM_BODY_TEXT: 'Are you sure want to delete this maker group?',
DELETE_SUCCESSFULLY: 'Maker group deleted successfully',
DELETE_FAILED: 'Maker group deleted failed'
},
//collections views

View File

@@ -482,7 +482,13 @@
BTN_REMOVE_GROUP: '删除小组',
MAKER_TORRENTS_LIST_ERROR: '小组资源获取失败',
MAKER_TORRENTS_IS_LOADING: '正在获取小组资源列表, 请稍候...',
MAKER_TORRENTS_IS_EMPTY: '没有找到该小组的种子资源!'
MAKER_TORRENTS_IS_EMPTY: '没有找到该小组的种子资源!',
DELETE_CONFIRM_OK: '删除',
DELETE_CONFIRM_CANCEL: '取消',
DELETE_CONFIRM_HEADER_TEXT: '删除确认',
DELETE_CONFIRM_BODY_TEXT: '您确定要删除这个资源压制小组?',
DELETE_SUCCESSFULLY: '资源压制小组删除成功',
DELETE_FAILED: '资源压制小组删除失败'
},
//collections views