2013-11-06 23:49:41 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
2013-11-16 03:25:16 +00:00
|
|
|
habitrpg.controller("AdminCtrl", ['$scope', '$rootScope', 'User', 'Notification', 'API_URL', '$resource',
|
|
|
|
|
function($scope, $rootScope, User, Notification, API_URL, $resource) {
|
|
|
|
|
var Contributor = $resource(API_URL + '/api/v1/admin/members/:uid', {uid:'@_id'});
|
|
|
|
|
|
2013-11-06 23:49:41 +00:00
|
|
|
$scope.profile = undefined;
|
|
|
|
|
$scope.loadUser = function(uuid){
|
2013-11-16 03:25:16 +00:00
|
|
|
$scope.profile = Contributor.get({uid:uuid});
|
2013-11-06 23:49:41 +00:00
|
|
|
}
|
|
|
|
|
$scope.save = function(profile) {
|
|
|
|
|
profile.$save(function(){
|
|
|
|
|
Notification.text("User updated");
|
|
|
|
|
$scope.profile = undefined;
|
|
|
|
|
$scope._uuid = undefined;
|
2013-11-16 04:06:18 +00:00
|
|
|
$scope.contributors = Contributor.query();
|
2013-11-06 23:49:41 +00:00
|
|
|
})
|
|
|
|
|
}
|
2013-11-16 03:25:16 +00:00
|
|
|
$scope.contributors = Contributor.query();
|
2013-11-06 23:49:41 +00:00
|
|
|
}])
|