mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
My Cards development
* always go to page * use minicard for displaying cards * change the icon for my cards menu option
This commit is contained in:
parent
885de88d35
commit
a58b27e9b0
5 changed files with 47 additions and 46 deletions
|
|
@ -24,6 +24,5 @@ template(name="myCards")
|
||||||
| {{_ 'list' }}:
|
| {{_ 'list' }}:
|
||||||
= list.title
|
= list.title
|
||||||
each card in list.cards
|
each card in list.cards
|
||||||
.card-title
|
a.minicard-wrapper.card-title(href="{{pathFor 'card' boardId=board.id slug=board.slug cardId=card._id }}")
|
||||||
| {{_ 'card' }}:
|
+minicard(card)
|
||||||
= card.title
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
const subManager = new SubsManager();
|
const subManager = new SubsManager();
|
||||||
// import Cards from '../../../models/cards';
|
|
||||||
Meteor.subscribe('myCards');
|
Meteor.subscribe('myCards');
|
||||||
Meteor.subscribe('mySwimlanes');
|
Meteor.subscribe('mySwimlanes');
|
||||||
Meteor.subscribe('myLists');
|
Meteor.subscribe('myLists');
|
||||||
|
|
@ -31,17 +30,6 @@ BlazeComponent.extendComponent({
|
||||||
// subManager.subscribe('myCards');
|
// subManager.subscribe('myCards');
|
||||||
},
|
},
|
||||||
|
|
||||||
boards() {
|
|
||||||
boards = [];
|
|
||||||
const cursor = Boards.find({
|
|
||||||
archived: false,
|
|
||||||
'members.userId': Meteor.userId(),
|
|
||||||
type: 'board',
|
|
||||||
});
|
|
||||||
|
|
||||||
return cursor;
|
|
||||||
},
|
|
||||||
|
|
||||||
cardsFind() {
|
cardsFind() {
|
||||||
const boards = [];
|
const boards = [];
|
||||||
let board = null;
|
let board = null;
|
||||||
|
|
@ -63,11 +51,7 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('cursor:', cursor);
|
// console.log('cursor:', cursor);
|
||||||
// let card = null;
|
|
||||||
// if (cursor.hasNext()) {
|
|
||||||
// card = cursor.next();
|
|
||||||
// }
|
|
||||||
|
|
||||||
let newBoard = false;
|
let newBoard = false;
|
||||||
let newSwimlane = false;
|
let newSwimlane = false;
|
||||||
|
|
@ -75,10 +59,10 @@ BlazeComponent.extendComponent({
|
||||||
|
|
||||||
cursor.forEach(card => {
|
cursor.forEach(card => {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('card:', card.title);
|
// console.log('card:', card.title);
|
||||||
if (list === null || list.id !== card.listId) {
|
if (list === null || list.id !== card.listId) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('new list');
|
// console.log('new list');
|
||||||
let l = Lists.findOne(card.listId);
|
let l = Lists.findOne(card.listId);
|
||||||
if (!l) {
|
if (!l) {
|
||||||
l = {
|
l = {
|
||||||
|
|
@ -87,7 +71,7 @@ BlazeComponent.extendComponent({
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('list:', l);
|
// console.log('list:', l);
|
||||||
list = {
|
list = {
|
||||||
id: l._id,
|
id: l._id,
|
||||||
title: l.title,
|
title: l.title,
|
||||||
|
|
@ -97,7 +81,7 @@ BlazeComponent.extendComponent({
|
||||||
}
|
}
|
||||||
if (swimlane === null || card.swimlaneId !== swimlane.id) {
|
if (swimlane === null || card.swimlaneId !== swimlane.id) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('new swimlane');
|
// console.log('new swimlane');
|
||||||
let s = Swimlanes.findOne(card.swimlaneId);
|
let s = Swimlanes.findOne(card.swimlaneId);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
s = {
|
s = {
|
||||||
|
|
@ -106,7 +90,7 @@ BlazeComponent.extendComponent({
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('swimlane:', s);
|
// console.log('swimlane:', s);
|
||||||
swimlane = {
|
swimlane = {
|
||||||
id: s._id,
|
id: s._id,
|
||||||
title: s.title,
|
title: s.title,
|
||||||
|
|
@ -116,13 +100,14 @@ BlazeComponent.extendComponent({
|
||||||
}
|
}
|
||||||
if (board === null || card.boardId !== board.id) {
|
if (board === null || card.boardId !== board.id) {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('new board');
|
// console.log('new board');
|
||||||
const b = Boards.findOne(card.boardId);
|
const b = Boards.findOne(card.boardId);
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('board:', b, b._id, b.title);
|
// console.log('board:', b, b._id, b.title);
|
||||||
board = {
|
board = {
|
||||||
id: b._id,
|
id: b._id,
|
||||||
title: b.title,
|
title: b.title,
|
||||||
|
slug: b.slug,
|
||||||
swimlanes: [swimlane],
|
swimlanes: [swimlane],
|
||||||
};
|
};
|
||||||
newBoard = true;
|
newBoard = true;
|
||||||
|
|
@ -138,15 +123,31 @@ BlazeComponent.extendComponent({
|
||||||
list.cards.push(card);
|
list.cards.push(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
// card = cursor.hasNext() ? cursor.next() : null;
|
|
||||||
|
|
||||||
newBoard = false;
|
newBoard = false;
|
||||||
newSwimlane = false;
|
newSwimlane = false;
|
||||||
newList = false;
|
newList = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('boards:', boards);
|
// console.log('boards:', boards);
|
||||||
return boards;
|
return boards;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
events() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
'click .js-my-card'(evt) {
|
||||||
|
const card = this.currentData().card;
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('currentData():', this.currentData());
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('card:', card);
|
||||||
|
if (card) {
|
||||||
|
Utils.goCardId(card._id);
|
||||||
|
}
|
||||||
|
evt.preventDefault();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
}).register('myCards');
|
}).register('myCards');
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@
|
||||||
margin: 5px
|
margin: 5px
|
||||||
|
|
||||||
.board-title
|
.board-title
|
||||||
font-size: 1.4em
|
font-size: 1.4rem
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
|
|
||||||
.swimlane-title
|
.swimlane-title
|
||||||
font-size: 1.2em
|
font-size: 1.2rem
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
margin-left: 1em
|
margin-left: 1em
|
||||||
margin-top: 10px
|
margin-top: 10px
|
||||||
|
|
@ -32,8 +32,9 @@
|
||||||
.list-title
|
.list-title
|
||||||
margin-top: 5px
|
margin-top: 5px
|
||||||
font-weight: bold
|
font-weight: bold
|
||||||
margin-left: 1.6em
|
margin-left: 1.6rem
|
||||||
|
|
||||||
.card-title
|
.card-title
|
||||||
margin-top: 5px
|
margin-top: 5px
|
||||||
margin-left: 1.8em
|
margin-left: 1.8rem
|
||||||
|
max-width: 350px;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ template(name="memberMenuPopup")
|
||||||
with currentUser
|
with currentUser
|
||||||
li
|
li
|
||||||
a.js-my-cards(href="{{pathFor 'my-cards'}}")
|
a.js-my-cards(href="{{pathFor 'my-cards'}}")
|
||||||
i.fa.fa-user
|
i.fa.fa-list
|
||||||
| {{_ 'my-cards'}}
|
| {{_ 'my-cards'}}
|
||||||
li
|
li
|
||||||
a.js-edit-profile
|
a.js-edit-profile
|
||||||
|
|
|
||||||
|
|
@ -125,17 +125,17 @@ FlowRouter.route('/my-cards', {
|
||||||
Utils.manageCustomUI();
|
Utils.manageCustomUI();
|
||||||
Utils.manageMatomo();
|
Utils.manageMatomo();
|
||||||
|
|
||||||
if (previousPath) {
|
// if (previousPath) {
|
||||||
Modal.open(myCardsTemplate, {
|
// Modal.open(myCardsTemplate, {
|
||||||
header: 'myCardsModalTitle',
|
// header: 'myCardsModalTitle',
|
||||||
onCloseGoTo: previousPath,
|
// onCloseGoTo: previousPath,
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
BlazeLayout.render('defaultLayout', {
|
BlazeLayout.render('defaultLayout', {
|
||||||
headerBar: 'myCardsHeaderBar',
|
headerBar: 'myCardsHeaderBar',
|
||||||
content: myCardsTemplate,
|
content: myCardsTemplate,
|
||||||
});
|
});
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue