Browse Source

added travel link to the webapp view

master
arnaucode 6 years ago
parent
commit
2c6be8748f
6 changed files with 20 additions and 10 deletions
  1. +1
    -1
      www/js/app.js
  2. +2
    -2
      www/js/askForCar.js
  3. +2
    -2
      www/js/askForPackage.js
  4. +2
    -2
      www/js/offerCar.js
  5. +7
    -0
      www/js/travel.js
  6. +6
    -3
      www/templates/travel.html

+ 1
- 1
www/js/app.js

@ -6,7 +6,7 @@
// 'starter.controllers' is found in controllers.js
//var urlapi = "http://localhost:3000/api/";
// var urlapi = "http://localhost:3000/api/";
//var urlapi = "http://192.168.1.36:3000/api/";
//var urlapi = "http://37.59.123.45:3000/api/";
var urlapi = "http://routes.fair.coop:3000/api/";

+ 2
- 2
www/js/askForCar.js

@ -47,7 +47,7 @@ angular.module('app.askForCar', ['pascalprecht.translate', 'ui-leaflet'])
$scope.markers=[];
console.log($scope.newtravel.from.name);
console.log($scope.newtravel.to.name);
$http.get('http://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.from.name + '&format=json&limit=1')
$http.get('https://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.from.name + '&format=json&limit=1')
.then(function(data) {
console.log(data);
if(data.data[0])
@ -61,7 +61,7 @@ angular.module('app.askForCar', ['pascalprecht.translate', 'ui-leaflet'])
message: data.data[0].display_name
});
}
$http.get('http://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.to.name + '&format=json&limit=1')
$http.get('https://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.to.name + '&format=json&limit=1')
.then(function(data) {
if(data.data[0])
{

+ 2
- 2
www/js/askForPackage.js

@ -47,7 +47,7 @@ angular.module('app.askForPackage', ['pascalprecht.translate', 'ui-leaflet'])
$scope.markers=[];
console.log($scope.newtravel.from.name);
console.log($scope.newtravel.to.name);
$http.get('http://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.from.name + '&format=json&limit=1')
$http.get('https://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.from.name + '&format=json&limit=1')
.then(function(data) {
console.log(data);
if(data.data[0])
@ -61,7 +61,7 @@ angular.module('app.askForPackage', ['pascalprecht.translate', 'ui-leaflet'])
message: data.data[0].display_name
});
}
$http.get('http://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.to.name + '&format=json&limit=1')
$http.get('https://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.to.name + '&format=json&limit=1')
.then(function(data) {
if(data.data[0])
{

+ 2
- 2
www/js/offerCar.js

@ -47,7 +47,7 @@ angular.module('app.offerCar', ['pascalprecht.translate', 'ui-leaflet'])
$scope.markers=[];
console.log($scope.newtravel.from.name);
console.log($scope.newtravel.to.name);
$http.get('http://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.from.name + '&format=json&limit=1')
$http.get('https://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.from.name + '&format=json&limit=1')
.then(function(data) {
console.log(data);
if(data.data[0])
@ -61,7 +61,7 @@ angular.module('app.offerCar', ['pascalprecht.translate', 'ui-leaflet'])
message: data.data[0].display_name
});
}
$http.get('http://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.to.name + '&format=json&limit=1')
$http.get('https://nominatim.openstreetmap.org/search?q=' + $scope.newtravel.to.name + '&format=json&limit=1')
.then(function(data) {
if(data.data[0])
{

+ 7
- 0
www/js/travel.js

@ -289,4 +289,11 @@ angular.module('app.travel', ['pascalprecht.translate', 'ui-leaflet'])
window.open('http://telegram.me/' + telegramuser, '_system', 'location=yes');
return false;
};
$scope.copyTravelLink = function(link) {
$cordovaClipboard.copy("Text To Copy").then(function() {
// success
}, function() {
// error
});
};
});

+ 6
- 3
www/templates/travel.html

@ -13,9 +13,12 @@
<i ng-show="travel.user.validated" class="ion-checkmark-circled ct_blue300"></i>
</a>
<p class="text-right">
<a target="_blank" ng-href="http://routes.fair.coop/app/#!/travel/{{travel._id}}" class="button button-small o_grey300">
<i class="icon ion-share" style="margin-left:-14px;"></i>
</a>
<a ng-click="deleteTravel()" class="button button-small o_bRed"
ng-show="storageuser._id==travel.user._id">
<i class="icon ion-trash-a"></i>
<i class="icon ion-trash-a" style="margin-left:-14px;"></i>
</a>
</p>
</p>
@ -45,8 +48,8 @@
<i class="icon ion-ios-box"></i> {{'package' | translate}}
</div>
<a class="item item-icon-left" ng-show="travel.user.telegram"
ng-click="openTelegram(user.telegram)">
<i class="icon ion-paper-airplane"></i> @{{travel.user.telegram}}
ng-click="openTelegram(travel.user.telegram)">
<i class="icon ion-paper-airplane"></i> Telegram: @{{travel.user.telegram}}
</a>
<div class="item item-icon-left" ng-show="travel.user.phone">
<i class="icon ion-ios-telephone"></i> {{travel.user.phone}}

Loading…
Cancel
Save