Can show card on event click

This commit is contained in:
Nicu Tofan 2018-06-27 22:37:32 +03:00
parent 3c4549fe64
commit 374e986579
No known key found for this signature in database
GPG key ID: 7EE66E95E64FD0B7
2 changed files with 26 additions and 2 deletions

View file

@ -29,7 +29,7 @@ template(name="boardBody")
+calendarView
template(name="calendarView")
.swimlane.list-group.js-lists
.calendar-view.swimlane
if currentCard
+cardDetails(currentCard)
+fullcalendar
+fullcalendar(calendarOptions)

View file

@ -150,4 +150,28 @@ BlazeComponent.extendComponent({
onRendered() {
},
calendarOptions() {
return {
id: 'calendar-view',
defaultView: 'basicWeek',
events(start, end, timezone, callback) {
const currentBoard = Boards.findOne(Session.get('currentBoard'));
const events = [];
currentBoard.cardsInInterval(start.toDate(), end.toDate()).forEach(function(card){
events.push({
id: card.id,
title: card.title,
start: card.startAt,
end: card.endAt,
url: FlowRouter.url('card', {
boardId: currentBoard._id,
slug: currentBoard.slug,
cardId: card._id,
}),
});
});
callback(events);
},
};
},
}).register('calendarView');