mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Prepare to create card from template
This commit is contained in:
parent
7a6afb8aea
commit
0fec711545
7 changed files with 57 additions and 60 deletions
|
|
@ -96,11 +96,9 @@ template(name="searchCardPopup")
|
|||
label {{_ 'boards'}}:
|
||||
.link-board-wrapper
|
||||
select.js-select-boards
|
||||
option(value="")
|
||||
each boards
|
||||
if $eq _id currentBoard._id
|
||||
option(value="{{_id}}" selected) {{_ 'current'}}
|
||||
else
|
||||
option(value="{{_id}}") {{title}}
|
||||
option(value="{{_id}}") {{title}}
|
||||
form.js-search-term-form
|
||||
input(type="text" name="searchTerm" placeholder="{{_ 'search-example'}}" autofocus)
|
||||
.list-body.js-perfect-scrollbar.search-card-results
|
||||
|
|
|
|||
|
|
@ -456,6 +456,7 @@ BlazeComponent.extendComponent({
|
|||
archived: false,
|
||||
linkedId: {$nin: ownCardsIds},
|
||||
_id: {$nin: ownCardsIds},
|
||||
type: {$nin: ['template-card']},
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -523,16 +524,16 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
|
||||
onCreated() {
|
||||
const isTemplateSearch = $(Popup._getTopStack().openerElement).hasClass('js-search-template');
|
||||
this.isTemplateSearch = $(Popup._getTopStack().openerElement).hasClass('js-search-template');
|
||||
let board = {};
|
||||
if (isTemplateSearch) {
|
||||
if (this.isTemplateSearch) {
|
||||
board = Boards.findOne(Meteor.user().profile.templatesBoardId);
|
||||
} else {
|
||||
// Prefetch first non-current board id
|
||||
board = Boards.findOne({
|
||||
archived: false,
|
||||
'members.userId': Meteor.userId(),
|
||||
_id: {$ne: Session.get('currentBoard')},
|
||||
_id: {$nin: [Session.get('currentBoard'), Meteor.user().profile.templatesBoardId]},
|
||||
});
|
||||
}
|
||||
if (!board) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue