mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
Add input form in board menu
This commit is contained in:
parent
429e2f9992
commit
e66c99499f
3 changed files with 57 additions and 1 deletions
|
|
@ -112,6 +112,7 @@ template(name="boardMenuPopup")
|
||||||
ul.pop-over-list
|
ul.pop-over-list
|
||||||
li: a(href="{{exportUrl}}", download="{{exportFilename}}") {{_ 'export-board'}}
|
li: a(href="{{exportUrl}}", download="{{exportFilename}}") {{_ 'export-board'}}
|
||||||
li: a.js-archive-board {{_ 'archive-board'}}
|
li: a.js-archive-board {{_ 'archive-board'}}
|
||||||
|
li: a.js-outgoing-webhooks {{_ 'outgoing-webhooks'}}
|
||||||
|
|
||||||
template(name="boardVisibilityList")
|
template(name="boardVisibilityList")
|
||||||
ul.pop-over-list
|
ul.pop-over-list
|
||||||
|
|
@ -207,3 +208,13 @@ template(name="boardChangeTitlePopup")
|
||||||
template(name="archiveBoardPopup")
|
template(name="archiveBoardPopup")
|
||||||
p {{_ 'close-board-pop'}}
|
p {{_ 'close-board-pop'}}
|
||||||
button.js-confirm.negate.full(type="submit") {{_ 'archive'}}
|
button.js-confirm.negate.full(type="submit") {{_ 'archive'}}
|
||||||
|
|
||||||
|
template(name="outgoingWebhooksPopup")
|
||||||
|
form
|
||||||
|
label
|
||||||
|
| URL
|
||||||
|
if integration.enabled
|
||||||
|
input.js-outgoing-webhooks-url(type="text" value=integration.url autofocus)
|
||||||
|
else
|
||||||
|
input.js-outgoing-webhooks-url(type="text" autofocus)
|
||||||
|
input.primary.wide(type="submit" value="{{_ 'save'}}")
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ Template.boardMenuPopup.events({
|
||||||
// confirm that the board was successfully archived.
|
// confirm that the board was successfully archived.
|
||||||
FlowRouter.go('home');
|
FlowRouter.go('home');
|
||||||
}),
|
}),
|
||||||
|
'click .js-outgoing-webhooks': Popup.open('outgoingWebhooks'),
|
||||||
});
|
});
|
||||||
|
|
||||||
Template.boardMenuPopup.helpers({
|
Template.boardMenuPopup.helpers({
|
||||||
|
|
@ -227,3 +228,45 @@ BlazeComponent.extendComponent({
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
}).register('boardChangeWatchPopup');
|
}).register('boardChangeWatchPopup');
|
||||||
|
|
||||||
|
BlazeComponent.extendComponent({
|
||||||
|
integration() {
|
||||||
|
const boardId = Session.get('currentBoard');
|
||||||
|
return Integrations.findOne({ boardId: `${boardId}` });
|
||||||
|
},
|
||||||
|
|
||||||
|
events() {
|
||||||
|
return [{
|
||||||
|
'submit'(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
const url = this.find('.js-outgoing-webhooks-url').value.trim();
|
||||||
|
const boardId = Session.get('currentBoard');
|
||||||
|
const integration = this.integration();
|
||||||
|
if (integration) {
|
||||||
|
if (url) {
|
||||||
|
Integrations.update(integration._id, {
|
||||||
|
$set: {
|
||||||
|
enabled: true,
|
||||||
|
url: `${url}`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Integrations.update(integration._id, {
|
||||||
|
$set: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (url) {
|
||||||
|
Integrations.insert({
|
||||||
|
enabled: true,
|
||||||
|
type: 'outgoing-webhooks',
|
||||||
|
url: `${url}`,
|
||||||
|
boardId: `${boardId}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Popup.close();
|
||||||
|
},
|
||||||
|
}];
|
||||||
|
},
|
||||||
|
}).register('outgoingWebhooksPopup');
|
||||||
|
|
|
||||||
|
|
@ -355,5 +355,7 @@
|
||||||
"email-invite-register-subject": "__inviter__ sent you an invitation",
|
"email-invite-register-subject": "__inviter__ sent you an invitation",
|
||||||
"email-invite-register-text": "Dear __user__,\n\n__inviter__ invites you to Wekan for collaborations.\n\nPlease follow the link below:\n__url__\n\nAnd your invitation code is: __icode__\n\nThanks.",
|
"email-invite-register-text": "Dear __user__,\n\n__inviter__ invites you to Wekan for collaborations.\n\nPlease follow the link below:\n__url__\n\nAnd your invitation code is: __icode__\n\nThanks.",
|
||||||
"error-invitation-code-not-exist": "Invitation code doesn't exist",
|
"error-invitation-code-not-exist": "Invitation code doesn't exist",
|
||||||
"error-notAuthorized": "You are not authorized to view this page."
|
"error-notAuthorized": "You are not authorized to view this page.",
|
||||||
|
"outgoing-webhooks": "Outgoing Webhooks",
|
||||||
|
"outgoingWebhooksPopup-title": "Outgoing Webhooks"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue