mirror of
https://github.com/arnaucube/commonroutesAdminWeb.git
synced 2026-02-07 11:16:44 +01:00
added user and travel page
This commit is contained in:
@@ -10,39 +10,17 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="list-group">
|
||||
<div class="list-group-item">
|
||||
<a ng-repeat="user in users" ng-href="#!/user/{{user._id}}" class="list-group-item">
|
||||
<div class="row-picture">
|
||||
<img class="circle" src="http://lorempixel.com/56/56/people/2" alt="icon">
|
||||
<img class="circle" ng-src="{{user.avatar}}" alt="icon">
|
||||
</div>
|
||||
<div class="row-content">
|
||||
<h4 class="list-group-item-heading">User 1</h4>
|
||||
<h4 class="list-group-item-heading">{{user.username}}</h4>
|
||||
|
||||
<p class="list-group-item-text">Donec id elit non mi porta gravida at eget metus</p>
|
||||
<p class="list-group-item-text">{{user.description}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group-separator"></div>
|
||||
<div class="list-group-item">
|
||||
<div class="row-picture">
|
||||
<img class="circle" src="http://lorempixel.com/56/56/people/5" alt="icon">
|
||||
</div>
|
||||
<div class="row-content">
|
||||
<h4 class="list-group-item-heading">User 2</h4>
|
||||
|
||||
<p class="list-group-item-text">Maecenas sed diam eget risus varius blandit.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group-separator"></div>
|
||||
<div class="list-group-item">
|
||||
<div class="row-picture">
|
||||
<img class="circle" src="http://lorempixel.com/56/56/people/11" alt="icon">
|
||||
</div>
|
||||
<div class="row-content">
|
||||
<h4 class="list-group-item-heading">User 3</h4>
|
||||
|
||||
<p class="list-group-item-text">Maecenas sed diam eget risus varius blandit.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-group-separator"></div>
|
||||
<div class="list-group-separator"></div>
|
||||
</a>
|
||||
</div>
|
||||
<br>
|
||||
<div class="btn btn-raised c_deepPurple300">See all</div>
|
||||
@@ -58,30 +36,26 @@
|
||||
<table class="table table-striped table-hover ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>From</th>
|
||||
<th>To</th>
|
||||
<th>Type</th>
|
||||
<th>Title</th>
|
||||
<th>Date</th>
|
||||
<th>User</th>
|
||||
<th>nºJoins</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Greece</td>
|
||||
<td>Portugal</td>
|
||||
<td>User1</td>
|
||||
<td>2</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Paris</td>
|
||||
<td>Roma</td>
|
||||
<td>User2</td>
|
||||
<td>3</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Madrid</td>
|
||||
<td>Dublin</td>
|
||||
<td>User1</td>
|
||||
<td>1</td>
|
||||
<tr ng-repeat="travel in travels">
|
||||
<td>{{travel.type}}</td>
|
||||
<td>{{travel.title}}</td>
|
||||
<td>{{travel.date | date}}</td>
|
||||
<td>
|
||||
<a ng-href="#!/user/{{travel.user._id}}">
|
||||
{{travel.user.username}}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{travel.joins.length}}</td>
|
||||
<td><a ng-href="#!/travel/{{travel._id}}">View</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -9,6 +9,27 @@ angular.module('app.main', ['ngRoute'])
|
||||
});
|
||||
}])
|
||||
|
||||
.controller('MainCtrl', [function() {
|
||||
.controller('MainCtrl', function($scope, $http) {
|
||||
$scope.users = [];
|
||||
$scope.loadMorePagination = true;
|
||||
$scope.page = 0;
|
||||
|
||||
}]);
|
||||
$http.get(urlapi + 'users?page=' + $scope.page)
|
||||
.then(function(data) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
$scope.users=data.data;
|
||||
|
||||
}, function(data) {
|
||||
console.log('data error');
|
||||
});
|
||||
$http.get(urlapi + 'travels?page=' + $scope.page)
|
||||
.then(function(data) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
$scope.travels=data.data;
|
||||
|
||||
}, function(data) {
|
||||
console.log('data error');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user