mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 16:30:13 +01:00
Merge branch 'GhassenRjab-feature/copy-move-cards-x-boards' into devel
Copy/Move card to another board in Standalone Wekan. Thanks to GhassenRjab and thuanpq ! Closes #797
This commit is contained in:
commit
06afa1ae35
4 changed files with 70 additions and 3 deletions
|
|
@ -1,3 +1,11 @@
|
||||||
|
# Upcoming Wekan release
|
||||||
|
|
||||||
|
This release adds the following new features:
|
||||||
|
|
||||||
|
* [Copy/Move cards to other board in Standalone Wekan](https://github.com/wekan/wekan/pull/1330).
|
||||||
|
|
||||||
|
Thanks to GitHub users GhassenRjab and thuanpq for their contributions.
|
||||||
|
|
||||||
# v0.55 2017-11-19 Wekan release
|
# v0.55 2017-11-19 Wekan release
|
||||||
|
|
||||||
This release adds the following new features:
|
This release adds the following new features:
|
||||||
|
|
|
||||||
|
|
@ -132,14 +132,36 @@ template(name="cardDetailsActionsPopup")
|
||||||
li: a.js-more {{_ 'cardMorePopup-title'}}
|
li: a.js-more {{_ 'cardMorePopup-title'}}
|
||||||
|
|
||||||
template(name="moveCardPopup")
|
template(name="moveCardPopup")
|
||||||
|
if isSandstorm
|
||||||
+boardLists
|
+boardLists
|
||||||
|
else
|
||||||
|
+boardsAndLists
|
||||||
|
|
||||||
template(name="copyCardPopup")
|
template(name="copyCardPopup")
|
||||||
label(for='copy-card-title') {{_ 'title'}}:
|
label(for='copy-card-title') {{_ 'title'}}:
|
||||||
textarea#copy-card-title.minicard-composer-textarea.js-card-title(autofocus)
|
textarea#copy-card-title.minicard-composer-textarea.js-card-title(autofocus)
|
||||||
= title
|
= title
|
||||||
label {{_ 'lists'}}:
|
if isSandstorm
|
||||||
+boardLists
|
+boardLists
|
||||||
|
else
|
||||||
|
+boardsAndLists
|
||||||
|
|
||||||
|
template(name="boardsAndLists")
|
||||||
|
select.js-select-boards
|
||||||
|
each boards
|
||||||
|
if $eq _id currentBoard._id
|
||||||
|
option(value="{{_id}}" selected) {{_ 'current'}}
|
||||||
|
else
|
||||||
|
option(value="{{_id}}") {{title}}
|
||||||
|
|
||||||
|
label {{_ 'lists'}}:
|
||||||
|
ul.pop-over-list
|
||||||
|
each aBoardLists
|
||||||
|
li
|
||||||
|
if $eq ../_id _id
|
||||||
|
a.disabled {{title}} ({{_ 'current'}})
|
||||||
|
else
|
||||||
|
a.js-select-list= title
|
||||||
|
|
||||||
template(name="cardMembersPopup")
|
template(name="cardMembersPopup")
|
||||||
ul.pop-over-list.js-card-member-list
|
ul.pop-over-list.js-card-member-list
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
const subManager = new SubsManager();
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
mixins() {
|
mixins() {
|
||||||
return [Mixins.InfiniteScrolling, Mixins.PerfectScrollbar];
|
return [Mixins.InfiniteScrolling, Mixins.PerfectScrollbar];
|
||||||
|
|
@ -215,12 +217,43 @@ Template.moveCardPopup.events({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
BlazeComponent.extendComponent({
|
||||||
|
onCreated() {
|
||||||
|
this.selectedBoard = new ReactiveVar(Session.get('currentBoard'));
|
||||||
|
},
|
||||||
|
|
||||||
|
boards() {
|
||||||
|
const boards = Boards.find({
|
||||||
|
archived: false,
|
||||||
|
'members.userId': Meteor.userId(),
|
||||||
|
}, {
|
||||||
|
sort: ['title'],
|
||||||
|
});
|
||||||
|
return boards;
|
||||||
|
},
|
||||||
|
|
||||||
|
aBoardLists() {
|
||||||
|
subManager.subscribe('board', this.selectedBoard.get());
|
||||||
|
const board = Boards.findOne(this.selectedBoard.get());
|
||||||
|
return board.lists();
|
||||||
|
},
|
||||||
|
events() {
|
||||||
|
return [{
|
||||||
|
'change .js-select-boards'(evt) {
|
||||||
|
this.selectedBoard.set($(evt.currentTarget).val());
|
||||||
|
},
|
||||||
|
}];
|
||||||
|
},
|
||||||
|
}).register('boardsAndLists');
|
||||||
|
|
||||||
Template.copyCardPopup.events({
|
Template.copyCardPopup.events({
|
||||||
'click .js-select-list' (evt) {
|
'click .js-select-list' (evt) {
|
||||||
const card = Cards.findOne(Session.get('currentCard'));
|
const card = Cards.findOne(Session.get('currentCard'));
|
||||||
const oldId = card._id;
|
const oldId = card._id;
|
||||||
card._id = null;
|
card._id = null;
|
||||||
card.listId = this._id;
|
card.listId = this._id;
|
||||||
|
const list = Lists.findOne(card.listId);
|
||||||
|
card.boardId = list.boardId;
|
||||||
const textarea = $(evt.currentTarget).parents('.content').find('textarea');
|
const textarea = $(evt.currentTarget).parents('.content').find('textarea');
|
||||||
const title = textarea.val().trim();
|
const title = textarea.val().trim();
|
||||||
// insert new card to the bottom of new list
|
// insert new card to the bottom of new list
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,11 @@ Cards.mutations({
|
||||||
},
|
},
|
||||||
|
|
||||||
move(listId, sortIndex) {
|
move(listId, sortIndex) {
|
||||||
const mutatedFields = {listId};
|
const list = Lists.findOne(listId);
|
||||||
|
const mutatedFields = {
|
||||||
|
listId,
|
||||||
|
boardId: list.boardId,
|
||||||
|
};
|
||||||
if (sortIndex) {
|
if (sortIndex) {
|
||||||
mutatedFields.sort = sortIndex;
|
mutatedFields.sort = sortIndex;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue