mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01:00
Can show card on event click
This commit is contained in:
parent
3c4549fe64
commit
374e986579
2 changed files with 26 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue