Browse Source

get and show travels from server by app

pull/1/head
nau 8 years ago
parent
commit
a87c5faa5c
56 changed files with 65 additions and 9 deletions
  1. +1
    -0
      app/.io-config.json
  2. +12
    -0
      app/comandesUtils.txt
  3. +21
    -0
      app/config.xml
  4. +4
    -0
      app/ionic.config.json
  5. +1
    -1
      app/ionic.project
  6. +3
    -3
      app/package.json
  7. BIN
      app/resources/android/icon/drawable-hdpi-icon.png
  8. BIN
      app/resources/android/icon/drawable-ldpi-icon.png
  9. BIN
      app/resources/android/icon/drawable-mdpi-icon.png
  10. BIN
      app/resources/android/icon/drawable-xhdpi-icon.png
  11. BIN
      app/resources/android/icon/drawable-xxhdpi-icon.png
  12. BIN
      app/resources/android/icon/drawable-xxxhdpi-icon.png
  13. BIN
      app/resources/android/splash/drawable-land-hdpi-screen.png
  14. BIN
      app/resources/android/splash/drawable-land-ldpi-screen.png
  15. BIN
      app/resources/android/splash/drawable-land-mdpi-screen.png
  16. BIN
      app/resources/android/splash/drawable-land-xhdpi-screen.png
  17. BIN
      app/resources/android/splash/drawable-land-xxhdpi-screen.png
  18. BIN
      app/resources/android/splash/drawable-land-xxxhdpi-screen.png
  19. BIN
      app/resources/android/splash/drawable-port-hdpi-screen.png
  20. BIN
      app/resources/android/splash/drawable-port-ldpi-screen.png
  21. BIN
      app/resources/android/splash/drawable-port-mdpi-screen.png
  22. BIN
      app/resources/android/splash/drawable-port-xhdpi-screen.png
  23. BIN
      app/resources/android/splash/drawable-port-xxhdpi-screen.png
  24. BIN
      app/resources/android/splash/drawable-port-xxxhdpi-screen.png
  25. BIN
      app/resources/icon.png
  26. BIN
      app/resources/ios/icon/icon-40.png
  27. BIN
      app/resources/ios/icon/icon-40@2x.png
  28. BIN
      app/resources/ios/icon/icon-50.png
  29. BIN
      app/resources/ios/icon/icon-50@2x.png
  30. BIN
      app/resources/ios/icon/icon-60.png
  31. BIN
      app/resources/ios/icon/icon-60@2x.png
  32. BIN
      app/resources/ios/icon/icon-60@3x.png
  33. BIN
      app/resources/ios/icon/icon-72.png
  34. BIN
      app/resources/ios/icon/icon-72@2x.png
  35. BIN
      app/resources/ios/icon/icon-76.png
  36. BIN
      app/resources/ios/icon/icon-76@2x.png
  37. BIN
      app/resources/ios/icon/icon-small.png
  38. BIN
      app/resources/ios/icon/icon-small@2x.png
  39. BIN
      app/resources/ios/icon/icon-small@3x.png
  40. BIN
      app/resources/ios/icon/icon.png
  41. BIN
      app/resources/ios/icon/icon@2x.png
  42. BIN
      app/resources/ios/splash/Default-568h@2x~iphone.png
  43. BIN
      app/resources/ios/splash/Default-667h.png
  44. BIN
      app/resources/ios/splash/Default-736h.png
  45. BIN
      app/resources/ios/splash/Default-Landscape-736h.png
  46. BIN
      app/resources/ios/splash/Default-Landscape@2x~ipad.png
  47. BIN
      app/resources/ios/splash/Default-Landscape~ipad.png
  48. BIN
      app/resources/ios/splash/Default-Portrait@2x~ipad.png
  49. BIN
      app/resources/ios/splash/Default-Portrait~ipad.png
  50. BIN
      app/resources/ios/splash/Default@2x~iphone.png
  51. BIN
      app/resources/ios/splash/Default~iphone.png
  52. BIN
      app/resources/splash.png
  53. +16
    -3
      app/www/js/controllers.js
  54. +3
    -0
      app/www/templates/menu.html
  55. +2
    -1
      server/controllers/travelController.js
  56. +2
    -1
      server/models/travelModel.js

