mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Merge branch 'jLouzado-bAutoStarBoard' into devel
Only header-bar new-boards are auto-starred Closes #847
This commit is contained in:
commit
d45a197695
4 changed files with 20 additions and 9 deletions
|
@ -170,7 +170,7 @@ template(name="boardChangeColorPopup")
|
|||
if isSelected
|
||||
i.fa.fa-check
|
||||
|
||||
template(name="createBoardPopup")
|
||||
template(name="createBoard")
|
||||
form
|
||||
label
|
||||
| {{_ 'title'}}
|
||||
|
|
|
@ -119,10 +119,15 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
}).register('boardChangeColorPopup');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
const CreateBoard = BlazeComponent.extendComponent({
|
||||
template() {
|
||||
return 'createBoard';
|
||||
},
|
||||
|
||||
onCreated() {
|
||||
this.visibilityMenuIsOpen = new ReactiveVar(false);
|
||||
this.visibility = new ReactiveVar('private');
|
||||
this.boardId = new ReactiveVar('');
|
||||
},
|
||||
|
||||
visibilityCheck() {
|
||||
|
@ -143,15 +148,12 @@ BlazeComponent.extendComponent({
|
|||
const title = this.find('.js-new-board-title').value;
|
||||
const visibility = this.visibility.get();
|
||||
|
||||
const boardId = Boards.insert({
|
||||
this.boardId.set(Boards.insert({
|
||||
title,
|
||||
permission: visibility,
|
||||
});
|
||||
}));
|
||||
|
||||
Utils.goBoardId(boardId);
|
||||
|
||||
// Immediately star boards crated with the headerbar popup.
|
||||
Meteor.user().toggleBoardStar(boardId);
|
||||
Utils.goBoardId(this.boardId.get());
|
||||
},
|
||||
|
||||
events() {
|
||||
|
@ -166,6 +168,14 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
}).register('createBoardPopup');
|
||||
|
||||
(class HeaderBarCreateBoard extends CreateBoard {
|
||||
onSubmit(evt) {
|
||||
super.onSubmit(evt);
|
||||
// Immediately star boards crated with the headerbar popup.
|
||||
Meteor.user().toggleBoardStar(this.boardId.get());
|
||||
}
|
||||
}).register('headerBarCreateBoardPopup');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
visibilityCheck() {
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
|
|
|
@ -13,5 +13,5 @@ Template.header.helpers({
|
|||
});
|
||||
|
||||
Template.header.events({
|
||||
'click .js-create-board': Popup.open('createBoard'),
|
||||
'click .js-create-board': Popup.open('headerBarCreateBoard'),
|
||||
});
|
||||
|
|
|
@ -196,6 +196,7 @@
|
|||
"fullname": "Full Name",
|
||||
"header-logo-title": "Go back to your boards page.",
|
||||
"hide-system-messages": "Hide system messages",
|
||||
"headerBarCreateBoardPopup-title": "Create Board",
|
||||
"home": "Home",
|
||||
"import": "Import",
|
||||
"import-board": "import from Trello",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue