mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
Streamline document meta view and editing experience
Meta data: 1. Condensed layout. 2. Unified editing. Co-Authored-By: Saul S <sauls8t@users.noreply.github.com>
This commit is contained in:
parent
f70d4b33a3
commit
27fde0dac8
26 changed files with 2389 additions and 1956 deletions
|
@ -11,6 +11,7 @@
|
|||
|
||||
import { Promise as EmberPromise } from 'rsvp';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { computed } from '@ember/object';
|
||||
import Tooltips from '../../../mixins/tooltip';
|
||||
import Notifier from '../../../mixins/notifier';
|
||||
import Controller from '@ember/controller';
|
||||
|
@ -22,6 +23,12 @@ export default Controller.extend(Tooltips, Notifier, {
|
|||
linkService: service('link'),
|
||||
tab: 'content',
|
||||
queryParams: ['currentPageId'],
|
||||
showRevisions: computed('permissions', 'document.protection', function() {
|
||||
if (this.get('document.protection') === this.get('constants').ProtectionType.None) return true;
|
||||
if (this.get('document.protection') === this.get('constants').ProtectionType.Review && this.get('permissions.documentApprove')) return true;
|
||||
|
||||
return false;
|
||||
}),
|
||||
|
||||
actions: {
|
||||
onTabChange(tab) {
|
||||
|
@ -229,7 +236,7 @@ export default Controller.extend(Tooltips, Notifier, {
|
|||
});
|
||||
},
|
||||
|
||||
refresh() {
|
||||
refresh(reloadPage) {
|
||||
return new EmberPromise((resolve) => {
|
||||
this.get('documentService').fetchDocumentData(this.get('document.id')).then((data) => {
|
||||
this.set('document', data.document);
|
||||
|
@ -247,7 +254,11 @@ export default Controller.extend(Tooltips, Notifier, {
|
|||
this.set('blocks', data);
|
||||
});
|
||||
|
||||
if (reloadPage) {
|
||||
window.location.reload();
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -32,16 +32,24 @@
|
|||
<ul class="tabnav-control">
|
||||
<li class="tab {{if (eq tab 'content') 'selected'}}" {{action 'onTabChange' 'content'}}>Content</li>
|
||||
{{#if session.authenticated}}
|
||||
<li class="tab {{if (eq tab 'revision') 'selected'}}" {{action 'onTabChange' 'revision'}}>Revisions</li>
|
||||
{{#if showRevisions}}
|
||||
<li class="tab {{if (eq tab 'revision') 'selected'}}" {{action 'onTabChange' 'revision'}}>Revisions</li>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{document/document-heading
|
||||
document=document
|
||||
versions=versions
|
||||
permissions=permissions
|
||||
onSaveDocument=(action 'onSaveDocument')}}
|
||||
<div class="view-document">
|
||||
<div class="document-heading">
|
||||
<h1 class="doc-title">
|
||||
{{#if document.template}}
|
||||
<span class="bg-warning p-1 pr-2 pl-2">Template</span>
|
||||
{{/if}}
|
||||
{{document.name}}
|
||||
</h1>
|
||||
<div class="doc-excerpt">{{document.excerpt}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{document/document-meta
|
||||
pages=pages
|
||||
|
@ -76,12 +84,14 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if (eq tab 'revision')}}
|
||||
{{document/view-revision
|
||||
pages=pages
|
||||
folder=folder
|
||||
document=document
|
||||
permissions=permissions
|
||||
onRollback=(action 'onRollback')}}
|
||||
{{#if showRevisions}}
|
||||
{{document/view-revision
|
||||
pages=pages
|
||||
folder=folder
|
||||
document=document
|
||||
permissions=permissions
|
||||
onRollback=(action 'onRollback')}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{/layout/middle-zone-content}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue