@ -1,5 +0,0 @@ |
|||
angular.module('app.newPublication', ['pascalprecht.translate']) |
|||
|
|||
.controller('NewPublicationCtrl', function($scope, $stateParams, $translate, $filter) { |
|||
|
|||
}); |
@ -0,0 +1,5 @@ |
|||
angular.module('app.newTravel', ['pascalprecht.translate']) |
|||
|
|||
.controller('NewTravelCtrl', function($scope, $stateParams, $translate, $filter) { |
|||
|
|||
}); |
@ -1,15 +1,21 @@ |
|||
angular.module('app.notifications', ['pascalprecht.translate']) |
|||
|
|||
.controller('NotificationsCtrl', function($scope, $stateParams, $translate, $filter) { |
|||
if(localStorage.getItem('c_token')){// adding token to the headers
|
|||
// $http.defaults.headers.common['X-Access-Token'] = localStorage.getItem('c_token');
|
|||
} |
|||
$scope.storageusername=localStorage.getItem("c_username"); |
|||
$scope.users= JSON.parse(localStorage.getItem('c_users')); |
|||
$scope.user = $filter('filter')($scope.users, {username: $stateParams.username}, true)[0]; |
|||
$scope.notifications=$scope.user.notifications; |
|||
.controller('NotificationsCtrl', function($scope, $http, $ionicLoading, |
|||
$stateParams, $translate, $filter) { |
|||
$scope.notifications=[]; |
|||
$scope.doRefresh = function(){ |
|||
$http.get(urlapi + 'notifications') |
|||
.then(function(data){ |
|||
console.log(data); // for browser console
|
|||
$scope.notifications = data.data; // for UI
|
|||
$scope.$broadcast('scroll.refreshComplete');//refresher stop
|
|||
|
|||
console.log($stateParams.username); |
|||
console.log($scope.notifications); |
|||
console.log("notifications page"); |
|||
}, function(data){ |
|||
console.log('data error'); |
|||
$scope.$broadcast('scroll.refreshComplete');//refresher stop
|
|||
$ionicLoading.show({ template: 'Error connecting server', noBackdrop: true, duration: 2000 }); |
|||
|
|||
}); |
|||
}; |
|||
$scope.doRefresh(); |
|||
}); |
@ -0,0 +1,30 @@ |
|||
angular.module('app.search', ['pascalprecht.translate']) |
|||
|
|||
.controller('SearchCtrl', function($scope, $http, $ionicModal, $timeout, $ionicLoading, $filter) { |
|||
|
|||
|
|||
$scope.users=[]; |
|||
$scope.travels=[]; |
|||
$scope.search={ |
|||
word:"" |
|||
}; |
|||
$scope.doSearch = function() { |
|||
console.log("doing search"); |
|||
console.log($scope.search.word); |
|||
/* travels refresh: */ |
|||
$http.get(urlapi + 'search/'+ $scope.search.word) |
|||
.then(function(data){ |
|||
console.log('data success travels'); |
|||
console.log(data); // for browser console
|
|||
$scope.users = data.data.users; // for UI
|
|||
$scope.travels = data.data.travels; // for UI
|
|||
$scope.$broadcast('scroll.refreshComplete');//refresher stop
|
|||
|
|||
}, function(data){ |
|||
console.log('data error'); |
|||
$scope.$broadcast('scroll.refreshComplete');//refresher stop
|
|||
$ionicLoading.show({ template: 'Error connecting server', noBackdrop: true, duration: 2000 }); |
|||
|
|||
}); |
|||
}; |
|||
}); |
@ -1,32 +1,40 @@ |
|||
<ion-view view-title="Main"> |
|||
<ion-content> |
|||
<ion-content class="has-footer"> |
|||
<a ng-href="#/app/users/{{storageuser._id}}" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-person"></i> |
|||
{{storageuser.username}} profile |
|||
</a> |
|||
<a ng-href="#/app/newPublication" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-paper-airplane"></i> |
|||
New publication |
|||
<a ng-href="#/app/newTravel" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-map"></i> |
|||
New travel |
|||
</a> |
|||
<a ng-href="#/app/search" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-search"></i> |
|||
{{'Search' | translate }} |
|||
</a> |
|||
<a ng-href="#/app/travels" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-android-car"></i> |
|||
Travels |
|||
{{'Travels_feed' | translate }} |
|||
</a> |
|||
<a href="#/app/users" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-person-stalker"></i> |
|||
Users |
|||
{{'Users' | translate }} |
|||
</a> |
|||
<a href="#/app/notifications" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-android-notifications"></i> |
|||
Notifications |
|||
{{'Notifications' | translate }} |
|||
</a> |
|||
<a href="#/app/settings" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-settings"></i> |
|||
Settings |
|||
{{'Settings' | translate }} |
|||
</a> |
|||
<a href="#/app/help" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-ios-paper-outline"></i> |
|||
F.A.Q. |
|||
</a> |
|||
<a href="#/app/help" class="item item-icon-left o_purpleG300to500"> |
|||
<i class="icon ion-ios-help-outline"></i> |
|||
Help |
|||
{{'Help' | translate }} |
|||
</a> |
|||
</ion-content> |
|||
</ion-view> |
@ -1,5 +1,5 @@ |
|||
<ion-view view-title="New Publication"> |
|||
<ion-content> |
|||
<ion-view view-title="New Travel"> |
|||
<ion-content class="has-footer"> |
|||
<a ng-href="#/app/offerCar" class="item item-icon-left o_purple500"> |
|||
<i class="icon ion-android-car"></i> |
|||
Offer Car |
@ -1,14 +1,17 @@ |
|||
<ion-view view-title="{{'Notifications' | translate}} {{user.username}}"> |
|||
<ion-content> |
|||
<div class="item item-body"> |
|||
<a ng-repeat="notification in notifications | orderBy: '-date'" class="item item-avatar" href="#/app/{{notification.link}}"> |
|||
<img ng-src="img/{{notification.type}}.png"/> |
|||
<h2>{{notification.description}}</h2> |
|||
<ion-view view-title="{{'Notifications' | translate}}"> |
|||
<ion-content class="has-footer"> |
|||
<ion-refresher |
|||
pulling-text="{{'Pull_to_refresh' | translate}}..." |
|||
on-refresh="doRefresh()"> |
|||
</ion-refresher> |
|||
<a ng-repeat="notification in notifications | orderBy: '-date'" |
|||
class="item item-icon-left" href="#/app/{{notification.link}}"> |
|||
<i class="icon ion-android-notifications-none"></i> |
|||
<h2>{{notification.message}}</h2> |
|||
<div class="item-note text-right"> |
|||
<div class="positive">{{notification.date | date:"dd/MM"}}</div> |
|||
<div class="positive">{{notification.date | date:"HH:mm:ss"}}</div> |
|||
<div class="o_text_purple600">{{notification.date | date:"dd/MM"}}</div> |
|||
<div class="o_text_purple600">{{notification.date | date:"HH:mm:ss"}}</div> |
|||
</div> |
|||
</a> |
|||
</div> |
|||
</ion-content> |
|||
</ion-view> |
@ -0,0 +1,40 @@ |
|||
<ion-view view-title="{{'Search' | translate}}"> |
|||
<ion-content class="has-footer"> |
|||
<div class="list"> |
|||
<div class="item item-input"> |
|||
<i class="icon ion-search placeholder-icon"></i> |
|||
<input type="search" placeholder="{{'search' | translate}}..." ng-model="search.word"> |
|||
<md-button class="o_purple300" ng-click="doSearch()"><i class="icon ion-search"></i></md-button> |
|||
</div> |
|||
<div class="item item-divider o_purple300" ng-show="travels[0]"> |
|||
Travels |
|||
</div> |
|||
<a ng-repeat="travel in travels | orderBy: 'date'" |
|||
class="item item-avatar" href="#/app/travels/{{travel._id}}"> |
|||
<img ng-src="img/{{travel.type}}.png"/> |
|||
<h2 class="o_text_purple600">{{travel.title}}</h2> |
|||
<div class="item-note text-right"> |
|||
<div class="o_text_purple400">{{travel.date | date:"dd/MM"}}</div> |
|||
<div class="o_text_purple400">{{travel.date | date:"HH:mm"}}h</div> |
|||
<!--<div class="badge badge-calm">{{travel.owner}}</div>--> |
|||
</div> |
|||
<p> |
|||
{{travel.description}} |
|||
</p> |
|||
<!--<p class="" ng-show="travel.modality=='offering'">nºseats: {{travel.seats}}</p> |
|||
<p class="" ng-show="travel.modality=='asking'">nºpeople: {{travel.seats}}</p>--> |
|||
<p class="">{{travel.from}} --> {{travel.to}}</p> |
|||
</a> |
|||
<div class="item item-divider o_purple300" ng-show="users[0]"> |
|||
Users |
|||
</div> |
|||
<a ng-repeat="user in users | orderBy: 'date'" class="item item-avatar" ng-href="#/app/users/{{user._id}}"> |
|||
<img ng-src="{{user.avatar}}"> |
|||
<h2 class="o_text_purple600">{{user.username}}</h2> |
|||
<p> |
|||
{{user.description}} |
|||
</p> |
|||
</a> |
|||
</div> |
|||
</ion-content> |
|||
</ion-view> |