This repository has been archived by the owner on Sep 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from friedger/shorturl-event
add event page for short urls
- Loading branch information
Showing
9 changed files
with
263 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict'; | ||
|
||
angular.module('moment-timezone', []) | ||
.service('MomentTimezone', ['$http', function ($http) { | ||
var promise = $http.get("/bower_components/moment-timezone/moment-timezone.json").success(function(resp) { | ||
moment.tz.add(resp); | ||
}); | ||
return { | ||
promise: promise | ||
} | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
'use strict'; | ||
|
||
angular.module('fireflyApp') | ||
.directive('timeTimezone', ['$http', function($http) { | ||
return { | ||
restrict: 'E', | ||
template: '{{formatDate}}', | ||
scope: { | ||
date: "=", | ||
timezone: "=" | ||
}, | ||
link: function(scope, element, attrs) { | ||
|
||
var update = function upd() { | ||
if(scope.timezone && scope.date) { | ||
scope.formatDate = moment(scope.date).tz(scope.timezone).format('llll'); | ||
} | ||
}; | ||
|
||
scope.$watch('date', function(oldVal, newVal) { | ||
update(); | ||
}); | ||
|
||
scope.$watch('timezone', function(oldVal, newVal) { | ||
update(); | ||
}); | ||
} | ||
}; | ||
}]) | ||
.directive('timeAgo', ['$timeout', function($timeout) { | ||
return { | ||
restrict: 'E', | ||
template: '{{formatDate}}', | ||
scope: { | ||
date: "=" | ||
}, | ||
link: function(scope, element, attrs) { | ||
var promise = null; | ||
|
||
var update = function() { | ||
if(scope.date) { | ||
scope.formatDate = moment(scope.date).fromNow(); | ||
promise = $timeout(update, 60000, false); | ||
} | ||
}; | ||
|
||
scope.$watch('date', function(oldVal, newVal) { | ||
if(promise) { | ||
$timeout.cancel(promise); | ||
} | ||
update(); | ||
}); | ||
} | ||
}; | ||
}]) | ||
.directive('localTime', [function() { | ||
return { | ||
restrict: 'E', | ||
template: '{{formatDate}}', | ||
scope: { | ||
date: "=" | ||
}, | ||
link: function(scope, element, attrs) { | ||
var promise = promise; | ||
|
||
var update = function upd() { | ||
scope.formatDate = moment(scope.date).format('llll'); | ||
}; | ||
|
||
scope.$watch('date', function(oldVal, newVal) { | ||
update(); | ||
}); | ||
} | ||
}; | ||
}]) | ||
.directive('time', [function() { | ||
return { | ||
restrict: 'E', | ||
template: '{{formatDate}}', | ||
scope: { | ||
date: "=" | ||
}, | ||
link: function(scope, element, attrs) { | ||
var promise = promise; | ||
|
||
var update = function upd() { | ||
scope.formatDate = moment(scope.date).utc().format('llll'); | ||
}; | ||
|
||
scope.$watch('date', function(oldVal, newVal) { | ||
update(); | ||
}); | ||
} | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<div ng-include="'components/navbar/navbar.html'"></div> | ||
|
||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-9"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h3>{{event.title}} <small><time-ago date="event.start"></time-ago></small></h3> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<p> | ||
<div ng-bind-html="event.about | linkify"></div> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-4"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<h3><i class="fa fa-clock-o"></i> Your Time</h3> | ||
<p> | ||
<b>Begins:</b> <span><local-time date="event.start"></local-time></span><br/> | ||
<b>Ends:</b> <span><local-time date="event.end"></local-time></span> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<h3><i class="fa fa-clock-o"></i> Event Time</h3> | ||
<p> | ||
<b>Begins:</b> <span><time-timezone date="event.start" timezone="event.timezone"></time-timezone></span><br/> | ||
<b>Ends:</b> <span><time-timezone date="event.end" timezone="event.timezone"></time-timezone></span><br/> | ||
<b>Timezone:</b> {{event.timezone}} | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<h3><i class="fa fa-map-marker"></i> Location</h3> | ||
<p> | ||
{{event.location}}<br/><br/> | ||
<a ng-href="https://maps.google.com/maps?daddr={{event.location}}">Get directions</a> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-3"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h3>Hosted by</h3> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<p> | ||
<img ng-show="chapter._id != undefined" class="pull-right" style="margin-top: 11px;" ng-src="{{image}}"/> | ||
<h3><a ng-href="http://developers.google.com/groups/chapter/{{chapter._id}}/">{{chapter.name}}</a></h3> | ||
<span>{{chapter.city}}, {{chapter.country.name}}</span> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<h3>Event sites</h3> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<p> | ||
<div ng-switch on="!!event.eventUrl"> | ||
<div ng-switch-when="true"> | ||
<a ng-href="{{event.eventUrl}}">Google+ event page</a> | ||
</div> | ||
<div ng-switch-default>...</div> | ||
</div> | ||
<a ng-href="http://developers.google.com/events/{{event._id}}/">Google Developers' event page</a> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="card"> | ||
<div class="card-body"> | ||
<p> | ||
<div ng-switch on="!!event.geo"> | ||
<div ng-switch-when="true"> | ||
<google-map center="event.geo.center" zoom="event.geo.zoom"> | ||
<marker coords='event.geo'> | ||
|
||
</marker> | ||
</google-map> | ||
</div> | ||
<div ng-switch-default>...</div> | ||
</div> | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters