mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-06-19 21:41:26 +02:00
feat(maker): admin oper can create maker group for user now, in user manager page
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
.controller('UserController', UserController);
|
||||
|
||||
UserController.$inject = ['$scope', '$state', '$window', 'Authentication', 'userResolve', 'Notification', 'NotifycationService', 'MeanTorrentConfig',
|
||||
'AdminService', 'ScoreLevelService', 'DebugConsoleService', 'TorrentGetInfoServices'];
|
||||
'AdminService', 'ScoreLevelService', 'DebugConsoleService', 'TorrentGetInfoServices', 'SideOverlay', 'MakerGroupService'];
|
||||
|
||||
function UserController($scope, $state, $window, Authentication, user, Notification, NotifycationService, MeanTorrentConfig,
|
||||
AdminService, ScoreLevelService, mtDebug, TorrentGetInfoServices) {
|
||||
AdminService, ScoreLevelService, mtDebug, TorrentGetInfoServices, SideOverlay, MakerGroupService) {
|
||||
var vm = this;
|
||||
vm.TGI = TorrentGetInfoServices;
|
||||
vm.authentication = Authentication;
|
||||
@@ -26,6 +26,7 @@
|
||||
vm.scoreLevelData = ScoreLevelService.getScoreLevelJson(vm.user.score);
|
||||
|
||||
vm.searchTags = [];
|
||||
vm.maker = {};
|
||||
|
||||
vm.setUserScorePopover = {
|
||||
title: 'SCORE_TITLE',
|
||||
@@ -45,6 +46,7 @@
|
||||
isOpen: false
|
||||
};
|
||||
|
||||
mtDebug.info(vm.user);
|
||||
/**
|
||||
* remove
|
||||
* @param user
|
||||
@@ -151,6 +153,51 @@
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* showMakerGroup
|
||||
* @param evt
|
||||
*/
|
||||
vm.showMakerGroup = function (evt) {
|
||||
vm.maker = {};
|
||||
SideOverlay.open(evt, 'makerSlide');
|
||||
};
|
||||
|
||||
/**
|
||||
* hideTagsPopup
|
||||
*/
|
||||
vm.hideMakerPopup = function () {
|
||||
SideOverlay.close(null, 'makerSlide');
|
||||
};
|
||||
|
||||
/**
|
||||
* createMakerGroup
|
||||
*/
|
||||
vm.createMakerGroup = function () {
|
||||
vm.maker.userId = vm.user._id;
|
||||
var maker = new MakerGroupService(vm.maker);
|
||||
|
||||
mtDebug.info(maker);
|
||||
|
||||
maker.$save(function (response) {
|
||||
successCallback(response);
|
||||
}, function (errorResponse) {
|
||||
errorCallback(errorResponse);
|
||||
});
|
||||
|
||||
function successCallback(res) {
|
||||
vm.maker = {};
|
||||
vm.user = res;
|
||||
NotifycationService.showSuccessNotify('ABOUT.MAKER_CREATE_SUCCESSFULLY');
|
||||
SideOverlay.close(null, 'makerSlide');
|
||||
}
|
||||
|
||||
function errorCallback(res) {
|
||||
vm.maker = {};
|
||||
NotifycationService.showErrorNotify(res.data.message, 'ABOUT.MAKER_CREATE_FAILED');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* onUserRoleChanged
|
||||
* admin set user`s role
|
||||
|
||||
Reference in New Issue
Block a user