Skip to content

Commit 73cec82

Browse files
author
Dayana
committed
step7
1 parent 14dd74a commit 73cec82

File tree

3 files changed

+53
-6
lines changed

3 files changed

+53
-6
lines changed

www/js/controllers.js

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ angular.module('jsconfuy.controllers', [])
44

55
})
66

7-
.controller('SpeakersCtrl', function($scope, $http, Speakers) {
7+
.controller('SpeakersCtrl', function($scope, $http, Speakers, $ionicLoading) {
88
$scope.speakers = [];
99

10+
$ionicLoading.show({
11+
template: 'Loading...'
12+
});
13+
1014
Speakers.get()
1115
.then(function(speakers){
1216
$scope.speakers = speakers;
17+
$ionicLoading.hide();
1318
},function(err){
19+
$ionicLoading.hide();
1420
});
21+
22+
$scope.goToUrl = function(url){
23+
//use inAppBrowser plugin
24+
window.open(url, '_blank', 'location=yes');
25+
}
1526
})
1627

1728
.controller('VenueCtrl', function($scope) {
@@ -27,23 +38,49 @@ angular.module('jsconfuy.controllers', [])
2738
})
2839

2940

30-
.controller('AgendaCtrl', function($scope, Agenda) {
41+
.controller('AgendaCtrl', function($scope, Agenda, $ionicLoading) {
3142
$scope.events = [];
3243

44+
$ionicLoading.show({
45+
template: 'Loading...'
46+
});
47+
3348
Agenda.get()
3449
.then(function(events){
3550
$scope.events = events;
51+
$ionicLoading.hide();
3652
},function(err){
53+
$ionicLoading.hide();
3754
});
3855
})
3956

40-
.controller('EventCtrl', function($scope, Agenda, $stateParams) {
57+
.controller('EventCtrl', function($scope, Agenda, $stateParams, $ionicLoading) {
4158
var eventId = $stateParams.eventId;
4259

60+
$ionicLoading.show({
61+
template: 'Loading...'
62+
});
63+
4364
Agenda.getEvent(eventId)
4465
.then(function(event){
4566
$scope.event = event;
67+
$ionicLoading.hide();
4668
},function(err){
69+
$ionicLoading.hide();
4770
});
4871

72+
$scope.shareEvent = function(event){
73+
var speakersText = "";
74+
75+
_.each(event.speakers, function(speaker, index){
76+
speakersText += speaker.name;
77+
if((index+1) < event.speakers.length){
78+
speakersText += " & ";
79+
}
80+
});
81+
82+
var messageToShare = event.title + " by " + speakersText + " at #JSConfUY";
83+
window.plugins.socialsharing.share(messageToShare);
84+
};
85+
4986
})

www/templates/event.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
<ion-view class="event-view">
2+
<ion-nav-buttons side="right">
3+
<a class="button button-icon icon ion-share" ng-click="shareEvent(event)"></a>
4+
</ion-nav-buttons>
25
<ion-nav-title>
36
<span>{{event.type}}</span>
47
</ion-nav-title>
58
<ion-content>
6-
<img ng-src="{{event.speakers[0].image}}"/>
9+
<ion-slide-box ng-show="event.speakers.length > 1" auto-play="true" does-continue="true">
10+
<ion-slide ng-repeat="speaker in event.speakers">
11+
<div style="width:100vw; overflow:hidden;">
12+
<img ng-src="{{speaker.image}}"/>
13+
</div>
14+
</ion-slide>
15+
</ion-slide-box>
16+
<img ng-show="event.speakers.length == 1" ng-src="{{event.speakers[0].image}}"/>
717
<div>
818
<span ng-bind-html="event.title"></span>
919
<span ng-show="event.speakers">By

www/templates/speakers.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ <h2>{{speaker.name}}</h2>
1414
<p ng-bind-html="speaker.bio | rawHtml">
1515
<div>
1616
<div class="row">
17-
<div class="col">
18-
<a href="" class="button button-small button-outline button-block button-positive">@{{speaker.twitter}}</a>
17+
<div ng-if="speaker.twitter" class="col">
18+
<a href="" ng-click="goToUrl('http://twitter.com/{{speaker.twitter}}')" class="button button-small button-outline button-block button-positive">@{{speaker.twitter}}</a>
1919
</div>
2020
<div class="col">
2121
<a ui-sref="app.event({eventId: speaker.event_id})" class="button button-small button-outline button-block button-positive">My talk</a>

0 commit comments

Comments
 (0)