-

+
diff --git a/src/app/users/users.controller.js b/src/app/users/users.controller.js
index 9368938..b4a7da8 100644
--- a/src/app/users/users.controller.js
+++ b/src/app/users/users.controller.js
@@ -3,8 +3,8 @@
var module = angular.module('supportAdminApp');
module.controller('users.UserSearchController', [
- '$scope', '$rootScope', '$timeout', '$state', '$modal', 'AuthService','UserService',
- function ($scope, $rootScope, $timeout, $state, $modal, $authService, $userService) {
+ '$log', '$scope', '$rootScope', '$timeout', '$state', '$modal', 'AuthService','UserService', 'Alert',
+ function ($log, $scope, $rootScope, $timeout, $state, $modal, $authService, $userService, $alert) {
// footable
angular.element(document).ready(function () {
@@ -36,7 +36,7 @@ module.controller('users.UserSearchController', [
$scope.search = function() {
- $scope.$broadcast('alert.ClearAll', {});
+ $alert.clear();
var handle = $scope.formSearch.handle,
email = $scope.formSearch.email,
@@ -75,7 +75,7 @@ module.controller('users.UserSearchController', [
}, 100);
},
function(error) {
- $scope.$broadcast('alert.AlertIssued', {type:'danger', message:error.error});
+ $alert.error(error.error, $scope);
$scope.formSearch.setLoading(false);
}
);
@@ -100,11 +100,10 @@ module.controller('users.UserSearchController', [
};
$scope.activate = function(index) {
- $scope.$broadcast('alert.ClearAll', {});
+ $alert.clear();
var user = $scope.users[index];
if(!user.credential || !user.credential.activationCode) {
- $scope.$broadcast('alert.AlertIssued',
- {type:'danger', message:'The user \'' + user.handle + '\' is invalid. Unable to activate it.'});
+ $alert.error('The user \'' + user.handle + '\' is invalid. Unable to activate it.', $scope);
return;
};
if(window.confirm('Are you sure you want to activate user \'' + user.handle + '\'?')) {
@@ -116,7 +115,7 @@ module.controller('users.UserSearchController', [
$scope.formSearch.setLoading(false);
},
function(error) {
- $scope.$broadcast('alert.AlertIssued', {type:'danger', message:error.error});
+ $alert.error(error.error, $scope);
$scope.formSearch.setLoading(false);
}
);
@@ -163,8 +162,8 @@ module.controller('users.UserSearchController', [
]);
module.controller('users.UserEditDialogController', [
- '$scope', '$rootScope', '$timeout', '$state', '$modalInstance', 'AuthService', 'UserService', 'user',
- function ($scope, $rootScope, $timeout, $state, $modalInstance, $authService, $userService, user) {
+ '$scope', '$rootScope', '$timeout', '$state', '$modalInstance', 'AuthService', 'UserService', 'Alert', 'user',
+ function ($scope, $rootScope, $timeout, $state, $modalInstance, $authService, $userService, $alert, user) {
$scope.user = user;
@@ -186,9 +185,9 @@ module.controller('users.UserEditDialogController', [
};
$scope.saveHandle = function() {
- $scope.$broadcast('alert.ClearAll', {});
+ $alert.clear();
if(user.handle === $scope.form.handle) {
- $scope.$broadcast('alert.AlertIssued', {type:'danger', message:'Handle is not changed.'});
+ $alert.error('Handle is not changed.', $scope);
return;
}
@@ -201,7 +200,7 @@ module.controller('users.UserEditDialogController', [
$modalInstance.close();
},
function(error) {
- $scope.$broadcast('alert.AlertIssued', {type:'danger', message:error.error});
+ $alert.error(error.error, $scope);
$scope.form.setLoading(false);
}
);
@@ -209,9 +208,9 @@ module.controller('users.UserEditDialogController', [
};
$scope.saveEmail = function() {
- $scope.$broadcast('alert.ClearAll', {});
+ $alert.clear();
if(user.email.toLowerCase() === $scope.form.email.toLowerCase()) {
- $scope.$broadcast('alert.AlertIssued', {type:'danger', message:'Email is not changed.'});
+ $alert.error('Email is not changed.', $scope);
return;
}
@@ -224,7 +223,7 @@ module.controller('users.UserEditDialogController', [
$modalInstance.close();
},
function(error) {
- $scope.$broadcast('alert.AlertIssued', {type:'danger', message:error.error});
+ $alert.error(error.error, $scope);
$scope.form.setLoading(false);
}
);
@@ -235,8 +234,8 @@ module.controller('users.UserEditDialogController', [
]);
module.controller('users.StatusUpdateDialogController', [
- '$scope', '$rootScope', '$timeout', '$state', '$modalInstance', 'AuthService', 'UserService', 'user',
- function ($scope, $rootScope, $timeout, $state, $modalInstance, $authService, $userService, user) {
+ '$scope', '$rootScope', '$timeout', '$state', '$modalInstance', 'AuthService', 'UserService', 'Alert', 'user',
+ function ($scope, $rootScope, $timeout, $state, $modalInstance, $authService, $userService, $alert, user) {
$scope.form = {
status : user.status,
@@ -252,9 +251,9 @@ module.controller('users.StatusUpdateDialogController', [
};
$scope.save = function() {
- $scope.$broadcast('alert.ClearAll', {});
+ $alert.clear();
if(user.status === $scope.form.status) {
- $scope.$broadcast('alert.AlertIssued', {type:'danger', message:'Status is not changed.'});
+ $alert.error('Status is not changed.', $scope);
return;
}
if(window.confirm('Are you sure you want to save changes?')) {
@@ -267,7 +266,7 @@ module.controller('users.StatusUpdateDialogController', [
$modalInstance.close();
},
function(error) {
- $scope.$broadcast('alert.AlertIssued', {type:'danger', message:error.error});
+ $alert.error(error.error, $scope);
$scope.form.setLoading(false);
}
);
diff --git a/src/app/users/users.service.js b/src/app/users/users.service.js
index f036d14..98b3838 100644
--- a/src/app/users/users.service.js
+++ b/src/app/users/users.service.js
@@ -1,8 +1,8 @@
'use strict';
angular.module('supportAdminApp')
- .factory('UserService', ['$q','$http', 'API_URL',
- function ($q, $http, API_URL) {
+ .factory('UserService', ['$log', '$q','$http', 'API_URL',
+ function ($log, $q, $http, API_URL) {
// local dev
//var API_URL = 'http://local.topcoder-dev.com:8080';
return ({
@@ -23,11 +23,11 @@ angular.module('supportAdminApp')
return request.then(
function(response) {
- console.log(response);
+ $log.debug(response);
return response.data.result.content;
},
function(error) {
- console.log(error);
+ $log.error(error);
var err;
if(error && error.data && error.data.result) {
err = {
@@ -71,11 +71,11 @@ angular.module('supportAdminApp')
return request.then(
function(response) {
- console.log(response);
+ $log.debug(response);
return response.data.result.content;
},
function(error) {
- console.log(error);
+ $log.error(error);
var err;
if(error && error.data && error.data.result) {
err = {
@@ -107,11 +107,11 @@ angular.module('supportAdminApp')
return request.then(
function(response) {
- console.log(response);
+ $log.debug(response);
return response.data.result.content;
},
function(error) {
- console.log(error);
+ $log.error(error);
var err;
if(error && error.data && error.data.result) {
err = {
@@ -143,11 +143,11 @@ angular.module('supportAdminApp')
return request.then(
function(response) {
- console.log(response);
+ $log.debug(response);
return response.data.result.content;
},
function(error) {
- console.log(error);
+ $log.error(error);
var err;
if(error && error.data && error.data.result) {
err = {
@@ -179,11 +179,11 @@ angular.module('supportAdminApp')
return request.then(
function(response) {
- console.log(response);
+ $log.debug(response);
return response.data.result.content;
},
function(error) {
- console.log(error);
+ $log.error(error);
var err;
if(error && error.data && error.data.result) {
err = {
@@ -217,11 +217,11 @@ angular.module('supportAdminApp')
return request.then(
function(response) {
- console.log(response);
+ $log.debug(response);
return response.data.result.content;
},
function(error) {
- console.log(error);
+ $log.error(error);
var err;
if(error && error.data && error.data.result) {
err = {
diff --git a/src/app/vendor.less b/src/app/vendor.less
index b2745f7..160d12b 100755
--- a/src/app/vendor.less
+++ b/src/app/vendor.less
@@ -7,4 +7,33 @@
// SERVE:DIST
//@icon-font-path: '/fonts/';
-//@fa-font-path: '/fonts';
\ No newline at end of file
+//@fa-font-path: '/fonts';
+
+.login-box {
+ width: 300px;
+ text-align: center;
+ background-color: #fff;
+
+ .logo-header {
+ padding: 13px;
+ border: solid 2px #fff;
+ background-color: #3e3e3e
+ }
+
+ h3 {
+ color: #4a4a4a;
+ font-weight: 200;
+ font-family: 'sofia-pro';
+ text-transform: uppercase;
+ }
+
+ form {
+ padding: 20px;
+ }
+
+ button {
+ text-transform: uppercase;
+ }
+}
+
+
diff --git a/src/components/alert/alert-simple.html b/src/components/alert/alert-simple.html
new file mode 100644
index 0000000..bf50a86
--- /dev/null
+++ b/src/components/alert/alert-simple.html
@@ -0,0 +1,5 @@
+
+
+ {{alert.message}}
+
+
diff --git a/src/components/alert/alert.html b/src/components/alert/alert.html
index 5accbcc..e888b0f 100644
--- a/src/components/alert/alert.html
+++ b/src/components/alert/alert.html
@@ -1,5 +1,5 @@
-