mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-15 11:52:23 +01:00
36 lines
924 B
JavaScript
36 lines
924 B
JavaScript
(function () {
|
|
'use strict';
|
|
|
|
angular
|
|
.module('users')
|
|
.controller('UserInfoController', UserInfoController);
|
|
|
|
UserInfoController.$inject = ['$scope', '$state', 'Authentication', 'userResolve', 'ScoreLevelService', '$timeout'];
|
|
|
|
function UserInfoController($scope, $state, Authentication, user, ScoreLevelService, $timeout) {
|
|
var vm = this;
|
|
|
|
vm.authentication = Authentication;
|
|
vm.user = user;
|
|
vm.messageTo = messageTo;
|
|
vm.isContextUserSelf = isContextUserSelf;
|
|
vm.scoreLevelData = ScoreLevelService.getScoreLevelJson(vm.user.score);
|
|
|
|
/**
|
|
* messageTo
|
|
*/
|
|
function messageTo() {
|
|
var to = vm.user._id + '|' + vm.user.username;
|
|
$state.go('messages.send', {to: to});
|
|
}
|
|
|
|
/**
|
|
* isContextUserSelf
|
|
* @returns {boolean}
|
|
*/
|
|
function isContextUserSelf() {
|
|
return vm.user.username === vm.authentication.user.username;
|
|
}
|
|
}
|
|
}());
|