Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ coderstv:chat
meteorhacks:kadira
cottz:publish-relations
manuelschoebel:ms-seo
pfafman:filesaver
1 change: 1 addition & 0 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ oauth2@1.1.2
observe-sequence@1.0.4
ordered-dict@1.0.2
patrickleet:tags@1.1.3
pfafman:filesaver@0.2.0_1
raix:handlebar-helpers@0.2.4
random@1.0.2
reactive-dict@1.0.5
Expand Down
23 changes: 23 additions & 0 deletions client/lib/ics-calendar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
ics = {};

ics.createFile = function (data) {
'use strict';
var calendar = 'BEGIN:VCALENDAR\r\n' +
'CALSCALE:GREGORIAN\r\n' +
'PRODID:-//CodersTV//Calendar CodersTV//EN\r\n' +
'VERSION:2.0\r\n' +
'BEGIN:VEVENT\r\n' +
'LOCATION:CodersTV - http://coderstv.com\r\n' +
'DTSTART;TZID=America/Sao_Paulo:'+ moment().add(1, 'day').format('YYYYMMDDTHHmmss') + '\r\n' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to detect TZ with moment with tz

'DTEND;TZID=America/Sao_Paulo:'+ moment().add(1, 'day').format('YYYYMMDDTHHmmss') + '\r\n' +
'DESCRIPTION: '+ data.description.substring(0, 50) + '\r\n' +
'SUMMARY:CodersTV - '+ data.title.substring(0, 25) + ' \r\n' +
'BEGIN:VALARM\r\n' +
'TRIGGER:-PT1H\r\n' +
'ACTION:DISPLAY\r\n' +
'END:VALARM\r\n' +
'ORGANIZER;CN="CodersTV":mailto:help@coderstv.com\r\n' +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The e-mail is contact@coderstv.com

'END:VEVENT\r\n' +
'END:VCALENDAR\r\n';
return calendar;
};
12 changes: 9 additions & 3 deletions client/views/agenda/agenda.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>
</div>
{{#if $eq owner $.Meteor.userId}}
<div class="row">
{{#if isActive}}
{{#if isActive}}
<button class="js-cancel-event btn btn-danger">Cancel this event</button>
{{else}}
<button class="js-uncancel-event btn btn-success">Undo cancel event</button>
Expand Down Expand Up @@ -65,13 +65,19 @@ <h3>{{profile.name}}</h3>
<div class="row well">
<h5>Share this event:</h5>
{{#with title}}
{{> shareit_twitter title=this}}
{{> shareit_twitter title=this}}
{{> shareit_fb title=this}}
{{> shareit_google title=this}}
{{/with}}
</div>
<div class="row well">
<h5>Add this event to your agenda:</h5>
<a class="large btn download-ics" href="#">
<i class="fa fa-download"></i> Download ics
</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div id="disqus_thread"></div>
Expand Down
16 changes: 11 additions & 5 deletions client/views/agenda/agenda.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Template.agenda.events({
},
'click .follow-coder': function (event) {
var coderId = Router.current().data().owner;

if (Meteor.user()) {
$(event.target).popover('hide');
} else {
Expand Down Expand Up @@ -51,6 +51,12 @@ Template.agenda.events({
var _id = Router.current().data()._id;

Schedule.uncancel(_id);
},
'click .download-ics': function(event) {
event.preventDefault();
var blob = new Blob([ics.createFile(this)],
{type: 'text/calendar;charset=UTF-8'});
return saveAs(blob, 'coderstv-calendar.ics');
}
});

Expand Down Expand Up @@ -104,7 +110,7 @@ Disqus.SSO = function () {

Session.set('disqusSSO', res);
window.disqus_config = function () {
this.page.identifier = Path();
this.page.identifier = Path();
this.page.url = Meteor.absoluteUrl() + Path().substr(1);
if (! _.isEmpty(res)) {
this.page.remote_auth_s3 = res.auth;
Expand All @@ -119,8 +125,8 @@ Disqus.reset = function () {
try {
DISQUS.reset({
reload: true,
config: function () {
this.page.identifier = Path();
config: function () {
this.page.identifier = Path();
this.page.url = Meteor.absoluteUrl() + Path().substr(1);
if (! _.isEmpty(disqusSSO)) {
this.page.remote_auth_s3 = disqusSSO.auth;
Expand All @@ -129,6 +135,6 @@ Disqus.reset = function () {
}
});
} catch (err) {

}
};