From 296941e4424e3f3a4b4c0bd8d3b1d9f24e807dc1 Mon Sep 17 00:00:00 2001 From: Dayana Date: Sun, 19 Apr 2015 20:45:30 -0300 Subject: [PATCH] step2 --- www/index.html | 2 +- www/js/app.js | 49 ++++++++++-------- www/js/controllers.js | 63 +++++++----------------- www/templates/agenda.html | 10 ++++ www/templates/browse.html | 5 -- www/templates/event.html | 8 +++ www/templates/login.html | 25 ---------- www/templates/menu.html | 31 +++++------- www/templates/partials/agenda-event.html | 18 +++++++ www/templates/playlist.html | 5 -- www/templates/playlists.html | 9 ---- www/templates/search.html | 5 -- www/templates/speakers.html | 8 +++ www/templates/venue.html | 8 +++ 14 files changed, 113 insertions(+), 133 deletions(-) create mode 100644 www/templates/agenda.html delete mode 100644 www/templates/browse.html create mode 100644 www/templates/event.html delete mode 100644 www/templates/login.html create mode 100644 www/templates/partials/agenda-event.html delete mode 100644 www/templates/playlist.html delete mode 100644 www/templates/playlists.html delete mode 100644 www/templates/search.html create mode 100644 www/templates/speakers.html create mode 100644 www/templates/venue.html diff --git a/www/index.html b/www/index.html index 0b96b0f..5931af7 100644 --- a/www/index.html +++ b/www/index.html @@ -20,7 +20,7 @@ - + diff --git a/www/js/app.js b/www/js/app.js index 8c65a85..1597ab4 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -4,7 +4,10 @@ // 'starter' is the name of this angular module example (also set in a attribute in index.html) // the 2nd parameter is an array of 'requires' // 'starter.controllers' is found in controllers.js -angular.module('starter', ['ionic', 'starter.controllers']) +angular.module('jsconfuy', [ + 'ionic', + 'jsconfuy.controllers' +]) .run(function($ionicPlatform) { $ionicPlatform.ready(function() { @@ -22,7 +25,7 @@ angular.module('starter', ['ionic', 'starter.controllers']) .config(function($stateProvider, $urlRouterProvider) { $stateProvider - + .state('app', { url: "/app", abstract: true, @@ -30,42 +33,46 @@ angular.module('starter', ['ionic', 'starter.controllers']) controller: 'AppCtrl' }) - .state('app.search', { - url: "/search", + .state('app.speakers', { + url: "/speakers", views: { 'menuContent': { - templateUrl: "templates/search.html" + templateUrl: "templates/speakers.html", + controller: 'SpeakersCtrl' } } }) - .state('app.browse', { - url: "/browse", + .state('app.venue', { + url: "/venue", views: { 'menuContent': { - templateUrl: "templates/browse.html" + templateUrl: "templates/venue.html", + controller: 'VenueCtrl' } } }) - .state('app.playlists', { - url: "/playlists", - views: { - 'menuContent': { - templateUrl: "templates/playlists.html", - controller: 'PlaylistsCtrl' - } + + .state('app.agenda', { + url: "/agenda", + views: { + 'menuContent': { + templateUrl: "templates/agenda.html", + controller: 'AgendaCtrl' } - }) + } + }) - .state('app.single', { - url: "/playlists/:playlistId", + .state('app.event', { + url: "/event/:eventId", views: { 'menuContent': { - templateUrl: "templates/playlist.html", - controller: 'PlaylistCtrl' + templateUrl: "templates/event.html", + controller: 'EventCtrl' } } }); + // if none of the above states are matched, use this as the fallback - $urlRouterProvider.otherwise('/app/playlists'); + $urlRouterProvider.otherwise('/app/agenda'); }); diff --git a/www/js/controllers.js b/www/js/controllers.js index 5f1ff0a..f05b4eb 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -1,48 +1,23 @@ -angular.module('starter.controllers', []) - -.controller('AppCtrl', function($scope, $ionicModal, $timeout) { - // Form data for the login modal - $scope.loginData = {}; - - // Create the login modal that we will use later - $ionicModal.fromTemplateUrl('templates/login.html', { - scope: $scope - }).then(function(modal) { - $scope.modal = modal; - }); - - // Triggered in the login modal to close it - $scope.closeLogin = function() { - $scope.modal.hide(); - }; - - // Open the login modal - $scope.login = function() { - $scope.modal.show(); - }; - - // Perform the login action when the user submits the login form - $scope.doLogin = function() { - console.log('Doing login', $scope.loginData); - - // Simulate a login delay. Remove this and replace with your login - // code if using a login system - $timeout(function() { - $scope.closeLogin(); - }, 1000); - }; +angular.module('jsconfuy.controllers', []) + +.controller('AppCtrl', function($scope) { + +}) + +.controller('SpeakersCtrl', function($scope) { + +}) + +.controller('VenueCtrl', function($scope) { + +}) + +.controller('AgendaCtrl', function($scope) { + }) -.controller('PlaylistsCtrl', function($scope) { - $scope.playlists = [ - { title: 'Reggae', id: 1 }, - { title: 'Chill', id: 2 }, - { title: 'Dubstep', id: 3 }, - { title: 'Indie', id: 4 }, - { title: 'Rap', id: 5 }, - { title: 'Cowbell', id: 6 } - ]; +.controller('EventCtrl', function($scope, $stateParams) { + $scope.eventId = $stateParams.eventId; }) -.controller('PlaylistCtrl', function($scope, $stateParams) { -}); +; diff --git a/www/templates/agenda.html b/www/templates/agenda.html new file mode 100644 index 0000000..5e1cbe9 --- /dev/null +++ b/www/templates/agenda.html @@ -0,0 +1,10 @@ + + + Agenda + + +

Agenda

+ This is an event + This is other event +
+
diff --git a/www/templates/browse.html b/www/templates/browse.html deleted file mode 100644 index 28a2d56..0000000 --- a/www/templates/browse.html +++ /dev/null @@ -1,5 +0,0 @@ - - -

Browse

-
-
diff --git a/www/templates/event.html b/www/templates/event.html new file mode 100644 index 0000000..74b3324 --- /dev/null +++ b/www/templates/event.html @@ -0,0 +1,8 @@ + + + Event + + +

Event {{eventId}}

+
+
diff --git a/www/templates/login.html b/www/templates/login.html deleted file mode 100644 index 793bd7f..0000000 --- a/www/templates/login.html +++ /dev/null @@ -1,25 +0,0 @@ - - -

Login

-
- -
-
- -
-
- - - -
-
-
-
diff --git a/www/templates/menu.html b/www/templates/menu.html index 4e69dd1..a445058 100644 --- a/www/templates/menu.html +++ b/www/templates/menu.html @@ -1,9 +1,7 @@ - - - - + + @@ -12,23 +10,20 @@ - - -

Left

-
- + + - - Login - - - Search + + + - - Browse + + + - - Playlists + + + diff --git a/www/templates/partials/agenda-event.html b/www/templates/partials/agenda-event.html new file mode 100644 index 0000000..7194129 --- /dev/null +++ b/www/templates/partials/agenda-event.html @@ -0,0 +1,18 @@ +
+
+ {{event.time_from}} + to {{event.time_to}} +
+ +

+

+ {{speaker.name}}{{$last ? '' : ', '}} +

+

{{event.room}}

+
{{event.type}}
+
+
+

+

{{event.room}}

+
+
diff --git a/www/templates/playlist.html b/www/templates/playlist.html deleted file mode 100644 index 8a62cfc..0000000 --- a/www/templates/playlist.html +++ /dev/null @@ -1,5 +0,0 @@ - - -

Playlist

-
-
diff --git a/www/templates/playlists.html b/www/templates/playlists.html deleted file mode 100644 index eb77388..0000000 --- a/www/templates/playlists.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - {{playlist.title}} - - - - diff --git a/www/templates/search.html b/www/templates/search.html deleted file mode 100644 index 7482416..0000000 --- a/www/templates/search.html +++ /dev/null @@ -1,5 +0,0 @@ - - -

Search

-
-
diff --git a/www/templates/speakers.html b/www/templates/speakers.html new file mode 100644 index 0000000..d106f8c --- /dev/null +++ b/www/templates/speakers.html @@ -0,0 +1,8 @@ + + + Speakers + + +

Speakers

+
+
diff --git a/www/templates/venue.html b/www/templates/venue.html new file mode 100644 index 0000000..f5db21e --- /dev/null +++ b/www/templates/venue.html @@ -0,0 +1,8 @@ + + + Venue + + +

Venue

+
+