33var module = angular . module ( 'supportAdminApp' ) ;
44
55module . controller ( 'users.UserSearchController' , [
6- '$log' , '$scope' , '$rootScope' , '$timeout' , '$state' , '$modal' , 'AuthService' , 'UserService' , 'Alert' ,
7- function ( $log , $scope , $rootScope , $timeout , $state , $modal , $authService , $userService , $alert ) {
6+ '$log' , '$scope' , '$rootScope' , '$timeout' , '$state' , '$modal' , 'AuthService' , 'UserService' , 'Alert' , 'users.Constants' , 'API_URL ',
7+ function ( $log , $scope , $rootScope , $timeout , $state , $modal , $authService , $userService , $alert , $const , API_URL ) {
88
99 // footable
1010 angular . element ( document ) . ready ( function ( ) {
@@ -72,31 +72,31 @@ module.controller('users.UserSearchController', [
7272 $scope . formSearch . setLoading ( false ) ;
7373 $timeout ( function ( ) {
7474 $ ( '.footable' ) . trigger ( 'footable_redraw' ) ;
75- } , 100 ) ;
75+ } , 100 ) ;
7676 } ,
7777 function ( error ) {
7878 $alert . error ( error . error , $scope ) ;
7979 $scope . formSearch . setLoading ( false ) ;
8080 }
8181 ) ;
8282 } ;
83-
83+
8484 // list
8585 $scope . users = [ ] ;
8686
87- $scope . format = function ( isoDateText ) {
88- return isoDateText && isoDateText . replace ( "T" , " " ) . replace ( ".000Z" , "" ) ;
89- } ;
87+ // tooltip for activation link copy
88+ $scope . tooltip = {
89+ message : $const . MSG_CLIPBORD_TOOLTIP ,
9090
91- var statusLabels = {
92- 'A' : 'Active' ,
93- 'U' : 'Unverified' ,
94- '4' : 'Deactivated(User request)' ,
95- '5' : 'Deactivated(Duplicate account)' ,
96- '6' : 'Deactivated(Cheating account)'
97- } ;
98- $ scope. statusLabel = function ( status ) {
99- return statusLabels [ status ] || 'Unknown' ;
91+ success : function ( ) {
92+ this . message = $const . MSG_CLIPBOARD_COPIED ;
93+ } ,
94+ fail : function ( err ) {
95+ $log . debug ( err ) ;
96+ } ,
97+ reset : function ( ) {
98+ $timeout ( function ( ) { $ scope. tooltip . message = $const . MSG_CLIPBORD_TOOLTIP ; } , 250 ) ;
99+ }
100100 } ;
101101
102102 $scope . activate = function ( index ) {
@@ -123,9 +123,6 @@ module.controller('users.UserSearchController', [
123123 } ;
124124
125125 $scope . openDeactivateDialog = function ( index ) {
126- var user = $scope . users [ index ] ;
127-
128- //if(window.confirm('Are you sure you want to deactivate user \'' + user.handle + '\'?')) {
129126 var modalInstance = $modal . open ( {
130127 size : 'sm' ,
131128 templateUrl : 'app/users/status-update-dialog.html' ,
@@ -234,8 +231,8 @@ module.controller('users.UserEditDialogController', [
234231] ) ;
235232
236233module . controller ( 'users.StatusUpdateDialogController' , [
237- '$scope' , '$rootScope' , '$timeout' , '$state' , '$modalInstance' , 'AuthService' , 'UserService' , 'Alert' , 'user' ,
238- function ( $scope , $rootScope , $timeout , $state , $modalInstance , $authService , $userService , $alert , user ) {
234+ '$scope' , '$rootScope' , '$timeout' , '$state' , '$modalInstance' , 'AuthService' , 'UserService' , 'users.Constants' , ' Alert', 'user' ,
235+ function ( $scope , $rootScope , $timeout , $state , $modalInstance , $authService , $userService , $const , $ alert, user ) {
239236
240237 $scope . form = {
241238 status : user . status ,
0 commit comments