From 9046f0e41f8abbef4c29973b68f6430b84fa2c57 Mon Sep 17 00:00:00 2001 From: arnaucode Date: Tue, 25 Jul 2017 22:55:36 +0200 Subject: [PATCH] added user and travel page --- README.md | 7 +++- app.js | 7 +++- index.html | 1 + views/main/main.html | 68 ++++++++++---------------------- views/main/main.js | 25 +++++++++++- views/navbar.html | 2 +- views/travel/travel.html | 77 ++++++++++++++++++++++++++++++++++++ views/travel/travel.js | 23 +++++++++++ views/user/user.html | 85 +++++++++++++++++++++++++++++++++++++--- views/user/user.js | 15 +++++-- 10 files changed, 250 insertions(+), 60 deletions(-) create mode 100644 views/travel/travel.html create mode 100644 views/travel/travel.js diff --git a/README.md b/README.md index 26cc568..804867f 100644 --- a/README.md +++ b/README.md @@ -1 +1,6 @@ -# carsincommonAdminWeb \ No newline at end of file +# carsincommonAdminWeb + +- server code: https://github.com/arnaucode/carsincommonServer +- frontend app code: https://github.com/arnaucode/carsincommonApp +- images server: https://github.com/arnaucode/goImgServer +- admin web: https://github.com/arnaucode/carsincommonAdminWeb diff --git a/app.js b/app.js index 4a86991..becb30e 100644 --- a/app.js +++ b/app.js @@ -1,12 +1,17 @@ 'use strict'; +var urlapi = "http://localhost:3000/api/"; +//var urlapi = "http://192.168.1.36:3000/api/"; +//var urlapi = "http://51.255.193.106:3000/api/"; + // Declare app level module which depends on views, and components angular.module('adminApp', [ 'ngRoute', 'ngMessages', 'angularBootstrapMaterial', 'app.main', - 'app.user' + 'app.user', + 'app.travel' ]). config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { $locationProvider.hashPrefix('!'); diff --git a/index.html b/index.html index 5e8cf62..d76e1ca 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,7 @@ + diff --git a/views/main/main.html b/views/main/main.html index 29166cf..99453b4 100644 --- a/views/main/main.html +++ b/views/main/main.html @@ -10,39 +10,17 @@

See all
@@ -58,30 +36,26 @@ - - + + + + - - - - - - - - - - - - - - - - - + + + + + + +
FromToTypeTitleDate User nºJoins
GreecePortugalUser12
ParisRomaUser23
MadridDublinUser11
{{travel.type}}{{travel.title}}{{travel.date | date}} + + {{travel.user.username}} + + {{travel.joins.length}}View
diff --git a/views/main/main.js b/views/main/main.js index 513a742..86bcdfd 100644 --- a/views/main/main.js +++ b/views/main/main.js @@ -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'); + }); +}); diff --git a/views/navbar.html b/views/navbar.html index 264ec3d..2d6ef0e 100644 --- a/views/navbar.html +++ b/views/navbar.html @@ -7,7 +7,7 @@ - Admin Dashboard + Admin Dashboard