mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Link description
This commit is contained in:
parent
5644ef66af
commit
64367a01dd
7 changed files with 50 additions and 19 deletions
|
|
@ -109,10 +109,10 @@ template(name="cardDetails")
|
||||||
a.js-open-inlined-form {{_ 'view-it'}}
|
a.js-open-inlined-form {{_ 'view-it'}}
|
||||||
= ' - '
|
= ' - '
|
||||||
a.js-close-inlined-form {{_ 'discard'}}
|
a.js-close-inlined-form {{_ 'discard'}}
|
||||||
else if description
|
else if getDescription
|
||||||
h3.card-details-item-title {{_ 'description'}}
|
h3.card-details-item-title {{_ 'description'}}
|
||||||
+viewer
|
+viewer
|
||||||
= description
|
= getDescription
|
||||||
|
|
||||||
.card-details-items
|
.card-details-items
|
||||||
.card-details-item.card-details-item-name
|
.card-details-item.card-details-item-name
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,8 @@ BlazeComponent.extendComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
canModifyCard() {
|
canModifyCard() {
|
||||||
return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
|
return Meteor.user() && Meteor.user().isBoardMember() &&
|
||||||
|
!Meteor.user().isCommentOnly() && !this.currentData().isImported();
|
||||||
},
|
},
|
||||||
|
|
||||||
scrollParentContainer() {
|
scrollParentContainer() {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
template(name="minicard")
|
template(name="minicard")
|
||||||
.minicard(
|
.minicard(
|
||||||
class="{{#if importedCard}}imported-card{{/if}}"
|
class="{{#if isImportedCard}}imported-card{{/if}}"
|
||||||
class="{{#if importedBoard}}imported-board{{/if}}")
|
class="{{#if isImportedBoard}}imported-board{{/if}}")
|
||||||
if cover
|
if cover
|
||||||
.minicard-cover(style="background-image: url('{{cover.url}}');")
|
.minicard-cover(style="background-image: url('{{cover.url}}');")
|
||||||
if labels
|
if labels
|
||||||
|
|
@ -15,7 +15,7 @@ template(name="minicard")
|
||||||
if $eq 'prefix-with-parent' currentBoard.presentParentTask
|
if $eq 'prefix-with-parent' currentBoard.presentParentTask
|
||||||
.parent-prefix
|
.parent-prefix
|
||||||
| {{ parentCardName }}
|
| {{ parentCardName }}
|
||||||
if imported
|
if isImported
|
||||||
span.imported-icon.fa.fa-share-alt
|
span.imported-icon.fa.fa-share-alt
|
||||||
+viewer
|
+viewer
|
||||||
| {{ title }}
|
| {{ title }}
|
||||||
|
|
@ -67,8 +67,8 @@ template(name="minicard")
|
||||||
.badge(title="{{_ 'card-comments-title' comments.count }}")
|
.badge(title="{{_ 'card-comments-title' comments.count }}")
|
||||||
span.badge-icon.fa.fa-comment-o.badge-comment
|
span.badge-icon.fa.fa-comment-o.badge-comment
|
||||||
span.badge-text= comments.count
|
span.badge-text= comments.count
|
||||||
if description
|
if getDescription
|
||||||
.badge.badge-state-image-only(title=description)
|
.badge.badge-state-image-only(title=getDescription)
|
||||||
span.badge-icon.fa.fa-align-left
|
span.badge-icon.fa.fa-align-left
|
||||||
if attachments.count
|
if attachments.count
|
||||||
.badge
|
.badge
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,4 @@ BlazeComponent.extendComponent({
|
||||||
template() {
|
template() {
|
||||||
return 'minicard';
|
return 'minicard';
|
||||||
},
|
},
|
||||||
importedCard() {
|
|
||||||
return this.currentData().type === 'cardType-importedCard';
|
|
||||||
},
|
|
||||||
importedBoard() {
|
|
||||||
return this.currentData().type === 'cardType-importedBoard';
|
|
||||||
},
|
|
||||||
imported() {
|
|
||||||
return this.importedCard() || this.importedBoard();
|
|
||||||
},
|
|
||||||
}).register('minicard');
|
}).register('minicard');
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,8 @@ BlazeComponent.extendComponent({
|
||||||
archived: false,
|
archived: false,
|
||||||
'members.userId': Meteor.userId(),
|
'members.userId': Meteor.userId(),
|
||||||
_id: {$ne: Session.get('currentBoard')},
|
_id: {$ne: Session.get('currentBoard')},
|
||||||
|
}, {
|
||||||
|
sort: ['title'],
|
||||||
})._id;
|
})._id;
|
||||||
// Subscribe to this board
|
// Subscribe to this board
|
||||||
subManager.subscribe('board', boardId);
|
subManager.subscribe('board', boardId);
|
||||||
|
|
@ -370,6 +372,7 @@ BlazeComponent.extendComponent({
|
||||||
//IMPORT BOARD
|
//IMPORT BOARD
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
const impBoardId = $('.js-select-boards option:selected').val();
|
||||||
const _id = Cards.insert({
|
const _id = Cards.insert({
|
||||||
title: $('.js-select-boards option:selected').text(), //dummy
|
title: $('.js-select-boards option:selected').text(), //dummy
|
||||||
listId: this.listId,
|
listId: this.listId,
|
||||||
|
|
@ -377,7 +380,8 @@ BlazeComponent.extendComponent({
|
||||||
boardId: this.boardId,
|
boardId: this.boardId,
|
||||||
sort: Lists.findOne(this.listId).cards().count(),
|
sort: Lists.findOne(this.listId).cards().count(),
|
||||||
type: 'cardType-importedBoard',
|
type: 'cardType-importedBoard',
|
||||||
importedId: $('.js-select-boards option:selected').val(),
|
importedId: impBoardId,
|
||||||
|
description: Boards.findOne({_id: impBoardId}).description,
|
||||||
});
|
});
|
||||||
Filter.addException(_id);
|
Filter.addException(_id);
|
||||||
Popup.close();
|
Popup.close();
|
||||||
|
|
|
||||||
|
|
@ -393,6 +393,39 @@ Cards.helpers({
|
||||||
isTopLevel() {
|
isTopLevel() {
|
||||||
return this.parentId === '';
|
return this.parentId === '';
|
||||||
},
|
},
|
||||||
|
|
||||||
|
isImportedCard() {
|
||||||
|
return this.type === 'cardType-importedCard';
|
||||||
|
},
|
||||||
|
|
||||||
|
isImportedBoard() {
|
||||||
|
return this.type === 'cardType-importedBoard';
|
||||||
|
},
|
||||||
|
|
||||||
|
isImported() {
|
||||||
|
return this.isImportedCard() || this.isImportedBoard();
|
||||||
|
},
|
||||||
|
|
||||||
|
getDescription() {
|
||||||
|
if (this.isImportedCard()) {
|
||||||
|
const card = Cards.findOne({_id: this.importedId});
|
||||||
|
if (card && card.description)
|
||||||
|
return card.description;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
} else if (this.isImportedBoard()) {
|
||||||
|
const board = Boards.findOne({_id: this.importedId});
|
||||||
|
if (board && board.description)
|
||||||
|
return board.description;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
if (this.description)
|
||||||
|
return this.description;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Cards.mutations({
|
Cards.mutations({
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,9 @@ Meteor.publishRelations('board', function(boardId) {
|
||||||
//
|
//
|
||||||
// And in the meantime our code below works pretty well -- it's not even a
|
// And in the meantime our code below works pretty well -- it's not even a
|
||||||
// hack!
|
// hack!
|
||||||
this.cursor(Cards.find({ boardId }), function(cardId) {
|
this.cursor(Cards.find({ boardId }), function(cardId, card) {
|
||||||
|
this.cursor(Cards.find({_id: card.importedId}));
|
||||||
|
this.cursor(Boards.find({_id: card.importedId}));
|
||||||
this.cursor(CardComments.find({ cardId }));
|
this.cursor(CardComments.find({ cardId }));
|
||||||
this.cursor(Attachments.find({ cardId }));
|
this.cursor(Attachments.find({ cardId }));
|
||||||
this.cursor(Checklists.find({ cardId }));
|
this.cursor(Checklists.find({ cardId }));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue