From 374e9865792dd8219d1d7d10fcc23f98ed7c5817 Mon Sep 17 00:00:00 2001 From: Nicu Tofan Date: Wed, 27 Jun 2018 22:37:32 +0300 Subject: Can show card on event click --- client/components/boards/boardBody.jade | 4 ++-- client/components/boards/boardBody.js | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/client/components/boards/boardBody.jade b/client/components/boards/boardBody.jade index 0a454e92..9e4b9c61 100644 --- a/client/components/boards/boardBody.jade +++ b/client/components/boards/boardBody.jade @@ -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) diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index 911b0120..1308c280 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -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'); -- cgit v1.2.3-1-g7c22