From bb79275133e7a6dbcc7f9541c61fe24e20de4ebb Mon Sep 17 00:00:00 2001 From: arnaucode Date: Fri, 28 Jul 2017 22:28:19 +0200 Subject: [PATCH] added search (users and travels), added user network, added all travels visualization --- app.js | 5 +- index.html | 3 + views/main/main.js | 55 +++++++++-------- views/navbar.html | 8 ++- views/navbar.js | 6 ++ views/network/network.js | 32 ++++++++-- views/search/search.html | 74 ++++++++++++++++++++++ views/search/search.js | 28 +++++++++ views/travels/travels.html | 54 ++++++++++++++++ views/travels/travels.js | 73 ++++++++++++++++++++++ views/userNetwork/userNetwork.html | 36 +++++++++++ views/userNetwork/userNetwork.js | 98 ++++++++++++++++++++++++++++++ 12 files changed, 436 insertions(+), 36 deletions(-) create mode 100644 views/search/search.html create mode 100644 views/search/search.js create mode 100644 views/travels/travels.html create mode 100644 views/travels/travels.js create mode 100644 views/userNetwork/userNetwork.html create mode 100644 views/userNetwork/userNetwork.js diff --git a/app.js b/app.js index 4731241..4259168 100644 --- a/app.js +++ b/app.js @@ -12,9 +12,12 @@ angular.module('adminApp', [ 'app.navbar', 'app.login', 'app.main', + 'app.search', + 'app.travels', 'app.user', 'app.travel', - 'app.network' + 'app.network', + 'app.userNetwork' ]). config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { $locationProvider.hashPrefix('!'); diff --git a/index.html b/index.html index fbbfb92..7d3ee55 100644 --- a/index.html +++ b/index.html @@ -66,9 +66,12 @@ + + + diff --git a/views/main/main.js b/views/main/main.js index 86bcdfd..4f85af4 100644 --- a/views/main/main.js +++ b/views/main/main.js @@ -2,34 +2,35 @@ angular.module('app.main', ['ngRoute']) -.config(['$routeProvider', function($routeProvider) { - $routeProvider.when('/main', { - templateUrl: 'views/main/main.html', - controller: 'MainCtrl' - }); -}]) + .config(['$routeProvider', function($routeProvider) { + $routeProvider.when('/main', { + templateUrl: 'views/main/main.html', + controller: 'MainCtrl' + }); + }]) -.controller('MainCtrl', function($scope, $http) { - $scope.users = []; - $scope.loadMorePagination = true; - $scope.page = 0; + .controller('MainCtrl', function($scope, $http) { + $scope.users = []; + $scope.travels = []; + $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; + $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'); + }); + $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'); - }); -}); + }, function(data) { + console.log('data error'); + }); + }); diff --git a/views/navbar.html b/views/navbar.html index 30ed14d..25d0928 100644 --- a/views/navbar.html +++ b/views/navbar.html @@ -12,11 +12,13 @@