get and show travels from server by app

This commit is contained in:
nau
2016-08-25 22:57:16 +02:00
parent 09a59da1e0
commit a87c5faa5c
56 changed files with 65 additions and 9 deletions

1
app/.io-config.json Normal file
View File

@@ -0,0 +1 @@
{"app_id":"0f46f512"}

12
app/comandesUtils.txt Normal file
View File

@@ -0,0 +1,12 @@
export ANDROID_HOME=~/Android/Sdk/
PATH=$PATH:$ANDROID_HOME/tools
PATH=$PATH:$ANDROID_HOME/platform-tools
cd /home/nau/Android/Sdk/tools
./android
ionic serve
ionic build android

View File

@@ -16,7 +16,28 @@
<preference name="FadeSplashScreenDuration" value="2000"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen"/>
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
<platform name="android">
<icon src="resources/android/icon/drawable-ldpi-icon.png" density="ldpi"/>
<icon src="resources/android/icon/drawable-mdpi-icon.png" density="mdpi"/>
<icon src="resources/android/icon/drawable-hdpi-icon.png" density="hdpi"/>
<icon src="resources/android/icon/drawable-xhdpi-icon.png" density="xhdpi"/>
<icon src="resources/android/icon/drawable-xxhdpi-icon.png" density="xxhdpi"/>
<icon src="resources/android/icon/drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
<splash src="resources/android/splash/drawable-land-ldpi-screen.png" density="land-ldpi"/>
<splash src="resources/android/splash/drawable-land-mdpi-screen.png" density="land-mdpi"/>
<splash src="resources/android/splash/drawable-land-hdpi-screen.png" density="land-hdpi"/>
<splash src="resources/android/splash/drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
<splash src="resources/android/splash/drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
<splash src="resources/android/splash/drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
<splash src="resources/android/splash/drawable-port-ldpi-screen.png" density="port-ldpi"/>
<splash src="resources/android/splash/drawable-port-mdpi-screen.png" density="port-mdpi"/>
<splash src="resources/android/splash/drawable-port-hdpi-screen.png" density="port-hdpi"/>
<splash src="resources/android/splash/drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
<splash src="resources/android/splash/drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
<splash src="resources/android/splash/drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
</platform>
</widget>

4
app/ionic.config.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "app",
"app_id": "0f46f512"
}

View File

@@ -1,4 +1,4 @@
{
"name": "app",
"app_id": ""
"app_id": "0f46f512"
}

View File

@@ -1,7 +1,7 @@
{
"name": "app",
"name": "collectivecar",
"version": "1.1.1",
"description": "app: An Ionic project",
"description": "app: collectivecar",
"dependencies": {
"gulp": "^3.5.6",
"gulp-sass": "^2.0.4",

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
app/resources/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
app/resources/splash.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -42,8 +42,8 @@ angular.module('starter.controllers', [])
})
.controller('TravelsCtrl', function($scope) {
$scope.travels = [
.controller('TravelsCtrl', function($scope, $http) {
/*$scope.travels = [
{ id: 1, title: 'Travel1', description: "description for travel 1", owner: "user1", icon: "car" },
{ id: 2, title: 'Travel2', description: "description for travel 2", owner: "user2", icon: "station-wagon" },
{ id: 3, title: 'Travel3', description: "description for travel 3", owner: "user3", icon: "van" },
@@ -52,7 +52,20 @@ angular.module('starter.controllers', [])
{ id: 6, title: 'Travel6', description: "description for travel 6", owner: "user3", icon: "lorry" },
{ id: 7, title: 'Travel7', description: "description for travel 7", owner: "user1", icon: "sport-car" },
{ id: 8, title: 'Travel8', description: "description for travel 8", owner: "user2", icon: "jeep" }
];
];*/
$scope.travels="";
$http.get('http://localhost:3000/api/travels')
.success(function(data, status, headers,config){
console.log('data success');
console.log(data); // for browser console
$scope.travels = data; // for UI
})
.error(function(data, status, headers,config){
console.log('data error');
})
.then(function(result){
travels = result.data;
});
})
.controller('TravelCtrl', function($scope, $stateParams) {
//$scope.travel=travels.get($stateParams.travelId);

View File

@@ -24,6 +24,9 @@
<ion-item menu-close href="#/app/travels">
Travels
</ion-item>
<ion-item menu-close href="#/app/browse">
Transport material
</ion-item>
<ion-item menu-close href="#/app/search">
Available cars
</ion-item>

View File

@@ -58,7 +58,8 @@ exports.addTravel = function(req, res) {
to: req.body.to,
date: req.body.date,
generateddate: req.body.generateddate,
seats: req.body.seats
seats: req.body.seats,
icon: req.body.icon
});
travel.save(function(err, travel) {

View File

@@ -10,6 +10,7 @@ var travelSchema = new Schema({
to: { type: String },
date: { type: Date },
generateddate: { type: Date },
seats: { type: Number }
seats: { type: Number },
icon: { type: String }
})
module.exports = mongoose.model('travelModel', travelSchema);