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}}
@@ -94,26 +140,5 @@
{{/if}}
{{/if}}
- {{/layout/middle-zone-content}}
+{{/layout/master-content}}
- {{#layout/middle-zone-sidebar}}
-
- {{document/document-toc
- tab=tab
- page=page
- roles=roles
- pages=pages
- folder=folder
- document=document
- permissions=permissions
- currentPageId=currentPageId
- onShowPage=(action "onShowPage")
- onPageLevelChange=(action "onPageLevelChange")
- onPageSequenceChange=(action "onPageSequenceChange")}}
-
- {{/layout/middle-zone-sidebar}}
-
-{{/layout/middle-zone}}
-
-{{#layout/bottom-bar}}
-{{/layout/bottom-bar}}
diff --git a/gui/app/styles/core/all.scss b/gui/app/styles/core/all.scss
index 8efc119f..628b9e56 100644
--- a/gui/app/styles/core/all.scss
+++ b/gui/app/styles/core/all.scss
@@ -43,7 +43,7 @@
@import "widget/widget.scss";
@import "ui/all.scss";
@import "view/toolbar.scss";
-@import "view/views.scss";
+@import "view/all.scss";
@import "vendor/all.scss";
@import "print.scss";
diff --git a/gui/app/styles/core/layout/master-internal.scss b/gui/app/styles/core/layout/master-internal.scss
index ff9258fd..605a5964 100644
--- a/gui/app/styles/core/layout/master-internal.scss
+++ b/gui/app/styles/core/layout/master-internal.scss
@@ -17,7 +17,7 @@
display: block;
height: auto;
width: 100%;
- // z-index: 1041; // reequired if we want to show modals from inside sidebar
+ z-index: 1041; // reequired if we want to show modals from inside sidebar
.master-navbar {
display: block;
diff --git a/gui/app/styles/core/layout/sidebar.scss b/gui/app/styles/core/layout/sidebar.scss
index 93a02649..63e2ce4f 100644
--- a/gui/app/styles/core/layout/sidebar.scss
+++ b/gui/app/styles/core/layout/sidebar.scss
@@ -13,6 +13,10 @@
color: map-get($gray-shades, 700);
}
+ > .center {
+ text-align: center;
+ }
+
> .text {
margin: 10px 0;
font-size: 1rem;
@@ -21,14 +25,15 @@
}
> .label {
+ @include border-radius(3px);
+ @extend .no-select;
display: inline-block;
margin: 10px 0 13px 0;
padding: 0.3rem 0.7rem;
font-size: 1.1rem;
- font-weight: 500;
+ font-weight: 400;
background-color: map-get($gray-shades, 600);
color: map-get($gray-shades, 100);
- @include border-radius(3px);
}
> .list {
diff --git a/gui/app/styles/core/ui/ui-toolbar.scss b/gui/app/styles/core/ui/ui-toolbar.scss
index 3b4a3dd5..a01d8208 100644
--- a/gui/app/styles/core/ui/ui-toolbar.scss
+++ b/gui/app/styles/core/ui/ui-toolbar.scss
@@ -28,6 +28,10 @@
}
}
+ > .icon-selected {
+ color: map-get($yellow-shades, 600);
+ }
+
> .label {
font-size: 14px;
font-weight: 500;
diff --git a/gui/app/styles/core/util.scss b/gui/app/styles/core/util.scss
index d8b978d1..437d56e8 100644
--- a/gui/app/styles/core/util.scss
+++ b/gui/app/styles/core/util.scss
@@ -105,3 +105,9 @@ a.broken-link {
.text-center {
text-align: center;
}
+
+@media print {
+ .no-print {
+ display: none !important;
+ }
+}
diff --git a/gui/app/styles/core/view/views.scss b/gui/app/styles/core/view/all.scss
similarity index 85%
rename from gui/app/styles/core/view/views.scss
rename to gui/app/styles/core/view/all.scss
index 44532c7f..7f44ba32 100644
--- a/gui/app/styles/core/view/views.scss
+++ b/gui/app/styles/core/view/all.scss
@@ -6,4 +6,4 @@
@import "customize.scss";
@import "search.scss";
@import "auth.scss";
-@import "document/document.scss"
+@import "document/all.scss"
diff --git a/gui/app/styles/core/view/document/document.scss b/gui/app/styles/core/view/document/all.scss
similarity index 74%
rename from gui/app/styles/core/view/document/document.scss
rename to gui/app/styles/core/view/document/all.scss
index fd24c80c..07ece053 100644
--- a/gui/app/styles/core/view/document/document.scss
+++ b/gui/app/styles/core/view/document/all.scss
@@ -2,9 +2,10 @@
@import "copy-move.scss";
@import "doc-meta.scss";
@import "doc-structure.scss";
-@import "doc-toc.scss";
@import "section-editor.scss";
-@import "view-attachment.scss";
+@import "sidebar.scss";
+@import "sidebar-toc.scss";
+@import "sidebar-attachment.scss";
@import "view-activity.scss";
@import "view-revision.scss";
@import "vote-likes.scss";
diff --git a/gui/app/styles/core/view/document/doc-toc.scss b/gui/app/styles/core/view/document/doc-toc.scss
deleted file mode 100644
index 8d0b070a..00000000
--- a/gui/app/styles/core/view/document/doc-toc.scss
+++ /dev/null
@@ -1,67 +0,0 @@
-.document-sidebar {
- > .document-toc {
- @include border-radius(3px);
- @include ease-in();
- margin: 0;
- padding: 0 20px 20px 20px;
- display: block;
-
- > .header {
- top: 0;
- padding-top: 20px;
- margin: 0;
-
- > .toc-controls {
- margin: 0 0 0 0;
- text-align: center;
-
- > .disabled {
- cursor: not-allowed !important;
-
- > .material-icons {
- color: map-get($gray-shades, 300);
- }
- }
- }
- }
-
- > .index-list {
- padding: 0;
- list-style: none;
- font-size: 0.9rem;
- overflow-x: hidden;
- list-style-type: none;
- margin: 0 0 0 0;
-
- .item {
- @extend .no-select;
- padding: 4px 0;
- text-overflow: ellipsis;
- word-wrap: break-word;
- white-space: nowrap;
- overflow: hidden;
-
- > .link {
- color: map-get($gray-shades, 800);
- font-weight: bold;
-
- &:hover {
- color: $color-link;
- }
-
- > .numbering {
- color: map-get($gray-shades, 600);
- font-weight: bold;
- display: inline-block;
- margin-right: 10px;
- }
- }
-
- > .selected {
- color: $color-link;
- }
- }
- }
- }
-}
-
diff --git a/gui/app/styles/core/view/document/sidebar-attachment.scss b/gui/app/styles/core/view/document/sidebar-attachment.scss
new file mode 100644
index 00000000..b6d2f2c1
--- /dev/null
+++ b/gui/app/styles/core/view/document/sidebar-attachment.scss
@@ -0,0 +1,40 @@
+.document-sidebar-attachment {
+ .dz-preview, .dz-processing {
+ display: none !important;
+ }
+
+ > .files {
+ margin: 0;
+ padding: 0;
+
+ > .file {
+ @include card();
+ list-style-type: none;
+ margin: 10px 0 0 0;
+ padding: 5px;
+ width: 100%;
+ font-size: 0.9rem;
+ position: relative;
+
+ > a {
+ display: inline-block;
+ font-size: 0.9rem;
+ vertical-align: text-top;
+ margin-right: 10px;
+ width: 90%;
+ @extend .text-truncate;
+ color: map-get($gray-shades, 800);
+
+ &:hover {
+ color: map-get($gray-shades, 900);
+ }
+ }
+
+ > .menu {
+ position: absolute;
+ right: -10px;
+ top: 0;
+ }
+ }
+ }
+}
diff --git a/gui/app/styles/core/view/document/sidebar-toc.scss b/gui/app/styles/core/view/document/sidebar-toc.scss
new file mode 100644
index 00000000..9a728229
--- /dev/null
+++ b/gui/app/styles/core/view/document/sidebar-toc.scss
@@ -0,0 +1,63 @@
+.document-sidebar-toc {
+ > .controls {
+ margin: 5px 0 10px 0;
+ text-align: center;
+
+ > .arrow {
+ margin: 0 5px;
+ display: inline-block;
+
+ > i {
+ font-size: 2rem;
+ color: map-get($yellow-shades, 600);
+ }
+ }
+
+ > .disabled {
+ cursor: not-allowed !important;
+
+ > i {
+ color: map-get($gray-shades, 400);
+ }
+ }
+ }
+
+ > .index-list {
+ padding: 0;
+ list-style: none;
+ font-size: 0.9rem;
+ overflow-x: hidden;
+ list-style-type: none;
+ margin: 0 0 0 0;
+
+ .item {
+ @extend .no-select;
+ padding: 4px 0;
+ text-overflow: ellipsis;
+ word-wrap: break-word;
+ white-space: nowrap;
+ overflow: hidden;
+
+ > .link {
+ color: map-get($gray-shades, 800);
+ font-weight: 400;
+
+ &:hover {
+ color: map-get($yellow-shades, 600);
+ }
+
+ > .numbering {
+ color: map-get($gray-shades, 600);
+ font-weight: 500;
+ display: inline-block;
+ margin-right: 10px;
+ }
+ }
+
+ > .selected {
+ color: map-get($yellow-shades, 600);
+ font-weight: 600;
+ }
+ }
+ }
+}
diff --git a/gui/app/styles/core/view/document/sidebar.scss b/gui/app/styles/core/view/document/sidebar.scss
new file mode 100644
index 00000000..c9bf215d
--- /dev/null
+++ b/gui/app/styles/core/view/document/sidebar.scss
@@ -0,0 +1,52 @@
+.label-approval {
+ @include border-radius(3px);
+ @extend .no-select;
+ display: inline-block;
+ margin: 10px 5px 13px 0;
+ padding: 0.3rem 0.7rem;
+ font-size: 1.1rem;
+ font-weight: 400;
+ background-color: map-get($gray-shades, 700);
+ color: map-get($gray-shades, 100);
+ text-transform: uppercase;
+}
+
+.label-draft {
+ @include border-radius(3px);
+ @extend .no-select;
+ display: inline-block;
+ margin: 10px 5px 13px 0;
+ padding: 0.3rem 0.7rem;
+ font-size: 1.1rem;
+ font-weight: 400;
+ background-color: map-get($yellow-shades, 500);
+ color: map-get($gray-shades, 100);
+ text-transform: uppercase;
+}
+
+.label-live {
+ @include border-radius(3px);
+ @extend .no-select;
+ display: inline-block;
+ margin: 10px 5px 13px 0;
+ padding: 0.3rem 0.7rem;
+ font-size: 1.1rem;
+ font-weight: 400;
+ background-color: map-get($green-shades, 500);
+ color: map-get($gray-shades, 100);
+ text-transform: uppercase;
+}
+
+.label-archived {
+ @include border-radius(3px);
+ @extend .no-select;
+ display: inline-block;
+ margin: 10px 5px 13px 0;
+ padding: 0.3rem 0.7rem;
+ font-size: 1.1rem;
+ font-weight: 400;
+ background-color: map-get($red-shades, 300);
+ color: map-get($gray-shades, 800);
+ text-transform: uppercase;
+}
+
diff --git a/gui/app/styles/core/view/document/view-attachment.scss b/gui/app/styles/core/view/document/view-attachment.scss
deleted file mode 100644
index b87806d4..00000000
--- a/gui/app/styles/core/view/document/view-attachment.scss
+++ /dev/null
@@ -1,49 +0,0 @@
-.view-attachment {
- > .upload-document-files {
- @include ease-in();
- margin: 50px 0 10px 0;
-
- > .dz-preview, .dz-processing {
- display: none !important;
- }
- }
-
- > .list {
- margin: 10px 0 0 0;
- padding: 0;
-
- > .item {
- margin: 0;
- padding: 0;
- font-size: 1.1rem;
- list-style-type: none;
- border-left: 6px solid map-get($gray-shades, 300);
- padding-left: 15px;
- margin-left: 3px;
-
- > a {
- @include ease-in();
- display: inline-block;
- font-size: 1.1rem;
- vertical-align: text-top;
- margin-right: 10px;
- color: map-get($gray-shades, 600);
-
- &:hover {
- color: $color-link;
- }
- }
-
- > .delete {
- display: inline-block;
- visibility: hidden;
- }
-
- &:hover {
- > .delete {
- visibility: visible;
- }
- }
- }
- }
-}
diff --git a/gui/app/templates/components/document/document-meta.hbs b/gui/app/templates/components/document/document-meta.hbs
index 0c4ba3e0..2d53cd26 100644
--- a/gui/app/templates/components/document/document-meta.hbs
+++ b/gui/app/templates/components/document/document-meta.hbs
@@ -36,9 +36,3 @@
{{concat "#" t}}
{{/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 @@
-
diff --git a/gui/app/templates/components/document/sidebar-attachment.hbs b/gui/app/templates/components/document/sidebar-attachment.hbs
new file mode 100644
index 00000000..2887cb0f
--- /dev/null
+++ b/gui/app/templates/components/document/sidebar-attachment.hbs
@@ -0,0 +1,34 @@
+{{#if canEdit}}
+
+ {{#ui/ui-toolbar dark=true raised=true large=false bordered=true}}
+ {{ui/ui-toolbar-label color=constants.Color.Gray label="Upload Files" id="upload-document-files"}}
+ {{/ui/ui-toolbar}}
+ {{ui/ui-spacer size=100}}
+
+{{/if}}
+
+{{#if hasAttachments}}
+
+{{/if}}
+
+{{#ui/ui-dialog title="Delete Attachment" confirmCaption="Delete" buttonColor=constants.Color.Red show=showDialog onAction=(action "onDelete")}}
+ Are you sure you want to delete {{deleteAttachment.name}}?
+{{/ui/ui-dialog}}
diff --git a/gui/app/templates/components/document/sidebar-toc.hbs b/gui/app/templates/components/document/sidebar-toc.hbs
new file mode 100644
index 00000000..27788940
--- /dev/null
+++ b/gui/app/templates/components/document/sidebar-toc.hbs
@@ -0,0 +1,44 @@
+table of contents
+{{#if canEdit}}
+
+{{/if}}
+
+
diff --git a/gui/app/templates/components/document/view-attachment.hbs b/gui/app/templates/components/document/view-attachment.hbs
deleted file mode 100644
index 2c62ee14..00000000
--- a/gui/app/templates/components/document/view-attachment.hbs
+++ /dev/null
@@ -1,31 +0,0 @@
-
- {{#if canEdit}}
-
- {{else}}
-
- {{/if}}
- {{#if hasAttachments}}
-
- {{#each files key="id" as |file|}}
- -
-
- {{file.filename}}
-
- {{#if canEdit}}
-
- {{/if}}
-
- {{/each}}
-
- {{/if}}
-
-
-{{#ui/ui-dialog title="Delete Attachment" confirmCaption="Delete" buttonColor=constants.Color.Red show=showDialog onAction=(action "onDelete")}}
- Are you sure you want to delete {{deleteAttachment.name}}?
-{{/ui/ui-dialog}}