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 @@
- -
-
-
- icon -
-
-

User 2

- -

Maecenas sed diam eget risus varius blandit.

-
-
-
-
-
- icon -
-
-

User 3

- -

Maecenas sed diam eget risus varius blandit.

-
-
-
+
+

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