diff --git a/gui/app/components/document/view-attachment.js b/gui/app/components/document/sidebar-attachment.js similarity index 91% rename from gui/app/components/document/view-attachment.js rename to gui/app/components/document/sidebar-attachment.js index 593374cb..2380ea1f 100644 --- a/gui/app/components/document/view-attachment.js +++ b/gui/app/components/document/sidebar-attachment.js @@ -18,6 +18,7 @@ import Component from '@ember/component'; export default Component.extend(Modals, Notifier, { documentService: service('document'), + browserSvc: service('browser'), appMeta: service(), hasAttachments: notEmpty('files'), canEdit: computed('permissions.documentEdit', 'document.protection', function() { @@ -114,6 +115,15 @@ export default Component.extend(Modals, Notifier, { }); return true; + }, + + onExport() { + this.get('documentSvc').export({}).then((htmlExport) => { + this.get('browserSvc').downloadFile(htmlExport, this.get('space.slug') + '.html'); + this.notifySuccess('Exported'); + }); + + this.modalClose("#space-export-modal"); } } }); diff --git a/gui/app/components/document/document-toc.js b/gui/app/components/document/sidebar-toc.js similarity index 99% rename from gui/app/components/document/document-toc.js rename to gui/app/components/document/sidebar-toc.js index f3a32b2e..16d5b7cd 100644 --- a/gui/app/components/document/document-toc.js +++ b/gui/app/components/document/sidebar-toc.js @@ -16,6 +16,7 @@ import tocUtil from '../../utils/toc'; import Component from '@ember/component'; export default Component.extend({ + classNames: ["section"], documentService: service('document'), emptyState: computed('pages', function () { return this.get('pages.length') === 0; diff --git a/gui/app/components/folder/settings-general.js b/gui/app/components/folder/settings-general.js index 6af213fd..ef1b53bf 100644 --- a/gui/app/components/folder/settings-general.js +++ b/gui/app/components/folder/settings-general.js @@ -11,7 +11,6 @@ import { A } from '@ember/array'; import { inject as service } from '@ember/service'; -import { schedule } from '@ember/runloop'; import { computed } from '@ember/object'; import { empty } from '@ember/object/computed'; import AuthMixin from '../../mixins/auth'; diff --git a/gui/app/components/ui/ui-button-gap.js b/gui/app/components/ui/ui-button-gap.js index bc8f0728..2d8f9efe 100644 --- a/gui/app/components/ui/ui-button-gap.js +++ b/gui/app/components/ui/ui-button-gap.js @@ -16,7 +16,6 @@ export default Component.extend({ tagName: 'div', classNames: [], classNameBindings: ['calcClass'], - where: 'right', calcClass: computed(function() { return `dmz-button-gap-${this.where}`; diff --git a/gui/app/components/ui/ui-button.js b/gui/app/components/ui/ui-button.js index e30523fe..2066644c 100644 --- a/gui/app/components/ui/ui-button.js +++ b/gui/app/components/ui/ui-button.js @@ -62,8 +62,8 @@ export default Component.extend({ }), click(e) { - e.preventDefault(); if (is.not.undefined(this.onClick)) { + e.preventDefault(); this.onClick(e); } } diff --git a/gui/app/components/ui/ui-toolbar-icon.js b/gui/app/components/ui/ui-toolbar-icon.js index fc18ad89..18937ccd 100644 --- a/gui/app/components/ui/ui-toolbar-icon.js +++ b/gui/app/components/ui/ui-toolbar-icon.js @@ -18,17 +18,19 @@ export default Component.extend({ tagName: 'i', classNames: ['dicon'], classNameBindings: ['calcClass'], - color: '', icon: '', tooltip: '', + selected: false, - calcClass: computed(function() { + calcClass: computed('selected', function() { let c = ''; let icon = this.icon; if (this.color !== '') c += this.color + ' '; + if (this.selected === true) c += 'icon-selected' + ' '; + if (icon !== '') c += icon + ' '; return c.trim(); diff --git a/gui/app/components/ui/ui-toolbar-label.js b/gui/app/components/ui/ui-toolbar-label.js index 165e5d6a..eac78ff1 100644 --- a/gui/app/components/ui/ui-toolbar-label.js +++ b/gui/app/components/ui/ui-toolbar-label.js @@ -18,7 +18,6 @@ export default Component.extend({ tagName: 'div', classNames: ['label'], classNameBindings: ['calcClass'], - color: '', label: '', tooltip: '', diff --git a/gui/app/constants/constants.js b/gui/app/constants/constants.js index 774f29ec..178d40c2 100644 --- a/gui/app/constants/constants.js +++ b/gui/app/constants/constants.js @@ -260,6 +260,7 @@ let constants = EmberObject.extend({ Close: 'Close', Delete: 'Delete', Export: 'Export', + File: 'File', Insert: 'Insert', Invite: 'Invite', Join: 'Join', @@ -272,6 +273,7 @@ let constants = EmberObject.extend({ Search: 'Search', SignIn: 'Sign In', Update: 'Update', + Upload: 'Upload' } }); diff --git a/gui/app/pods/document/index/controller.js b/gui/app/pods/document/index/controller.js index add37c63..45437354 100644 --- a/gui/app/pods/document/index/controller.js +++ b/gui/app/pods/document/index/controller.js @@ -21,6 +21,7 @@ export default Controller.extend(Notifier, { sectionService: service('section'), linkService: service('link'), router: service(), + sidebarTab: 'toc', tab: 'content', queryParams: ['currentPageId', 'source'], showRevisions: computed('permissions', 'document.protection', function() { @@ -32,6 +33,10 @@ export default Controller.extend(Notifier, { }), actions: { + onSidebarChange(tab) { + this.set('sidebarTab', tab); + }, + onTabChange(tab) { this.set('tab', tab); if (tab === 'content') { diff --git a/gui/app/pods/document/index/template.hbs b/gui/app/pods/document/index/template.hbs index 7d56e8f1..c7e04fba 100644 --- a/gui/app/pods/document/index/template.hbs +++ b/gui/app/pods/document/index/template.hbs @@ -1,32 +1,78 @@ -{{#layout/top-bar}} -
  • - {{#link-to "folder.index" folder.id folder.slug class="link"}} - {{folder.name}} - {{/link-to}} -
  • -
  • - {{#link-to "document.index" folder.id folder.slug document.id document.slug class="link selected"}} - {{document.name}} - {{/link-to}} -
  • -{{/layout/top-bar}} +{{#layout/master-sidebar}} + {{ui/ui-spacer size=300}} -{{#layout/middle-zone}} +
    +
    status
    - {{#layout/middle-zone-content}} +
    + {{document.lifecycleLabel}} + {{#attach-tooltip showDelay=1000}}Lifecycle: Draft · Live · Archived{{/attach-tooltip}} +
    +
    + {{#if (eq document.protection constants.ProtectionType.None)}}OPEN{{/if}} + {{#if (eq document.protection constants.ProtectionType.Review)}}PROTECTED{{/if}} + {{#if (eq document.protection constants.ProtectionType.Lock)}}LOCKED{{/if}} + {{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}} +
    - {{toolbar/for-document + {{ui/ui-spacer size=200}} + +
    + {{#ui/ui-toolbar dark=true light=true raised=true large=false bordered=true}} + {{ui/ui-toolbar-icon icon=constants.Icon.Index color=constants.Color.Gray tooltip="Table of contents" + selected=(eq sidebarTab "toc") onClick=(action "onSidebarChange" "toc")}} + {{ui/ui-toolbar-icon icon=constants.Icon.Attachment color=constants.Color.Gray tooltip="Attachments" + selected=(eq sidebarTab "files") onClick=(action "onSidebarChange" "files")}} + {{/ui/ui-toolbar}} +
    +
    + + {{ui/ui-spacer size=200}} + {{#if (eq sidebarTab "toc")}} + {{document/sidebar-toc tab=tab + page=page roles=roles - space=folder - spaces=folders + pages=pages + folder=folder document=document - versions=versions permissions=permissions - refresh=(action "refresh") - onSaveTemplate=(action "onSaveTemplate") - onSaveDocument=(action "onSaveDocument") - onDocumentDelete=(action "onDocumentDelete")}} + currentPageId=currentPageId + onShowPage=(action "onShowPage") + onPageLevelChange=(action "onPageLevelChange") + onPageSequenceChange=(action "onPageSequenceChange")}} + {{/if}} + {{#if (eq sidebarTab "files")}} + {{document/sidebar-attachment + document=document + permissions=permissions}} + {{/if}} +{{/layout/master-sidebar}} + +{{#layout/master-content}} +
    +
    +
    + +
    + {{toolbar/for-document + tab=tab + roles=roles + space=folder + spaces=folders + document=document + versions=versions + permissions=permissions + refresh=(action "refresh") + onSaveTemplate=(action "onSaveTemplate") + onSaveDocument=(action "onSaveDocument") + onDocumentDelete=(action "onDocumentDelete")}} +
    +
    + + {{ui/ui-spacer size=400}}
    {{/each}} - -
    - {{document/view-attachment document=document permissions=permissions}} -
    - -
    diff --git a/gui/app/templates/components/document/document-toc.hbs b/gui/app/templates/components/document/document-toc.hbs deleted file mode 100644 index 78ed0272..00000000 --- a/gui/app/templates/components/document/document-toc.hbs +++ /dev/null @@ -1,53 +0,0 @@ -