mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
Export to HTML all content from shared spaces
This commit is contained in:
parent
def01b6265
commit
b7fa4e1a1a
2 changed files with 21 additions and 2 deletions
|
@ -12,11 +12,14 @@
|
|||
import $ from 'jquery';
|
||||
import { computed } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import Controller from '@ember/controller';
|
||||
import Notifier from '../../../mixins/notifier';
|
||||
import TooltipMixin from '../../../mixins/tooltip';
|
||||
import Controller from '@ember/controller';
|
||||
|
||||
export default Controller.extend(TooltipMixin, {
|
||||
export default Controller.extend(TooltipMixin, Notifier, {
|
||||
folderService: service('folder'),
|
||||
browserSvc: service('browser'),
|
||||
documentSvc: service('document'),
|
||||
dropdown: null,
|
||||
|
||||
init() {
|
||||
|
@ -70,6 +73,21 @@ export default Controller.extend(TooltipMixin, {
|
|||
this.set('folders', nonPrivateFolders);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
onExport() {
|
||||
this.showWait();
|
||||
|
||||
let spec = {
|
||||
spaceId: '',
|
||||
data: _.pluck(this.get('folders'), 'id'),
|
||||
filterType: 'space',
|
||||
};
|
||||
|
||||
this.get('documentSvc').export(spec).then((htmlExport) => {
|
||||
this.get('browserSvc').downloadFile(htmlExport, 'documize.html');
|
||||
this.showDone();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
<div class="col">
|
||||
<div class="view-customize">
|
||||
<h1 class="admin-heading">{{folders.length}} shared {{label}}</h1>
|
||||
<button type="button" class="btn btn-success" onclick={{action 'onExport'}}>Export as HTML</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue