mirror of
https://github.com/arnaucube/commonroutesAdminWeb.git
synced 2026-02-07 03:06:44 +01:00
added accounts verification system
This commit is contained in:
4
app.js
4
app.js
@@ -1,8 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var urlapi = "http://localhost:3000/api/";
|
//var urlapi = "http://localhost:3000/api/";
|
||||||
//var urlapi = "http://192.168.1.36:3000/api/";
|
//var urlapi = "http://192.168.1.36:3000/api/";
|
||||||
//var urlapi = "http://37.59.123.45:3000/api/";
|
var urlapi = "http://37.59.123.45:3000/api/";
|
||||||
|
|
||||||
// Declare app level module which depends on views, and components
|
// Declare app level module which depends on views, and components
|
||||||
angular.module('adminApp', [
|
angular.module('adminApp', [
|
||||||
|
|||||||
@@ -12,7 +12,10 @@
|
|||||||
<img class="circle" ng-src="{{user.avatar}}" alt="icon">
|
<img class="circle" ng-src="{{user.avatar}}" alt="icon">
|
||||||
</div>
|
</div>
|
||||||
<div class="row-content">
|
<div class="row-content">
|
||||||
<h4 class="list-group-item-heading">{{user.username}}</h4>
|
<h4 class="list-group-item-heading">
|
||||||
|
{{user.username}}
|
||||||
|
<span ng-show="user.validated" class="badge badge-secondary c_deepPurple300">Validated</span>
|
||||||
|
</h4>
|
||||||
|
|
||||||
<p class="list-group-item-text">{{user.description}}</p>
|
<p class="list-group-item-text">{{user.description}}</p>
|
||||||
<p class="list-group-item-text">{{user.travels.length}} published travels</p>
|
<p class="list-group-item-text">{{user.travels.length}} published travels</p>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
<li><a href="javascript:void(0)">Separated link</a></li>
|
<li><a href="javascript:void(0)">Separated link</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li><a ng-click="logout()">Logout</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ angular.module('app.navbar', ['ngRoute'])
|
|||||||
}])
|
}])
|
||||||
|
|
||||||
.controller('NavbarCtrl', function($scope, $http, $routeParams, $location) {
|
.controller('NavbarCtrl', function($scope, $http, $routeParams, $location) {
|
||||||
$scope.searchString="";
|
$scope.searchString = "";
|
||||||
$scope.locationHash = $location.path();
|
$scope.locationHash = $location.path();
|
||||||
console.log($scope.locationHash);
|
console.log($scope.locationHash);
|
||||||
$scope.goBack = function() {
|
$scope.goBack = function() {
|
||||||
@@ -20,6 +20,11 @@ angular.module('app.navbar', ['ngRoute'])
|
|||||||
|
|
||||||
$scope.search = function() {
|
$scope.search = function() {
|
||||||
console.log($scope.searchString);
|
console.log($scope.searchString);
|
||||||
window.location.href="#!/search/" + $scope.searchString;
|
window.location.href = "#!/search/" + $scope.searchString;
|
||||||
|
};
|
||||||
|
$scope.logout = function() {
|
||||||
|
localStorage.removeItem("cic_admin_token");
|
||||||
|
localStorage.removeItem("cic_admin_userdata");
|
||||||
|
window.location.reload();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,7 +12,10 @@
|
|||||||
<img class="circle" ng-src="{{user.avatar}}" alt="icon">
|
<img class="circle" ng-src="{{user.avatar}}" alt="icon">
|
||||||
</div>
|
</div>
|
||||||
<div class="row-content">
|
<div class="row-content">
|
||||||
<h4 class="list-group-item-heading">{{user.username}}</h4>
|
<h4 class="list-group-item-heading">
|
||||||
|
{{user.username}}
|
||||||
|
<span ng-show="user.validated" class="badge badge-secondary c_deepPurple300">Validated</span>
|
||||||
|
</h4>
|
||||||
|
|
||||||
<p class="list-group-item-text">{{user.description}}</p>
|
<p class="list-group-item-text">{{user.description}}</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -98,6 +101,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<!--<div class="btn btn-block btn-sm c_orange300">Ban user</div>-->
|
<!--<div class="btn btn-block btn-sm c_orange300">Ban user</div>-->
|
||||||
|
<div ng-show="!user.validated" ng-click="validateUser()" class="btn btn-block btn-sm c_deepPurple300">Validate User</div>
|
||||||
|
<div ng-show="user.validated" ng-click="unvalidateUser()" class="btn btn-block btn-sm c_red200">Unvalidate User</div>
|
||||||
<div ng-click="deleteUser()" class="btn btn-block btn-sm c_red300">Delete user</div>
|
<div ng-click="deleteUser()" class="btn btn-block btn-sm c_red300">Delete user</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -46,4 +46,32 @@ angular.module('app.user', ['ngRoute'])
|
|||||||
// failed
|
// failed
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
$scope.validateUser = function() {
|
||||||
|
$http({
|
||||||
|
url: urlapi + 'admin/users/validate/id/' + $routeParams.userid,
|
||||||
|
method: "POST",
|
||||||
|
data: {}
|
||||||
|
})
|
||||||
|
.then(function(data) {
|
||||||
|
/*window.location = "#!/main/";*/
|
||||||
|
$scope.user = data.data;
|
||||||
|
},
|
||||||
|
function(data) { // optional
|
||||||
|
// failed
|
||||||
|
});
|
||||||
|
};
|
||||||
|
$scope.unvalidateUser = function() {
|
||||||
|
$http({
|
||||||
|
url: urlapi + 'admin/users/unvalidate/id/' + $routeParams.userid,
|
||||||
|
method: "POST",
|
||||||
|
data: {}
|
||||||
|
})
|
||||||
|
.then(function(data) {
|
||||||
|
/*window.location = "#!/main/";*/
|
||||||
|
$scope.user = data.data;
|
||||||
|
},
|
||||||
|
function(data) { // optional
|
||||||
|
// failed
|
||||||
|
});
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user