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:
@@ -12,7 +12,10 @@
|
||||
<img class="circle" ng-src="{{user.avatar}}" alt="icon">
|
||||
</div>
|
||||
<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.travels.length}} published travels</p>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<li><a href="javascript:void(0)">Separated link</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a ng-click="logout()">Logout</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@ angular.module('app.navbar', ['ngRoute'])
|
||||
}])
|
||||
|
||||
.controller('NavbarCtrl', function($scope, $http, $routeParams, $location) {
|
||||
$scope.searchString="";
|
||||
$scope.searchString = "";
|
||||
$scope.locationHash = $location.path();
|
||||
console.log($scope.locationHash);
|
||||
$scope.goBack = function() {
|
||||
@@ -20,6 +20,11 @@ angular.module('app.navbar', ['ngRoute'])
|
||||
|
||||
$scope.search = function() {
|
||||
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">
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
@@ -98,6 +101,8 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<!--<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>
|
||||
</div>
|
||||
|
||||
@@ -46,4 +46,32 @@ angular.module('app.user', ['ngRoute'])
|
||||
// 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