diff --git a/app/www/img/settings.png b/app/www/img/settings.png
new file mode 100644
index 0000000..fcb0750
Binary files /dev/null and b/app/www/img/settings.png differ
diff --git a/app/www/js/controllers.js b/app/www/js/controllers.js
index 88c60b7..5abe9ac 100644
--- a/app/www/js/controllers.js
+++ b/app/www/js/controllers.js
@@ -81,6 +81,12 @@ angular.module('starter.controllers', [])
$scope.modalAsking = modal;
});
+ $ionicModal.fromTemplateUrl('templates/newaskingpackage.html', {
+ scope: $scope
+ }).then(function(modal) {
+ $scope.modalPackage = modal;
+ });
+
// Triggered in the login modal to close it
$scope.closeNewOfferingTravel = function() {
$scope.modalOffering.hide();
@@ -89,6 +95,9 @@ angular.module('starter.controllers', [])
$scope.closeNewAskingTravel = function() {
$scope.modalAsking.hide();
};
+ $scope.closeNewAskingPackage = function() {
+ $scope.modalPackage.hide();
+ };
// Open the login modal
$scope.showNewOfferingTravel = function() {
@@ -98,6 +107,9 @@ angular.module('starter.controllers', [])
$scope.showNewAskingTravel = function() {
$scope.modalAsking.show();
};
+ $scope.showNewAskingPackage = function() {
+ $scope.modalPackage.show();
+ };
// Perform the login action when the user submits the login form
$scope.doNewOfferingTravel = function() {
@@ -162,6 +174,38 @@ angular.module('starter.controllers', [])
$scope.closeNewAskingTravel();
}, 1000);
};
+
+ $scope.doNewAskingPackage = function() {
+ console.log('Doing new package', $scope.newtravel);
+ $scope.newtravel.icon="lorry";
+ $scope.newtravel.generateddate=$scope.newtravel.date;
+ $scope.newtravel.owner="user";
+ $scope.newtravel.package=true;
+
+ $scope.newtravel.modality="package";
+ console.log($scope.newtravel);
+ $http({
+ url: 'http://localhost:3000/api/travels',
+ method: "POST",
+ data: $scope.newtravel
+ })
+ .then(function(response) {
+ // success
+ console.log("response: ");
+ console.log(response);
+ $scope.newtravel._id=response.data._id;
+ $scope.travels.push($scope.newtravel);
+ },
+ function(response) { // optional
+ // failed
+ });
+
+ // Simulate a login delay. Remove this and replace with your login
+ // code if using a login system
+ $timeout(function() {
+ $scope.closeNewAskingPackage();
+ }, 1000);
+ };
})
.controller('TravelCtrl', function($scope, $stateParams, $http) {
diff --git a/app/www/templates/menu.html b/app/www/templates/menu.html
index 04631b7..838f5e6 100644
--- a/app/www/templates/menu.html
+++ b/app/www/templates/menu.html
@@ -21,10 +21,6 @@
+
+ New Asking Package {{newtravel.title}}
+
+
+
+