mirror of
https://github.com/wekan/wekan.git
synced 2026-02-04 15:41:52 +01:00
Export Card to PDF. In Progress.
Thanks to xet7 !
This commit is contained in:
parent
90152ab9f5
commit
a2f2ce1135
6 changed files with 741 additions and 1 deletions
|
|
@ -609,6 +609,12 @@ template(name="cardDetailsActionsPopup")
|
|||
i.fa.fa-paint-brush
|
||||
| {{_ 'setCardColorPopup-title'}}
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-export-card
|
||||
i.fa.fa-share-alt
|
||||
| {{_ 'export-card'}}
|
||||
hr
|
||||
ul.pop-over-list
|
||||
li
|
||||
a.js-move-card-to-top
|
||||
|
|
@ -653,6 +659,13 @@ template(name="cardDetailsActionsPopup")
|
|||
i.fa.fa-link
|
||||
| {{_ 'cardMorePopup-title'}}
|
||||
|
||||
template(name="exportCard")
|
||||
ul.pop-over-list
|
||||
li
|
||||
a(href="{{exportUrlCardPDF}}",, download="{{exportFilenameCardPDF}}")
|
||||
i.fa.fa-share-alt
|
||||
| {{_ 'export-card-pdf'}}
|
||||
|
||||
template(name="moveCardPopup")
|
||||
+boardsAndLists
|
||||
|
||||
|
|
|
|||
|
|
@ -511,9 +511,38 @@ BlazeComponent.extendComponent({
|
|||
},
|
||||
}).register('cardDetails');
|
||||
|
||||
BlazeComponent.extendComponent({
|
||||
template() {
|
||||
return 'exportCard';
|
||||
},
|
||||
withApi() {
|
||||
return Template.instance().apiEnabled.get();
|
||||
},
|
||||
exportUrlCardPDF() {
|
||||
const params = {
|
||||
boardId: Session.get('currentBoard'),
|
||||
listId: this.listId,
|
||||
cardId: this.cardId,
|
||||
};
|
||||
const queryParams = {
|
||||
authToken: Accounts._storedLoginToken(),
|
||||
};
|
||||
return FlowRouter.path(
|
||||
'/api/boards/:boardId/lists/:listId/cards/:cardId/exportPDF',
|
||||
params,
|
||||
queryParams,
|
||||
);
|
||||
},
|
||||
exportFilenameCardPDF() {
|
||||
//const boardId = Session.get('currentBoard');
|
||||
//return `export-card-pdf-${boardId}.xlsx`;
|
||||
return `export-card.pdf`;
|
||||
},
|
||||
}).register('exportCardPopup');
|
||||
|
||||
// only allow number input
|
||||
Template.editCardSortOrderForm.onRendered(function() {
|
||||
this.$('input').on("keypress paste", function() {
|
||||
this.$('input').on("keypress paste", function(event) {
|
||||
let keyCode = event.keyCode;
|
||||
let charCode = String.fromCharCode(keyCode);
|
||||
let regex = new RegExp('[-0-9.]');
|
||||
|
|
@ -583,6 +612,7 @@ Template.cardDetailsActionsPopup.helpers({
|
|||
});
|
||||
|
||||
Template.cardDetailsActionsPopup.events({
|
||||
'click .js-export-card': Popup.open('exportCard'),
|
||||
'click .js-members': Popup.open('cardMembers'),
|
||||
'click .js-assignees': Popup.open('cardAssignees'),
|
||||
'click .js-labels': Popup.open('cardLabels'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue