Browse Source

travel join updated on change, and Help page created

master
idoctnef 8 years ago
parent
commit
3e19567226
7 changed files with 45 additions and 9 deletions
  1. BIN
      www/img/help.png
  2. +9
    -0
      www/js/app.js
  3. +9
    -3
      www/js/controllers.js
  4. +1
    -0
      www/js/translations.js
  5. +16
    -0
      www/templates/help.html
  6. +4
    -0
      www/templates/menu.html
  7. +6
    -6
      www/templates/travel.html

BIN
www/img/help.png

Before After
Width: 32  |  Height: 32  |  Size: 701 B

+ 9
- 0
www/js/app.js

@ -43,6 +43,15 @@ angular.module('starter', ['ionic',
} }
} }
}) })
.state('app.help', {
url: '/help',
views: {
'menuContent': {
templateUrl: 'templates/help.html',
controller: 'HelpCtrl'
}
}
})
.state('app.users', { .state('app.users', {
url: '/users', url: '/users',

+ 9
- 3
www/js/controllers.js

@ -1,6 +1,6 @@
//var urlapi="http://localhost:3000/api/";
var urlapi="https://collectivecar.paas.primustech.io/api/";
var urlapi="http://localhost:3000/api/";
//var urlapi="https://collectivecar.paas.primustech.io/api/";
//localStorage.setItem("c_username", "user2"); //localStorage.setItem("c_username", "user2");
@ -460,6 +460,7 @@ angular.module('starter.controllers', ['pascalprecht.translate'])
$scope.travels=response.data; $scope.travels=response.data;
localStorage.setItem('c_travels', JSON.stringify($scope.travels)); localStorage.setItem('c_travels', JSON.stringify($scope.travels));
localStorage.setItem('c_travelsLastDate', JSON.stringify(new Date())); localStorage.setItem('c_travelsLastDate', JSON.stringify(new Date()));
$scope.travel = $filter('filter')($scope.travels, $stateParams.travelId, true)[0];
}, },
function(response) { // optional function(response) { // optional
@ -487,6 +488,7 @@ angular.module('starter.controllers', ['pascalprecht.translate'])
$scope.travels=response.data; $scope.travels=response.data;
localStorage.setItem('c_travels', JSON.stringify($scope.travels)); localStorage.setItem('c_travels', JSON.stringify($scope.travels));
localStorage.setItem('c_travelsLastDate', JSON.stringify(new Date())); localStorage.setItem('c_travelsLastDate', JSON.stringify(new Date()));
$scope.travel = $filter('filter')($scope.travels, $stateParams.travelId, true)[0];
}, },
function(response) { // optional function(response) { // optional
@ -601,7 +603,8 @@ console.log($scope.newComment);
.then(function(result){ .then(function(result){
travels = result.data; travels = result.data;
}); });
}).controller('SettingsCtrl', function($scope, $stateParams, $translate) {
})
.controller('SettingsCtrl', function($scope, $stateParams, $translate) {
if(localStorage.getItem('lang'))//initialization if(localStorage.getItem('lang'))//initialization
{ {
$scope.lang=localStorage.getItem('lang'); $scope.lang=localStorage.getItem('lang');
@ -615,4 +618,7 @@ console.log($scope.newComment);
window.localStorage.setItem('lang', lang); window.localStorage.setItem('lang', lang);
$translate.use(lang); $translate.use(lang);
}; };
})
.controller('HelpCtrl', function($scope, $stateParams, $translate) {
console.log("help page");
}); });

+ 1
- 0
www/js/translations.js

@ -8,6 +8,7 @@ var translations = {
"Users": "Users", "Users": "Users",
"Logout": "Logout", "Logout": "Logout",
"Settings": "Settings", "Settings": "Settings",
"Help": "Help",
"Login": "Login", "Login": "Login",
"Username": "Username", "Username": "Username",
"Password": "Password", "Password": "Password",

+ 16
- 0
www/templates/help.html

@ -0,0 +1,16 @@
<ion-view view-title="{{'Help' | translate}}">
<ion-content>
<h1>{{'Help' | translate}}</h1>
<p>
<img ng-src="img/newpackage.png" class="o-img-new"/>
<img ng-src="img/newasking.png" class="o-img-new"/>
<img ng-src="img/newoffering.png" class="o-img-new"/>
</p>
<p>
<img ng-src="img/package.png" class="o-img-new"/>
<img ng-src="img/asking.png" class="o-img-new"/>
<img ng-src="img/offering.png" class="o-img-new"/>
</p>
</ion-content>
</ion-view>

+ 4
- 0
www/templates/menu.html

@ -40,6 +40,10 @@
<img class='o-imgMenu' src="img/settings.png" /> <img class='o-imgMenu' src="img/settings.png" />
{{'Settings' | translate }} {{'Settings' | translate }}
</ion-item> </ion-item>
<ion-item menu-close href="#/app/help">
<img class='o-imgMenu' src="img/help.png" />
{{'Help' | translate }}
</ion-item>
<ion-item menu-close ng-click="logout()" ng-show="storageusername"> <ion-item menu-close ng-click="logout()" ng-show="storageusername">
{{'Logout' | translate }} {{'Logout' | translate }}
</ion-item> </ion-item>

+ 6
- 6
www/templates/travel.html

@ -52,15 +52,15 @@
<div ng-show="storageusername && storageusername!=travel.owner"> <div ng-show="storageusername && storageusername!=travel.owner">
<p class='text-right'> <p class='text-right'>
<div ng-show="arrayObjectIndexOf(travel.joins, storageusername, 'joinedUsername')==-1"> <div ng-show="arrayObjectIndexOf(travel.joins, storageusername, 'joinedUsername')==-1">
<a ng-show="travel.modality=='offering'" ng-click="joinTravel()" href="#" class="button button-calm o-pull-right">{{'Ask_to_join' | translate}}</a>
<a ng-show="travel.modality=='asking'" ng-click="joinTravel()" href="#" class="button button-calm o-pull-right">{{'Offer_car' | translate}}</a>
<a ng-show="travel.modality=='package'" ng-click="joinTravel()" href="#" class="button button-calm o-pull-right">{{'Offer_car' | translate}}</a>
<a ng-show="travel.modality=='offering'" ng-click="joinTravel()" class="button button-calm o-pull-right">{{'Ask_to_join' | translate}}</a>
<a ng-show="travel.modality=='asking'" ng-click="joinTravel()" class="button button-calm o-pull-right">{{'Offer_car' | translate}}</a>
<a ng-show="travel.modality=='package'" ng-click="joinTravel()" class="button button-calm o-pull-right">{{'Offer_car' | translate}}</a>
</div> </div>
<div ng-show="arrayObjectIndexOf(travel.joins, storageusername, 'joinedUsername')!=-1"> <div ng-show="arrayObjectIndexOf(travel.joins, storageusername, 'joinedUsername')!=-1">
<a ng-show="travel.modality=='offering'" ng-click="unjoinTravel()" href="#" class="button button-assertive o-pull-right">{{'Unjoin' | translate}}</a>
<a ng-show="travel.modality=='asking'" ng-click="unjoinTravel()" href="#" class="button button-assertive o-pull-right">{{'Unoffer_car' | translate}}</a>
<a ng-show="travel.modality=='package'" ng-click="unjoinTravel()" href="#" class="button button-assertive o-pull-right">{{'Unoffer_car' | translate}}</a>
<a ng-show="travel.modality=='offering'" ng-click="unjoinTravel()" class="button button-assertive o-pull-right">{{'Unjoin' | translate}}</a>
<a ng-show="travel.modality=='asking'" ng-click="unjoinTravel()" class="button button-assertive o-pull-right">{{'Unoffer_car' | translate}}</a>
<a ng-show="travel.modality=='package'" ng-click="unjoinTravel()" class="button button-assertive o-pull-right">{{'Unoffer_car' | translate}}</a>
</div> </div>
</p> </p>
</div> </div>

Loading…
Cancel
Save