+ 1
- 0
app/.io-config.json

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

+ 12
- 0
app/comandesUtils.txt

@ -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

+ 21
- 0
app/config.xml

@ -16,7 +16,28 @@
<preference name="FadeSplashScreenDuration" value="2000"/> <preference name="FadeSplashScreenDuration" value="2000"/>
<preference name="android-minSdkVersion" value="16"/> <preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/> <preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen"/>
<feature name="StatusBar"> <feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/> <param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature> </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> </widget>

+ 4
- 0
app/ionic.config.json

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

+ 1
- 1
app/ionic.project

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

+ 3
- 3
app/package.json

@ -1,7 +1,7 @@
{ {
"name": "app",
"name": "collectivecar",
"version": "1.1.1", "version": "1.1.1",
"description": "app: An Ionic project",
"description": "app: collectivecar",
"dependencies": { "dependencies": {
"gulp": "^3.5.6", "gulp": "^3.5.6",
"gulp-sass": "^2.0.4", "gulp-sass": "^2.0.4",
@ -23,4 +23,4 @@
"ionic-plugin-keyboard" "ionic-plugin-keyboard"
], ],
"cordovaPlatforms": [] "cordovaPlatforms": []
}
}

BIN
app/resources/android/icon/drawable-hdpi-icon.png

Before After
Width: 72  |  Height: 72  |  Size: 2.8 KiB

BIN
app/resources/android/icon/drawable-ldpi-icon.png

Before After
Width: 36  |  Height: 36  |  Size: 1.1 KiB

BIN
app/resources/android/icon/drawable-mdpi-icon.png

Before After
Width: 48  |  Height: 48  |  Size: 1.8 KiB

BIN
app/resources/android/icon/drawable-xhdpi-icon.png

Before After
Width: 96  |  Height: 96  |  Size: 4.2 KiB

BIN
app/resources/android/icon/drawable-xxhdpi-icon.png

Before After
Width: 144  |  Height: 144  |  Size: 7.6 KiB

BIN
app/resources/android/icon/drawable-xxxhdpi-icon.png

Before After
Width: 192  |  Height: 192  |  Size: 12 KiB

BIN
app/resources/android/splash/drawable-land-hdpi-screen.png

Before After
Width: 800  |  Height: 480  |  Size: 13 KiB

BIN
app/resources/android/splash/drawable-land-ldpi-screen.png

Before After
Width: 320  |  Height: 200  |  Size: 3.7 KiB

BIN
app/resources/android/splash/drawable-land-mdpi-screen.png

Before After
Width: 480  |  Height: 320  |  Size: 6.9 KiB

BIN
app/resources/android/splash/drawable-land-xhdpi-screen.png

Before After
Width: 1280  |  Height: 720  |  Size: 39 KiB

BIN
app/resources/android/splash/drawable-land-xxhdpi-screen.png

Before After
Width: 1600  |  Height: 960  |  Size: 58 KiB

BIN
app/resources/android/splash/drawable-land-xxxhdpi-screen.png

Before After
Width: 1920  |  Height: 1280  |  Size: 87 KiB

BIN
app/resources/android/splash/drawable-port-hdpi-screen.png

Before After
Width: 480  |  Height: 800  |  Size: 13 KiB

BIN
app/resources/android/splash/drawable-port-ldpi-screen.png

Before After
Width: 200  |  Height: 320  |  Size: 3.5 KiB

BIN
app/resources/android/splash/drawable-port-mdpi-screen.png

Before After
Width: 320  |  Height: 480  |  Size: 7.0 KiB

BIN
app/resources/android/splash/drawable-port-xhdpi-screen.png

Before After
Width: 720  |  Height: 1280  |  Size: 38 KiB

BIN
app/resources/android/splash/drawable-port-xxhdpi-screen.png

Before After
Width: 960  |  Height: 1600  |  Size: 54 KiB

BIN
app/resources/android/splash/drawable-port-xxxhdpi-screen.png

Before After
Width: 1280  |  Height: 1920  |  Size: 80 KiB

BIN
app/resources/icon.png

Before After
Width: 1024  |  Height: 1024  |  Size: 59 KiB

BIN
app/resources/ios/icon/icon-40.png

Before After
Width: 40  |  Height: 40  |  Size: 1.2 KiB

BIN
app/resources/ios/icon/icon-40@2x.png

Before After
Width: 80  |  Height: 80  |  Size: 3.5 KiB

BIN
app/resources/ios/icon/icon-50.png

Before After
Width: 50  |  Height: 50  |  Size: 1.9 KiB

BIN
app/resources/ios/icon/icon-50@2x.png

Before After
Width: 100  |  Height: 100  |  Size: 4.6 KiB

BIN
app/resources/ios/icon/icon-60.png

Before After
Width: 60  |  Height: 60  |  Size: 2.4 KiB

BIN
app/resources/ios/icon/icon-60@2x.png

Before After
Width: 120  |  Height: 120  |  Size: 5.9 KiB

BIN
app/resources/ios/icon/icon-60@3x.png

Before After
Width: 180  |  Height: 180  |  Size: 11 KiB

BIN
app/resources/ios/icon/icon-72.png

Before After
Width: 72  |  Height: 72  |  Size: 2.8 KiB

BIN
app/resources/ios/icon/icon-72@2x.png

Before After
Width: 144  |  Height: 144  |  Size: 7.6 KiB

BIN
app/resources/ios/icon/icon-76.png

Before After
Width: 76  |  Height: 76  |  Size: 3.2 KiB

BIN
app/resources/ios/icon/icon-76@2x.png

Before After
Width: 152  |  Height: 152  |  Size: 8.1 KiB

BIN
app/resources/ios/icon/icon-small.png

Before After
Width: 29  |  Height: 29  |  Size: 818 B

BIN
app/resources/ios/icon/icon-small@2x.png

Before After
Width: 58  |  Height: 58  |  Size: 2.2 KiB

BIN
app/resources/ios/icon/icon-small@3x.png

Before After
Width: 87  |  Height: 87  |  Size: 3.8 KiB

BIN
app/resources/ios/icon/icon.png

Before After
Width: 57  |  Height: 57  |  Size: 2.1 KiB

BIN
app/resources/ios/icon/icon@2x.png

Before After
Width: 114  |  Height: 114  |  Size: 5.6 KiB

BIN
app/resources/ios/splash/Default-568h@2x~iphone.png

Before After
Width: 640  |  Height: 1136  |  Size: 31 KiB

BIN
app/resources/ios/splash/Default-667h.png

Before After
Width: 750  |  Height: 1334  |  Size: 40 KiB

BIN
app/resources/ios/splash/Default-736h.png

Before After
Width: 1242  |  Height: 2208  |  Size: 44 KiB

BIN
app/resources/ios/splash/Default-Landscape-736h.png

Before After
Width: 2208  |  Height: 1242  |  Size: 44 KiB

BIN
app/resources/ios/splash/Default-Landscape@2x~ipad.png

Before After
Width: 2048  |  Height: 1536  |  Size: 100 KiB

BIN
app/resources/ios/splash/Default-Landscape~ipad.png

Before After
Width: 1024  |  Height: 768  |  Size: 22 KiB

BIN
app/resources/ios/splash/Default-Portrait@2x~ipad.png

Before After
Width: 1536  |  Height: 2048  |  Size: 97 KiB

BIN
app/resources/ios/splash/Default-Portrait~ipad.png

Before After
Width: 768  |  Height: 1024  |  Size: 22 KiB

BIN
app/resources/ios/splash/Default@2x~iphone.png

Before After
Width: 640  |  Height: 960  |  Size: 18 KiB

BIN
app/resources/ios/splash/Default~iphone.png

Before After
Width: 320  |  Height: 480  |  Size: 7.0 KiB

BIN
app/resources/splash.png

Before After
Width: 2208  |  Height: 2208  |  Size: 61 KiB

+ 16
- 3
app/www/js/controllers.js

@ -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: 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: 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" }, { 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: 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: 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" } { 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) { .controller('TravelCtrl', function($scope, $stateParams) {
//$scope.travel=travels.get($stateParams.travelId); //$scope.travel=travels.get($stateParams.travelId);

+ 3
- 0
app/www/templates/menu.html

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

+ 2
- 1
server/controllers/travelController.js

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

+ 2
- 1
server/models/travelModel.js

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

Loading…
Cancel
Save