mirror of
https://github.com/documize/community.git
synced 2025-07-19 21:29:42 +02:00
Detect and hide empty doc toolbar
This commit is contained in:
parent
c1d796e6bc
commit
ca213ba5d1
3 changed files with 815 additions and 806 deletions
1540
embed/bindata.go
1540
embed/bindata.go
File diff suppressed because one or more lines are too long
|
@ -41,6 +41,13 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
|||
|
||||
return false;
|
||||
}),
|
||||
hasToolbar: computed('permissions', 'showRevisions', 'showActivity', function() {
|
||||
if (this.get('showRevisions') || this.get('showActivity')) return true;
|
||||
if (this.get('permissions.documentAdd') || this.get('permissions.documentDelete')) return true;
|
||||
if (this.get('appMeta.edition') === this.get('constants').Product.EnterpriseEdition &&
|
||||
this.get('permissions.documentEdit')) return true;
|
||||
|
||||
}),
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
@ -149,7 +156,7 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
|||
|
||||
onExport() {
|
||||
let spec = {
|
||||
spaceId: this.get('document.folderId'),
|
||||
spaceId: this.get('document.spaceId'),
|
||||
data: [],
|
||||
filterType: 'document',
|
||||
};
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
{{/if}}
|
||||
{{/ui/ui-toolbar}}
|
||||
|
||||
{{#if hasToolbar}}
|
||||
{{#ui/ui-toolbar dark=false light=true raised=true large=true bordered=true}}
|
||||
{{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}}
|
||||
{{#if permissions.documentEdit}}
|
||||
|
@ -66,6 +67,7 @@
|
|||
tooltip="Delete" onClick=(action "onShowDeleteModal")}}
|
||||
{{/if}}
|
||||
{{/ui/ui-toolbar}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div id="document-template-modal" class="modal" tabindex="-1" role="dialog">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue