Skip to content

Commit

Permalink
step2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dayana committed Apr 19, 2015
1 parent e8d787b commit 296941e
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 133 deletions.
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script src="js/controllers.js"></script>
</head>

<body ng-app="starter">
<body ng-app="jsconfuy">
<ion-nav-view></ion-nav-view>
</body>
</html>
49 changes: 28 additions & 21 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
// 'starter' is the name of this angular module example (also set in a <body> 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() {
Expand All @@ -22,50 +25,54 @@ angular.module('starter', ['ionic', 'starter.controllers'])

.config(function($stateProvider, $urlRouterProvider) {
$stateProvider

.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html",
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');
});
63 changes: 19 additions & 44 deletions www/js/controllers.js
Original file line number Diff line number Diff line change
@@ -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) {
});
;
10 changes: 10 additions & 0 deletions www/templates/agenda.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ion-view class="agenda-view">
<ion-nav-title>
<span>Agenda</span>
</ion-nav-title>
<ion-content>
<h1>Agenda</h1>
<a ui-sref="app.event({eventId: 1})">This is an event</a>
<a ui-sref="app.event({eventId: 2})">This is other event</a>
</ion-content>
</ion-view>
5 changes: 0 additions & 5 deletions www/templates/browse.html

This file was deleted.

8 changes: 8 additions & 0 deletions www/templates/event.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ion-view class="event-view">
<ion-nav-title>
<span>Event</span>
</ion-nav-title>
<ion-content>
<h1>Event {{eventId}}</h1>
</ion-content>
</ion-view>
25 changes: 0 additions & 25 deletions www/templates/login.html

This file was deleted.

31 changes: 13 additions & 18 deletions www/templates/menu.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<ion-side-menus enable-menu-with-back-views="false">
<ion-side-menu-content>
<ion-nav-bar class="bar-stable">
<ion-nav-back-button>
</ion-nav-back-button>

<ion-nav-bar class="bar app-top-bar bar-positive">
<ion-nav-back-button></ion-nav-back-button>
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
Expand All @@ -12,23 +10,20 @@
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>

<ion-side-menu side="left">
<ion-header-bar class="bar-stable">
<h1 class="title">Left</h1>
</ion-header-bar>
<ion-content>
<ion-side-menu class="main-menu" side="left">
<ion-content scroll="false">
<ion-list>
<ion-item nav-clear menu-close ng-click="login()">
Login
</ion-item>
<ion-item nav-clear menu-close href="#/app/search">
Search
<ion-item class="item item-icon-left" nav-clear menu-close ui-sref="app.agenda">
<i class="icon ion-calendar"></i>
<h2 class="menu-text">Agenda</h2>
</ion-item>
<ion-item nav-clear menu-close href="#/app/browse">
Browse
<ion-item class="item item-icon-left" nav-clear menu-close ui-sref="app.speakers">
<i class="icon ion-speakerphone"></i>
<h2 class="menu-text">Speakers</h2>
</ion-item>
<ion-item nav-clear menu-close href="#/app/playlists">
Playlists
<ion-item class="item item-icon-left" nav-clear menu-close ui-sref="app.venue">
<i class="icon ion-ios-location"></i>
<h2 class="menu-text">Venue</h2>
</ion-item>
</ion-list>
</ion-content>
Expand Down
18 changes: 18 additions & 0 deletions www/templates/partials/agenda-event.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="row">
<div class="col event-time">
<span class="time-from">{{event.time_from}}</span>
<span ng-show="event.time_to" class="time-to">to {{event.time_to}}</span>
</div>
<a ng-if="event.type !== 'global'" class="col col-75 event-content {{event.type}}" style="background-image:url({{event.background_img}})" ui-sref="app.event({eventId: event.id})">
<p class="event-title" ng-bind-html="event.title"></p>
<p class="event-speakers" ng-show="{{ event.speakers }}">
<span ng-repeat="speaker in event.speakers">{{speaker.name}}{{$last ? '' : ', '}}</span>
</p>
<p class="event-room" ng-show="event.room">{{event.room}}</p>
<div class="event-type-tag {{event.type+'-event'}}">{{event.type}}</div>
</a>
<div ng-if="event.type === 'global'" class="col col-75 event-content {{event.type}}">
<p class="event-title" ng-bind-html="event.title"></p>
<p class="event-room">{{event.room}}</p>
</div>
</div>
5 changes: 0 additions & 5 deletions www/templates/playlist.html

This file was deleted.

9 changes: 0 additions & 9 deletions www/templates/playlists.html

This file was deleted.

5 changes: 0 additions & 5 deletions www/templates/search.html

This file was deleted.

8 changes: 8 additions & 0 deletions www/templates/speakers.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ion-view class="speakers-view">
<ion-nav-title>
<span>Speakers</span>
</ion-nav-title>
<ion-content>
<h1>Speakers</h1>
</ion-content>
</ion-view>
8 changes: 8 additions & 0 deletions www/templates/venue.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ion-view class="venue-view">
<ion-nav-title>
<span>Venue</span>
</ion-nav-title>
<ion-content>
<h1>Venue</h1>
</ion-content>
</ion-view>

0 comments on commit 296941e

Please sign in to comment.