mirror of
https://github.com/wekan/wekan.git
synced 2025-12-29 13:48:49 +01:00
- Add Feature: Move board to Archive button at each board at All Boards page.
Thanks to xet7 ! Related #2389
This commit is contained in:
parent
7ff4067e88
commit
828f6ea321
4 changed files with 38 additions and 2 deletions
|
|
@ -30,8 +30,9 @@ template(name="boardList")
|
||||||
i.fa.js-clone-board(
|
i.fa.js-clone-board(
|
||||||
class="fa-clone"
|
class="fa-clone"
|
||||||
title="{{_ 'duplicate-board'}}")
|
title="{{_ 'duplicate-board'}}")
|
||||||
|
i.fa.js-archive-board(
|
||||||
|
class="fa-archive"
|
||||||
|
title="{{_ 'archive-board'}}")
|
||||||
|
|
||||||
template(name="boardListHeaderBar")
|
template(name="boardListHeaderBar")
|
||||||
h1 {{_ 'my-boards'}}
|
h1 {{_ 'my-boards'}}
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,11 @@ BlazeComponent.extendComponent({
|
||||||
);
|
);
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
},
|
},
|
||||||
|
'click .js-archive-board'(evt) {
|
||||||
|
const boardId = this.currentData()._id;
|
||||||
|
Meteor.call('archiveBoard', boardId);
|
||||||
|
evt.preventDefault();
|
||||||
|
},
|
||||||
'click .js-accept-invite'() {
|
'click .js-accept-invite'() {
|
||||||
const boardId = this.currentData()._id;
|
const boardId = this.currentData()._id;
|
||||||
Meteor.user().removeInvite(boardId);
|
Meteor.user().removeInvite(boardId);
|
||||||
|
|
|
||||||
|
|
@ -106,15 +106,29 @@ $spaceBetweenTiles = 16px
|
||||||
transition-duration: .15s
|
transition-duration: .15s
|
||||||
transition-property: color, font-size, background
|
transition-property: color, font-size, background
|
||||||
|
|
||||||
|
.fa-archive
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0
|
||||||
|
font-size: 14px
|
||||||
|
height: 18px
|
||||||
|
line-height: 18px
|
||||||
|
opacity: 0
|
||||||
|
left: 0
|
||||||
|
padding: 9px 9px
|
||||||
|
transition-duration: .15s
|
||||||
|
transition-property: color, font-size, background
|
||||||
|
|
||||||
li:hover a
|
li:hover a
|
||||||
&:hover
|
&:hover
|
||||||
.fa-star,
|
.fa-star,
|
||||||
.fa-clone,
|
.fa-clone,
|
||||||
|
.fa-archive,
|
||||||
.fa-star-o
|
.fa-star-o
|
||||||
color: white
|
color: white
|
||||||
|
|
||||||
.fa-star,
|
.fa-star,
|
||||||
.fa-clone,
|
.fa-clone,
|
||||||
|
.fa-archive,
|
||||||
.fa-star-o
|
.fa-star-o
|
||||||
color: white
|
color: white
|
||||||
opacity: .75
|
opacity: .75
|
||||||
|
|
|
||||||
|
|
@ -867,6 +867,22 @@ if (Meteor.isServer) {
|
||||||
} else throw new Meteor.Error('error-board-doesNotExist');
|
} else throw new Meteor.Error('error-board-doesNotExist');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Meteor.methods({
|
||||||
|
archiveBoard(boardId) {
|
||||||
|
check(boardId, String);
|
||||||
|
const board = Boards.findOne(boardId);
|
||||||
|
if (board) {
|
||||||
|
const userId = Meteor.userId();
|
||||||
|
const index = board.memberIndex(userId);
|
||||||
|
if (index >= 0) {
|
||||||
|
board.archive();
|
||||||
|
return true;
|
||||||
|
} else throw new Meteor.Error('error-board-notAMember');
|
||||||
|
} else throw new Meteor.Error('error-board-doesNotExist');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue