mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
Refactor imported -> linked in components
This commit is contained in:
parent
6adfcb3513
commit
f76d8e47a8
11 changed files with 52 additions and 53 deletions
|
|
@ -188,11 +188,11 @@
|
|||
top: -@padding
|
||||
right: 17px
|
||||
|
||||
.import-board-wrapper
|
||||
.link-board-wrapper
|
||||
display: flex
|
||||
align-items: baseline
|
||||
|
||||
.js-import-board
|
||||
.js-link-board
|
||||
margin-left: 15px
|
||||
|
||||
.search-card-results
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ template(name="addCardForm")
|
|||
button.primary.confirm(type="submit") {{_ 'add'}}
|
||||
span.quiet
|
||||
| {{_ 'or'}}
|
||||
a.js-import {{_ 'import'}}
|
||||
a.js-link {{_ 'link'}}
|
||||
span.quiet
|
||||
|
|
||||
| /
|
||||
|
|
@ -46,16 +46,16 @@ template(name="autocompleteLabelLine")
|
|||
.minicard-label(class="card-label-{{colorName}}" title=labelName)
|
||||
span(class="{{#if hasNoName}}quiet{{/if}}")= labelName
|
||||
|
||||
template(name="importCardPopup")
|
||||
template(name="linkCardPopup")
|
||||
label {{_ 'boards'}}:
|
||||
.import-board-wrapper
|
||||
.link-board-wrapper
|
||||
select.js-select-boards
|
||||
each boards
|
||||
if $eq _id currentBoard._id
|
||||
option(value="{{_id}}" selected) {{_ 'current'}}
|
||||
else
|
||||
option(value="{{_id}}") {{title}}
|
||||
input.primary.confirm.js-import-board(type="button" value="{{_ 'import'}}")
|
||||
input.primary.confirm.js-link-board(type="button" value="{{_ 'link'}}")
|
||||
|
||||
label {{_ 'swimlanes'}}:
|
||||
select.js-select-swimlanes
|
||||
|
|
@ -73,11 +73,11 @@ template(name="importCardPopup")
|
|||
option(value="{{_id}}") {{title}}
|
||||
|
||||
.edit-controls.clearfix
|
||||
input.primary.confirm.js-done(type="button" value="{{_ 'import'}}")
|
||||
input.primary.confirm.js-done(type="button" value="{{_ 'link'}}")
|
||||
|
||||
template(name="searchCardPopup")
|
||||
label {{_ 'boards'}}:
|
||||
.import-board-wrapper
|
||||
.link-board-wrapper
|
||||
select.js-select-boards
|
||||
each boards
|
||||
if $eq _id currentBoard._id
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ BlazeComponent.extendComponent({
|
|||
events() {
|
||||
return [{
|
||||
keydown: this.pressKey,
|
||||
'click .js-import': Popup.open('importCard'),
|
||||
'click .js-link': Popup.open('linkCard'),
|
||||
'click .js-search': Popup.open('searchCard'),
|
||||
}];
|
||||
},
|
||||
|
|
@ -338,8 +338,8 @@ BlazeComponent.extendComponent({
|
|||
swimlaneId: this.selectedSwimlaneId.get(),
|
||||
listId: this.selectedListId.get(),
|
||||
archived: false,
|
||||
importedId: null,
|
||||
_id: {$nin: this.board.cards().map((card) => { return card.importedId || card._id; })},
|
||||
linkedId: null,
|
||||
_id: {$nin: this.board.cards().map((card) => { return card.linkedId || card._id; })},
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -356,7 +356,7 @@ BlazeComponent.extendComponent({
|
|||
this.selectedListId.set($(evt.currentTarget).val());
|
||||
},
|
||||
'click .js-done' (evt) {
|
||||
// IMPORT CARD
|
||||
// LINK CARD
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
const _id = Cards.insert({
|
||||
|
|
@ -365,14 +365,14 @@ BlazeComponent.extendComponent({
|
|||
swimlaneId: this.swimlaneId,
|
||||
boardId: this.boardId,
|
||||
sort: Lists.findOne(this.listId).cards().count(),
|
||||
type: 'cardType-importedCard',
|
||||
importedId: $('.js-select-cards option:selected').val(),
|
||||
type: 'cardType-linkedCard',
|
||||
linkedId: $('.js-select-cards option:selected').val(),
|
||||
});
|
||||
Filter.addException(_id);
|
||||
Popup.close();
|
||||
},
|
||||
'click .js-import-board' (evt) {
|
||||
//IMPORT BOARD
|
||||
'click .js-link-board' (evt) {
|
||||
//LINK BOARD
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
const impBoardId = $('.js-select-boards option:selected').val();
|
||||
|
|
@ -382,15 +382,15 @@ BlazeComponent.extendComponent({
|
|||
swimlaneId: this.swimlaneId,
|
||||
boardId: this.boardId,
|
||||
sort: Lists.findOne(this.listId).cards().count(),
|
||||
type: 'cardType-importedBoard',
|
||||
importedId: impBoardId,
|
||||
type: 'cardType-linkedBoard',
|
||||
linkedId: impBoardId,
|
||||
});
|
||||
Filter.addException(_id);
|
||||
Popup.close();
|
||||
},
|
||||
}];
|
||||
},
|
||||
}).register('importCardPopup');
|
||||
}).register('linkCardPopup');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
mixins() {
|
||||
|
|
@ -452,7 +452,7 @@ BlazeComponent.extendComponent({
|
|||
this.term.set(evt.target.searchTerm.value);
|
||||
},
|
||||
'click .js-minicard'(evt) {
|
||||
// IMPORT CARD
|
||||
// LINK CARD
|
||||
const card = Blaze.getData(evt.currentTarget);
|
||||
const _id = Cards.insert({
|
||||
title: card.title, //dummy
|
||||
|
|
@ -460,8 +460,8 @@ BlazeComponent.extendComponent({
|
|||
swimlaneId: this.swimlaneId,
|
||||
boardId: this.boardId,
|
||||
sort: Lists.findOne(this.listId).cards().count(),
|
||||
type: 'cardType-importedCard',
|
||||
importedId: card._id,
|
||||
type: 'cardType-linkedCard',
|
||||
linkedId: card._id,
|
||||
});
|
||||
Filter.addException(_id);
|
||||
Popup.close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue