summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorNicu Tofan <nicu.tofan@gmail.com>2018-06-26 22:11:51 +0300
committerNicu Tofan <nicu.tofan@gmail.com>2018-06-26 22:11:51 +0300
commit18467dfe40f2f715262b79c35f6084cc7814d363 (patch)
treef68864748c16ae17b2155ac0ed6c0223b87a00cc /client/components
parent226d25ca943e3be8256639f0fc9b517cb0c217a0 (diff)
downloadwekan-18467dfe40f2f715262b79c35f6084cc7814d363.tar.gz
wekan-18467dfe40f2f715262b79c35f6084cc7814d363.tar.bz2
wekan-18467dfe40f2f715262b79c35f6084cc7814d363.zip
Show cards in calendar
Diffstat (limited to 'client/components')
-rw-r--r--client/components/boards/boardBody.jade2
-rw-r--r--client/components/boards/boardBody.js56
2 files changed, 58 insertions, 0 deletions
diff --git a/client/components/boards/boardBody.jade b/client/components/boards/boardBody.jade
index 29a613b9..b480bc0f 100644
--- a/client/components/boards/boardBody.jade
+++ b/client/components/boards/boardBody.jade
@@ -25,3 +25,5 @@ template(name="boardBody")
+swimlane(this)
if isViewLists
+listsGroup
+ if isViewCalendar
+ +fullcalendar(calendarOptions)
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js
index a377dd73..935c550f 100644
--- a/client/components/boards/boardBody.js
+++ b/client/components/boards/boardBody.js
@@ -114,6 +114,62 @@ BlazeComponent.extendComponent({
}
},
+ calendarOptions() {
+ return {
+ id: 'calendar-view',
+ defaultView: 'basicWeek',
+ header: {
+ left: 'title',
+ center: 'agendaDay,listDay,timelineDay agendaWeek,listWeek,timelineWeek month,timelineMonth timelineYear',
+ right: 'today prev,next',
+ },
+ views: {
+ basic: {
+ // options apply to basicWeek and basicDay views
+ },
+ agenda: {
+ // options apply to agendaWeek and agendaDay views
+ },
+ week: {
+ // options apply to basicWeek and agendaWeek views
+ },
+ day: {
+ // options apply to basicDay and agendaDay views
+ },
+ },
+ themeSystem: 'jquery-ui',
+ height: 'parent',
+ /* TODO: lists as resources: https://fullcalendar.io/docs/vertical-resource-view */
+ navLinks: true,
+ nowIndicator: true,
+ businessHours: {
+ // days of week. an array of zero-based day of week integers (0=Sunday)
+ dow: [ 1, 2, 3, 4, 5 ], // Monday - Thursday
+ start: '8:00',
+ end: '18:00',
+ },
+ locale: TAPi18n.getLanguage(),
+ 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);
+ },
+ };
+ },
+
events() {
return [{
// XXX The board-overlay div should probably be moved to the parent