From 1c90d841bbb43bf3a9b48ef3a4f81db72e067b4d Mon Sep 17 00:00:00 2001
From: arnaucode
Date: Tue, 31 Jan 2017 18:19:17 +0100
Subject: [PATCH] user travels visualization and other updates
---
www/css/style.css | 4 +++
www/index.html | 1 +
www/js/app.js | 10 ++++++++
www/js/menu.js | 4 +--
www/js/userTravels.js | 23 +++++++++++++++++
www/templates/login.html | 11 ++++++--
www/templates/user.html | 8 +++---
www/templates/userTravels.html | 46 ++++++++++++++++++++++++++++++++++
8 files changed, 99 insertions(+), 8 deletions(-)
create mode 100644 www/js/userTravels.js
create mode 100644 www/templates/userTravels.html
diff --git a/www/css/style.css b/www/css/style.css
index 8164b0e..d4b0ac1 100644
--- a/www/css/style.css
+++ b/www/css/style.css
@@ -60,6 +60,10 @@
font-weight: bold;
margin: 10%;
}
+.o_signupLink{
+ text-decoration: none;
+ color: #ffffff;
+}
.o_transparentBackground{
background: rgba(255, 255, 255, 0);
color: #ffffff;
diff --git a/www/index.html b/www/index.html
index b846f4d..0c157e7 100644
--- a/www/index.html
+++ b/www/index.html
@@ -54,6 +54,7 @@
-->
+
diff --git a/www/js/app.js b/www/js/app.js
index 2012b4f..ab47441 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -30,6 +30,7 @@ angular.module('starter', [
'app.askPackage',*/
'app.users',
'app.user',
+ 'app.userTravels',
'app.editUser',
'app.notifications',
'app.settings',
@@ -153,6 +154,15 @@ angular.module('starter', [
}
}
})
+ .state('app.userTravels', {
+ url: '/users/userTravels/:userid',
+ views: {
+ 'menuContent': {
+ templateUrl: 'templates/userTravels.html',
+ controller: 'UserTravelsCtrl'
+ }
+ }
+ })
.state('app.editUser', {
url: '/editUser',
views: {
diff --git a/www/js/menu.js b/www/js/menu.js
index bc0eab6..c3052dc 100644
--- a/www/js/menu.js
+++ b/www/js/menu.js
@@ -1,7 +1,7 @@
angular.module('app.menu', ['pascalprecht.translate'])
- .controller('MenuCtrl', function($scope) {
+ .controller('MenuCtrl', function($scope, $window) {
if (localStorage.getItem("cim_app_userdata")) {
$scope.storageuser = JSON.parse(localStorage.getItem("cim_app_userdata"));
console.log($scope.storageuser);
@@ -10,6 +10,6 @@ angular.module('app.menu', ['pascalprecht.translate'])
$scope.logout = function() {
localStorage.removeItem("cim_app_token");
localStorage.removeItem("cim_app_userdata");
- window.location = "/";
+ $window.location.reload(true);
};
});
diff --git a/www/js/userTravels.js b/www/js/userTravels.js
new file mode 100644
index 0000000..034d039
--- /dev/null
+++ b/www/js/userTravels.js
@@ -0,0 +1,23 @@
+angular.module('app.userTravels', ['pascalprecht.translate'])
+
+.controller('UserTravelsCtrl', function($scope, $http, $ionicModal,
+ $timeout, $ionicLoading, $filter, $stateParams) {
+
+ $scope.storageuser = JSON.parse(localStorage.getItem("cim_app_userdata"));
+ $scope.travels=[];
+ $scope.joins=[];
+ $scope.doRefresh = function(){
+ $http.get(urlapi + 'users/id/travels/'+$stateParams.userid)
+ .then(function(data, status, headers,config){
+ console.log('data success');
+ console.log(data);
+ $scope.travels = data.data.travels;
+ $scope.joins = data.data.joins;
+ $scope.$broadcast('scroll.refreshComplete');//refresher stop
+ },function(data, status, headers,config){
+ console.log('data error');
+ $scope.$broadcast('scroll.refreshComplete');//refresher stop
+ });
+ };
+ $scope.doRefresh();
+});
diff --git a/www/templates/login.html b/www/templates/login.html
index 71666c2..1d09bfe 100644
--- a/www/templates/login.html
+++ b/www/templates/login.html
@@ -23,17 +23,24 @@
{{'LOG IN' | translate}}
+
+
+
+
+ Not account yet? {{'Create one' | translate}}
+
+
+
+ -->
diff --git a/www/templates/user.html b/www/templates/user.html
index fc3f7d5..6b27f4c 100644
--- a/www/templates/user.html
+++ b/www/templates/user.html
@@ -20,13 +20,13 @@
@{{user.telegram}}
-
+
{{user.travels.length}} Travels
- {{user.favs.length}} favs
+ {{user.favs.length}} favs
(not yet)
@@ -47,7 +47,7 @@
-
+
diff --git a/www/templates/userTravels.html b/www/templates/userTravels.html
new file mode 100644
index 0000000..b8b7a32
--- /dev/null
+++ b/www/templates/userTravels.html
@@ -0,0 +1,46 @@
+
+
+