diff --git a/hackatonApp/.io-config.json b/hackatonApp/.io-config.json new file mode 100644 index 0000000..dd2ba25 --- /dev/null +++ b/hackatonApp/.io-config.json @@ -0,0 +1 @@ +{"app_id":"8f8adae8","api_key":"52ee0b2198eb660371fbc95ab8d0d107ce58b962fda15a74"} \ No newline at end of file diff --git a/hackatonApp/ionic.project b/hackatonApp/ionic.project index 014394c..6463758 100644 --- a/hackatonApp/ionic.project +++ b/hackatonApp/ionic.project @@ -1,6 +1,6 @@ { "name": "ionFullApp", - "app_id": "", + "app_id": "8f8adae8", "gulpStartupTasks": [ "sass", "templatecache", @@ -11,4 +11,4 @@ "!www/lib/**/*" ], "documentRoot": "www" -} \ No newline at end of file +} diff --git a/hackatonApp/scss/home-items.scss b/hackatonApp/scss/home-items.scss index a6edb8e..73521cb 100644 --- a/hackatonApp/scss/home-items.scss +++ b/hackatonApp/scss/home-items.scss @@ -29,10 +29,13 @@ $pre-img-ratios: append($pre-img-ratios, $home-categories-img-ratio); position: absolute; left: 10px; width: 40px; + height:80px; .thumbnail { width: 100%; + height:80px; + } } diff --git a/hackatonApp/www/home-categories.json b/hackatonApp/www/home-categories.json index b0eb0cf..4ae532c 100644 --- a/hackatonApp/www/home-categories.json +++ b/hackatonApp/www/home-categories.json @@ -2,7 +2,38 @@ { "id":"booking", "title":"Prenota", - "image":"img/feeds/news.jpg" + "image":"img/feeds/news.jpg", + "home_sources":[ + { + "id":"Trenitalia", + "title":"Trenitalia", + "description":"The latest stories from the World section of the BBC News web site.", + "image":"img/trenitalialogo.png", + "url":"http://feeds.bbci.co.uk/news/world/rss.xml" + + }, + { + "id":"Trenitalia", + "title":"Trenitalia", + "description":"Reuters.com is your source for breaking news, business, financial and investing news, including personal finance and stocks. Reuters is the leading global provider of news, financial information and technology solutions to the world's media, financial institutions, businesses and individuals.", + "image":"img/trenitalialogo.png", + "url":"http://feeds.reuters.com/Reuters/worldNews" + }, + { + "id":"Trenitalia", + "title":"Trenitalia", + "description":"CNN.com delivers up-to-the-minute news and information on the latest top stories, weather, entertainment, politics and more.", + "image":"img/trenitalialogo.png", + "url":"http://rss.cnn.com/rss/cnn_world.rss" + }, + { + "id":"Trenitalia", + "title":"Trenitalia", + "description":"Latest World news, comment and analysis from the Guardian, the world's leading liberal voice", + "image":"img/trenitalialogo.png", + "url":"http://www.theguardian.com/world/rss" + } + ] }, { "id":"addticketwithphoto", diff --git a/hackatonApp/www/img/trenitalialogo.png b/hackatonApp/www/img/trenitalialogo.png new file mode 100644 index 0000000..2c339e2 Binary files /dev/null and b/hackatonApp/www/img/trenitalialogo.png differ diff --git a/hackatonApp/www/js/app.js b/hackatonApp/www/js/app.js index 966457c..a15ff2b 100644 --- a/hackatonApp/www/js/app.js +++ b/hackatonApp/www/js/app.js @@ -1,5 +1,19 @@ // Ionic Starter App +function takePicture() + { + console.log("PSOO"); + navigator.camera.getPicture(function(imageURI) { + + // imageURI is the URL of the image that we can use for + // an element or backgroundImage. + + }, function(err) { + + // Ruh-roh, something bad happened + + }, cameraOptions); + } angular.module('underscore', []) .factory('_', function() { return window._; // assumes underscore has already been loaded on the page @@ -27,6 +41,8 @@ angular.module('your_app_name', [ 'youtube-embed' ]) + + .run(function($ionicPlatform, PushNotificationsService, $rootScope, $ionicConfig, $timeout) { $ionicPlatform.on("deviceready", function(){ @@ -296,8 +312,8 @@ angular.module('your_app_name', [ } } }) - .state('app.addTicketWithPhoto', { - url: "/addTicketWithPhoto", + .state('app.addticketwithphoto', { + url: "/addticketwithphoto", views: { 'menuContent': { templateUrl: "views/app/addTicketWithPhoto.html", @@ -334,7 +350,7 @@ angular.module('your_app_name', [ }) .state('app.category', { - url: "/category/:categoryId", + url: "/:categoryId", views: { 'menuContent': { templateUrl: "views/app/category.html", @@ -342,6 +358,15 @@ angular.module('your_app_name', [ } } }) + .state('app.category-entries', { + url: "/booking/:sourceId", + views: { + 'menuContent': { + templateUrl: "views/app/category-entries.html", + controller: 'CategoryEntriesCtrl' + } + } + }) ; // if none of the above states are matched, use this as the fallback diff --git a/hackatonApp/www/js/controllers.js b/hackatonApp/www/js/controllers.js index 91b918e..deb32a6 100644 --- a/hackatonApp/www/js/controllers.js +++ b/hackatonApp/www/js/controllers.js @@ -14,6 +14,9 @@ angular.module('your_app_name.controllers', []) $scope.user.telephone="3477608470"; $scope.user.picture="img/laura.jpg"; $scope.user.score="15463"; + + + }) //LOGIN @@ -475,7 +478,7 @@ angular.module('your_app_name.controllers', []) .controller('ImagePickerCtrl', function($scope, $rootScope, $cordovaCamera) { - $scope.images = []; + /*$scope.images = []; $scope.selImages = function() { @@ -504,7 +507,7 @@ angular.module('your_app_name.controllers', []) $scope.shareAll = function() { window.plugins.socialsharing.share(null, null, $scope.images); - }; + };*/ }) .controller('BookingCtrl', function($scope, $http) { }) @@ -515,7 +518,9 @@ angular.module('your_app_name.controllers', []) }) .controller('BookingCtrl', function($scope, $http) { }) -.controller('AddTicketWithCtrl', function($scope, $http) { +.controller('AddTicketWithPhotoCtrl', function($scope, $http) { + console.log("OSOSSOS"); + }) .controller('AllTicketsCtrl', function($scope, $http) { }) @@ -528,22 +533,40 @@ angular.module('your_app_name.controllers', []) }); console.log("HOME"); }) + .controller('CategoryCtrl', function($scope, $http, $stateParams) { $scope.category_sources = []; $scope.categoryId = $stateParams.categoryId; + console.log($scope.categoryId); - $http.get('home-categories.json').success(function(response) { - var category = _.find(response, {id: $scope.categoryId}); - $scope.categoryTitle = category.title; - $scope.category_sources = category.home_sources; - }); + switch($scope.categoryId) + { + case "addticketwithphoto": + { + console.log("ciao"); + takePicture(); + break; + } + case "booking": + { + $http.get('home-categories.json').success(function(response) { + var category = _.find(response, {id: $scope.categoryId}); + $scope.categoryTitle = category.title; + $scope.category_sources = category.home_sources; + }); + break; + } + } + + }) -.controller('HomeEntriesCtrl', function($scope, $stateParams, $http, $q, $ionicLoading) { - $scope.home = []; - var categoryId = $stateParams.categoryId, - sourceId = $stateParams.sourceId; +.controller('CategoryEntriesCtrl', function($scope, $stateParams, $http) { + $scope.category_sources = []; + $scope.sourceId = $stateParams.sourceId; + $scope.entriesTitle = $stateParams.sourceId; + console.log("ciao"); }) ; diff --git a/hackatonApp/www/js/filters.js b/hackatonApp/www/js/filters.js index 0b5f3af..8222510 100644 --- a/hackatonApp/www/js/filters.js +++ b/hackatonApp/www/js/filters.js @@ -12,4 +12,11 @@ angular.module('your_app_name.filters', []) }; }) +.filter('capitalize', function() { + return function(input, all) { + var reg = (all) ? /([^\W_]+[^\s-]*) */g : /([^\W_]+[^\s-]*)/; + return (!!input) ? input.replace(reg, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}) : ''; + }; + }) + ; diff --git a/hackatonApp/www/views/app/addTicketWithPhoto.html b/hackatonApp/www/views/app/addTicketWithPhoto.html index eefe39d..2beb260 100644 --- a/hackatonApp/www/views/app/addTicketWithPhoto.html +++ b/hackatonApp/www/views/app/addTicketWithPhoto.html @@ -1,35 +1,8 @@ - + - Bookmarks + Fai una foto al biglietto - - - - - There's nothing here yet. Start exploring! - - - - - - Feeds Bookmarks - - - - - Posted - - - - Wordpress bookmarks - - - - - Posted - - - + dff diff --git a/hackatonApp/www/views/app/booking.html b/hackatonApp/www/views/app/booking.html index eefe39d..e69de29 100644 --- a/hackatonApp/www/views/app/booking.html +++ b/hackatonApp/www/views/app/booking.html @@ -1,35 +0,0 @@ - - - Bookmarks - - - - - - - There's nothing here yet. Start exploring! - - - - - - Feeds Bookmarks - - - - - Posted - - - - Wordpress bookmarks - - - - - Posted - - - - - diff --git a/hackatonApp/www/views/app/bookmarks.html b/hackatonApp/www/views/app/bookmarks.html index eefe39d..e69de29 100644 --- a/hackatonApp/www/views/app/bookmarks.html +++ b/hackatonApp/www/views/app/bookmarks.html @@ -1,35 +0,0 @@ - - - Bookmarks - - - - - - - There's nothing here yet. Start exploring! - - - - - - Feeds Bookmarks - - - - - Posted - - - - Wordpress bookmarks - - - - - Posted - - - - - diff --git a/hackatonApp/www/views/app/category-entries.html b/hackatonApp/www/views/app/category-entries.html new file mode 100644 index 0000000..22da492 --- /dev/null +++ b/hackatonApp/www/views/app/category-entries.html @@ -0,0 +1,8 @@ + + + {{entriesTitle | capitalize}} + + + + + diff --git a/hackatonApp/www/views/app/category.html b/hackatonApp/www/views/app/category.html index de8be83..43c3b54 100644 --- a/hackatonApp/www/views/app/category.html +++ b/hackatonApp/www/views/app/category.html @@ -1,48 +1,21 @@ - - + - Settings + {{categoryTitle}} - - - TOGGLE - - Airplane Mode - Wi-Fi - Bluetooth - Personal Hotspot - - CHECKBOXES - - Option 1 - Option 2 - Option 3 - - RADIO - - Choose A - Choose B - Choose C - - RANGES - - - - - - - - - - - - - - - - Logout - - + + + + + + + + + {{source.title}} + {{source.description}} + + + + diff --git a/hackatonApp/www/views/app/settings.html b/hackatonApp/www/views/app/settings.html index 42d7a22..6be2cce 100644 --- a/hackatonApp/www/views/app/settings.html +++ b/hackatonApp/www/views/app/settings.html @@ -3,7 +3,7 @@ - Settings + fvvv diff --git a/hackatonApp/www/views/app/side-menu.html b/hackatonApp/www/views/app/side-menu.html index 116b457..922a8b8 100644 --- a/hackatonApp/www/views/app/side-menu.html +++ b/hackatonApp/www/views/app/side-menu.html @@ -24,7 +24,7 @@ Tutti i biglietti - + Impostazioni
Posted
{{source.description}}