diff --git a/app/app/components/document/edit-tools.js b/app/app/components/document/content-linker.js similarity index 100% rename from app/app/components/document/edit-tools.js rename to app/app/components/document/content-linker.js diff --git a/app/app/components/document/document-activity.js b/app/app/components/document/document-activity.js deleted file mode 100644 index 2ecbf998..00000000 --- a/app/app/components/document/document-activity.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2016 Documize Inc. . All rights reserved. -// -// This software (Documize Community Edition) is licensed under -// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html -// -// You can operate outside the AGPL restrictions by purchasing -// Documize Enterprise Edition and obtaining a commercial license -// by contacting . -// -// https://documize.com - -import Ember from 'ember'; - -export default Ember.Component.extend({ - sortedItems: [], - - didReceiveAttrs() { - let editors = this.get('activity.editors'); - let viewers = this.get('activity.viewers'); - let pages = this.get('pages'); - let sorted = []; - - if (is.null(editors)) { - editors = []; - } - - if (is.null(viewers)) { - viewers = []; - } - - viewers.forEach((item) => { - Ember.set(item, 'changeLabel', "viewed"); - Ember.set(item, "viewed", true); - sorted.pushObject({ date: item.created, item: item }); - }); - - editors.forEach(function (item) { - Ember.set(item, "added", item.action === "add-page"); - Ember.set(item, "changed", item.action === "update-page"); - Ember.set(item, "deleted", item.action === "remove-page"); - - let page = pages.findBy('id', item.pageId); - let title = ""; - - if (item.deleted || is.undefined(page)) { - title = "removed section"; - } else { - if (item.added) { - title = "added " + page.get('title'); - } - - if (item.changed) { - title = "changed " + page.get('title'); - } - } - - Ember.set(item, 'changeLabel', title); - - let exists = sorted.findBy('item.pageId', item.pageId); - - if (is.undefined(exists)) { - sorted.pushObject({ date: item.created, item: item }); - } - }); - - this.set('sortedItems', _.sortBy(sorted, 'date').reverse()); - } -}); diff --git a/app/app/components/document/sidebar-view-activity.js b/app/app/components/document/sidebar-view-activity.js new file mode 100644 index 00000000..84b78a0b --- /dev/null +++ b/app/app/components/document/sidebar-view-activity.js @@ -0,0 +1,76 @@ +// Copyright 2016 Documize Inc. . All rights reserved. +// +// This software (Documize Community Edition) is licensed under +// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html +// +// You can operate outside the AGPL restrictions by purchasing +// Documize Enterprise Edition and obtaining a commercial license +// by contacting . +// +// https://documize.com + +import Ember from 'ember'; + +export default Ember.Component.extend({ + documentService: Ember.inject.service('document'), + appMeta: Ember.inject.service(), + sortedItems: [], + + didReceiveAttrs() { + this._super(...arguments); + + this.get('documentService').getMeta(this.get('document.id')).then((activity) => { + this.set('activity', activity); + + let editors = this.get('activity.editors'); + let viewers = this.get('activity.viewers'); + let pages = this.get('pages'); + let sorted = []; + + if (is.null(editors)) { + editors = []; + } + + if (is.null(viewers)) { + viewers = []; + } + + viewers.forEach((item) => { + Ember.set(item, 'changeLabel', "viewed"); + Ember.set(item, "viewed", true); + sorted.pushObject({ date: item.created, item: item }); + }); + + editors.forEach(function (item) { + Ember.set(item, "added", item.action === "add-page"); + Ember.set(item, "changed", item.action === "update-page"); + Ember.set(item, "deleted", item.action === "remove-page"); + + let page = pages.findBy('id', item.pageId); + let title = ""; + + if (item.deleted || is.undefined(page)) { + title = "removed section"; + } else { + if (item.added) { + title = "added " + page.get('title'); + } + + if (item.changed) { + title = "changed " + page.get('title'); + } + } + + Ember.set(item, 'changeLabel', title); + + let exists = sorted.findBy('item.pageId', item.pageId); + + if (is.undefined(exists)) { + sorted.pushObject({ date: item.created, item: item }); + } + }); + + this.set('sortedItems', _.sortBy(sorted, 'date').reverse()); + }); + } +}); diff --git a/app/app/components/document/document-files.js b/app/app/components/document/sidebar-view-attachments.js similarity index 78% rename from app/app/components/document/document-files.js rename to app/app/components/document/sidebar-view-attachments.js index fe5a95eb..6b7b326a 100644 --- a/app/app/components/document/document-files.js +++ b/app/app/components/document/sidebar-view-attachments.js @@ -14,17 +14,24 @@ import NotifierMixin from '../../mixins/notifier'; import TooltipMixin from '../../mixins/tooltip'; export default Ember.Component.extend(NotifierMixin, TooltipMixin, { + documentService: Ember.inject.service('document'), appMeta: Ember.inject.service(), drop: null, + emptyState: Ember.computed.empty('files'), deleteAttachment: { id: "", name: "", }, - emptyState: Ember.computed('files', function () { - return this.get('files.length') === 0; - }), + + init() { + this._super(...arguments); + + this.getAttachments(); + }, didInsertElement() { + this._super(...arguments); + if (!this.get('isEditor')) { return; } @@ -54,7 +61,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { }); this.on("queuecomplete", function () { - self.attrs.onUpload(); + self.getAttachments(); }); this.on("addedfile", function ( /*file*/ ) { @@ -71,15 +78,22 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { }, willDestroyElement() { - let drop = this.get('drop'); + this._super(...arguments); + let drop = this.get('drop'); if (is.not.null(drop)) { drop.destroy(); } }, + getAttachments() { + this.get('documentService').getAttachments(this.get('document.id')).then((files) => { + this.set('files', files); + }); + }, + actions: { - confirmDeleteAttachment(id, name) { + onConfirmDelete(id, name) { this.set('deleteAttachment', { id: id, name: name @@ -103,7 +117,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.set('drop', drop); }, - cancel() { + onCancel() { let drop = this.get('drop'); drop.close(); @@ -113,16 +127,19 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { }); }, - deleteAttachment() { + onDelete() { let attachment = this.get('deleteAttachment'); let drop = this.get('drop'); drop.close(); - this.attrs.onDelete(this.get('deleteAttachment').id, attachment.name); + this.showNotification(`Deleted ${name}`); - this.set('deleteAttachment', { - id: "", - name: "" + this.get('documentService').deleteAttachment(this.get('document.id'), attachment.id).then(() => { + this.getAttachments(); + this.set('deleteAttachment', { + id: "", + name: "" + }); }); return true; diff --git a/app/app/components/document/document-toolbar.js b/app/app/components/document/sidebar-zone.js similarity index 68% rename from app/app/components/document/document-toolbar.js rename to app/app/components/document/sidebar-zone.js index d7190d04..125c6a32 100644 --- a/app/app/components/document/document-toolbar.js +++ b/app/app/components/document/sidebar-zone.js @@ -10,114 +10,83 @@ // https://documize.com import Ember from 'ember'; -import NotifierMixin from '../../mixins/notifier'; import TooltipMixin from '../../mixins/tooltip'; +import NotifierMixin from '../../mixins/notifier'; -export default Ember.Component.extend(NotifierMixin, TooltipMixin, { +export default Ember.Component.extend(TooltipMixin, NotifierMixin, { + documentService: Ember.inject.service('document'), + sectionService: Ember.inject.service('section'), appMeta: Ember.inject.service(), userService: Ember.inject.service('user'), localStorage: Ember.inject.service(), pinned: Ember.inject.service(), - drop: null, - users: [], menuOpen: false, - saveTemplate: { - name: "", - description: "" - }, pinState : { isPinned: false, pinId: '', newName: '', }, - - didReceiveAttrs() { - this.set('saveTemplate.name', this.get('document.name')); - this.set('saveTemplate.description', this.get('document.excerpt')); - - let doc = this.get('document'); - - this.set('layoutLabel', doc.get('layout') === 'doc' ? 'Wiki style' : 'Document style'); - - this.set('pinState.pinId', this.get('pinned').isDocumentPinned(doc.get('id'))); - this.set('pinState.isPinned', this.get('pinState.pinId') !== ''); - this.set('pinState.newName', doc.get('name').substring(0,3).toUpperCase()); + saveTemplate: { + name: "", + description: "" }, + currentTab: '', - didRender() { - if (this.session.isEditor) { - this.addTooltip(document.getElementById("add-document-tab")); + init() { + this._super(...arguments); + + if (is.empty(this.get('currentTab'))) { + this.set('currentTab', 'attachments'); } }, - willDestroyElement() { - this.destroyTooltips(); + didReceiveAttrs() { + this._super(...arguments); + + this.set('saveTemplate.name', this.get('document.name')); + this.set('saveTemplate.description', this.get('document.excerpt')); + + this.set('pinState.pinId', this.get('pinned').isDocumentPinned(this.get('document.id'))); + this.set('pinState.isPinned', this.get('pinState.pinId') !== ''); + this.set('pinState.newName', this.get('document.name').substring(0,3).toUpperCase()); }, - actions: { + didRender() { + this._super(...arguments); + }, + + didInsertElement() { + this._super(...arguments); + }, + + willDestroyElement() { + this._super(...arguments); + }, + + actions: { + onChangeTab(tab) { + this.set('currentTab', tab); + }, + + onTagChange(tags) { + let doc = this.get('document'); + doc.set('tags', tags); + this.get('documentService').save(doc); + }, + onMenuOpen() { this.set('menuOpen', !this.get('menuOpen')); }, - deleteDocument() { + onDeleteDocument() { this.attrs.onDocumentDelete(); }, - printDocument() { + onPrintDocument() { window.print(); }, - changeLayout() { - let doc = this.get('document'); - let layout = doc.get('layout') === 'doc' ? 'wiki' : 'doc'; - - doc.set('layout', layout); - - this.attrs.onSaveMeta(doc); - - this.set('layoutLabel', doc.get('layout') === 'doc' ? 'Wiki style' : 'Document style'); - }, - - saveTemplate() { - var name = this.get('saveTemplate.name'); - var excerpt = this.get('saveTemplate.description'); - - if (is.empty(name)) { - $("#new-template-name").addClass("error").focus(); - return false; - } - - if (is.empty(excerpt)) { - $("#new-template-desc").addClass("error").focus(); - return false; - } - - this.showNotification('Template saved'); - this.attrs.onSaveTemplate(name, excerpt); - - return true; - }, - - saveMeta() { - let doc = this.get('document'); - - if (is.empty(doc.get('name'))) { - $("#meta-name").addClass("error").focus(); - return false; - } - - if (is.empty(doc.get('excerpt'))) { - $("#meta-excerpt").addClass("error").focus(); - return false; - } - - doc.set('excerpt', doc.get('excerpt').substring(0, 250)); - - this.attrs.onSaveMeta(doc); - return true; - }, - - unpin() { + onUnpin() { this.audit.record('unpinned-document'); this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => { @@ -127,7 +96,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { }); }, - pin() { + onPin() { let pin = { pin: this.get('pinState.newName'), documentId: this.get('document.id'), @@ -147,7 +116,27 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, { this.eventBus.publish('pinChange'); }); + return true; + }, + + onSaveTemplate() { + var name = this.get('saveTemplate.name'); + var excerpt = this.get('saveTemplate.description'); + + if (is.empty(name)) { + $("#new-template-name").addClass("error").focus(); + return false; + } + + if (is.empty(excerpt)) { + $("#new-template-desc").addClass("error").focus(); + return false; + } + + this.showNotification('Template saved'); + this.attrs.onSaveTemplate(name, excerpt); + return true; } - } + } }); diff --git a/app/app/components/layout/zone-document-sidebar.js b/app/app/components/layout/zone-document-sidebar.js deleted file mode 100644 index 56467fb8..00000000 --- a/app/app/components/layout/zone-document-sidebar.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 Documize Inc. . All rights reserved. -// -// This software (Documize Community Edition) is licensed under -// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html -// -// You can operate outside the AGPL restrictions by purchasing -// Documize Enterprise Edition and obtaining a commercial license -// by contacting . -// -// https://documize.com - -import Ember from 'ember'; -import NotifierMixin from '../../mixins/notifier'; - -export default Ember.Component.extend(NotifierMixin, { -}); diff --git a/app/app/pods/document/activity/controller.js b/app/app/pods/document/activity/controller.js deleted file mode 100644 index 27719168..00000000 --- a/app/app/pods/document/activity/controller.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2016 Documize Inc. . All rights reserved. -// -// This software (Documize Community Edition) is licensed under -// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html -// -// You can operate outside the AGPL restrictions by purchasing -// Documize Enterprise Edition and obtaining a commercial license -// by contacting . -// -// https://documize.com - -import Ember from 'ember'; -import NotifierMixin from '../../../mixins/notifier'; - -export default Ember.Controller.extend(NotifierMixin, { -}); diff --git a/app/app/pods/document/activity/route.js b/app/app/pods/document/activity/route.js deleted file mode 100644 index d0515980..00000000 --- a/app/app/pods/document/activity/route.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2016 Documize Inc. . All rights reserved. -// -// This software (Documize Community Edition) is licensed under -// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html -// -// You can operate outside the AGPL restrictions by purchasing -// Documize Enterprise Edition and obtaining a commercial license -// by contacting . -// -// https://documize.com - -import Ember from 'ember'; -import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; - -export default Ember.Route.extend(AuthenticatedRouteMixin, { - documentService: Ember.inject.service('document'), - - model() { - this.audit.record("viewed-document-activity"); - - return Ember.RSVP.hash({ - folders: this.modelFor('document').folders, - folder: this.modelFor('document').folder, - document: this.modelFor('document').document, - isEditor: this.modelFor('document').isEditor, - pages: this.modelFor('document').allPages, - tabs: this.modelFor('document').tabs, - activity: this.get('documentService').getMeta(this.modelFor('document').document.get('id')).then((activity) => { - return activity; - }) - }); - } -}); diff --git a/app/app/pods/document/activity/template.hbs b/app/app/pods/document/activity/template.hbs deleted file mode 100644 index 2c687d18..00000000 --- a/app/app/pods/document/activity/template.hbs +++ /dev/null @@ -1 +0,0 @@ -{{document/document-activity document=model.document pages=model.pages activity=model.activity}} diff --git a/app/app/pods/document/files/controller.js b/app/app/pods/document/files/controller.js deleted file mode 100644 index 45ef40b8..00000000 --- a/app/app/pods/document/files/controller.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2016 Documize Inc. . All rights reserved. -// -// This software (Documize Community Edition) is licensed under -// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html -// -// You can operate outside the AGPL restrictions by purchasing -// Documize Enterprise Edition and obtaining a commercial license -// by contacting . -// -// https://documize.com - -import Ember from 'ember'; -import NotifierMixin from '../../../mixins/notifier'; - -export default Ember.Controller.extend(NotifierMixin, { - documentService: Ember.inject.service('document'), - - getAttachments() { - let self = this; - this.get('documentService').getAttachments(this.get('model.document.id')).then(function (files) { - self.set('model.files', files); - }); - }, - - actions: { - onUpload() { - this.getAttachments(); - }, - - onDelete(id, name) { - let self = this; - - this.showNotification(`Deleted ${name}`); - - this.get('documentService').deleteAttachment(this.get('model.document.id'), id).then(function () { - self.getAttachments(); - }); - }, - } -}); diff --git a/app/app/pods/document/files/route.js b/app/app/pods/document/files/route.js deleted file mode 100644 index ac4f8979..00000000 --- a/app/app/pods/document/files/route.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 Documize Inc. . All rights reserved. -// -// This software (Documize Community Edition) is licensed under -// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html -// -// You can operate outside the AGPL restrictions by purchasing -// Documize Enterprise Edition and obtaining a commercial license -// by contacting . -// -// https://documize.com - -import Ember from 'ember'; -import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; - -export default Ember.Route.extend(AuthenticatedRouteMixin, { - documentService: Ember.inject.service('document'), - - model() { - this.audit.record("viewed-document-attachments"); - - return Ember.RSVP.hash({ - folders: this.modelFor('document').folders, - folder: this.modelFor('document').folder, - document: this.modelFor('document').document, - isEditor: this.modelFor('document').isEditor, - pages: this.modelFor('document').allPages, - tabs: this.modelFor('document').tabs, - files: this.get('documentService').getAttachments(this.modelFor('document').document.get('id')) - }); - } -}); diff --git a/app/app/pods/document/files/template.hbs b/app/app/pods/document/files/template.hbs deleted file mode 100644 index ef1f4748..00000000 --- a/app/app/pods/document/files/template.hbs +++ /dev/null @@ -1 +0,0 @@ -{{document/document-files document=model.document files=model.files isEditor=model.isEditor onUpload=(action 'onUpload') onDelete=(action 'onDelete')}} diff --git a/app/app/pods/document/index/controller.js b/app/app/pods/document/index/controller.js index d7aca3a2..a5295646 100644 --- a/app/app/pods/document/index/controller.js +++ b/app/app/pods/document/index/controller.js @@ -25,12 +25,6 @@ export default Ember.Controller.extend(NotifierMixin, { this.set('toggled', !this.get('toggled')); }, - onTagChange(tags) { - let doc = this.get('model.document'); - doc.set('tags', tags); - this.get('documentService').save(doc); - }, - onSaveDocument(doc) { this.get('documentService').save(doc); this.showNotification('Saved'); @@ -169,6 +163,18 @@ export default Ember.Controller.extend(NotifierMixin, { }); }, + onDocumentDelete() { + this.get('documentService').deleteDocument(this.get('model.document.id')).then(() => { + this.audit.record("deleted-page"); + this.send("showNotification", "Deleted"); + this.transitionToRoute('folder', this.get('model.folder.id'), this.get('model.folder.slug')); + }); + }, + + onSaveTemplate(name, desc) { + this.get('templateService').saveAsTemplate(this.get('model.document.id'), name, desc).then(function () {}); + }, + // to test onPageSequenceChange(changes) { this.get('documentService').changePageSequence(this.get('model.document.id'), changes).then(() => { @@ -206,17 +212,6 @@ export default Ember.Controller.extend(NotifierMixin, { this.set('model.pages', pages); this.get('target.router').refresh(); }); - }, + } } }); - -/* - -onDocumentDelete() { - this.get('documentService').deleteDocument(this.get('model.document.id')).then(() => { - this.audit.record("deleted-page"); - this.send("showNotification", "Deleted"); - this.transitionToRoute('folder', this.get('model.folder.id'), this.get('model.folder.slug')); - }); -} -*/ diff --git a/app/app/pods/document/index/template.hbs b/app/app/pods/document/index/template.hbs index c7af9086..30ad690f 100644 --- a/app/app/pods/document/index/template.hbs +++ b/app/app/pods/document/index/template.hbs @@ -1,43 +1,9 @@
diff --git a/app/app/router.js b/app/app/router.js index b4cbe4d0..220cf51f 100644 --- a/app/app/router.js +++ b/app/app/router.js @@ -32,18 +32,9 @@ export default Router.map(function () { this.route('document', { path: 's/:folder_id/:folder_slug/d/:document_id/:document_slug' }, function () { - this.route('files', { - path: 'files' - }); - this.route('activity', { - path: 'activity' - }); this.route('section', { path: 'section/:page_id' }); - this.route('history', { - path: 'history' - }); this.route('block', { path: 'block/:block_id' }); diff --git a/app/app/styles/view/common.scss b/app/app/styles/view/common.scss index c87e3c84..56dac851 100644 --- a/app/app/styles/view/common.scss +++ b/app/app/styles/view/common.scss @@ -3,15 +3,13 @@ > .empty-state { margin: 30px 0; - font-size: 2rem; + font-size: 1.2rem; color: $color-gray; - font-family: 'open_sanslight'; } > .normal-state { margin: 10px; - font-size: 2rem; + font-size: 1.2rem; color: $color-gray; - font-family: 'open_sanslight'; } } diff --git a/app/app/styles/view/document/activity.scss b/app/app/styles/view/document/activity.scss deleted file mode 100644 index a5f3c595..00000000 --- a/app/app/styles/view/document/activity.scss +++ /dev/null @@ -1,139 +0,0 @@ -.document-activity { - > .metrics { - list-style-type: none; - margin: 0 0 30px; - padding: 0; - width: 100%; - text-align: center; - - > .metric { - padding: 0 30px; - display: inline-block; - text-align: center; - - .label { - padding: 0 0 10px; - font-family: $font-regular; - font-size: 0.9rem; - color: $color-gray; - } - - .number { - font-family: $font-light; - font-size: 2rem; - color: $color-off-black; - } - } - } - - > .items { - list-style-type: none; - margin: 0; - padding: 0; - white-space: nowrap; - - > .item { - padding: 20px 0; - width: 100%; - border-bottom: 1px solid $color-border; - - &:last-of-type { - border-bottom: none !important; - } - - > .avatar-box { - display: inline-block; - margin: 3px 10px 0 0; - width: 5%; - } - - > .name { - display: inline-block; - font-size: 1rem; - font-family: $font-light; - color: $color-off-black; - width: 25%; - } - - > .detail { - display: inline-block; - font-size: 1rem; - font-family: $font-regular; - color: $color-off-black; - width: 45%; - - .viewed { - color: $color-goldy; - } - - .added { - color: $color-green; - } - - .changed { - color: $color-blue; - } - - .deleted { - color: $color-red; - } - } - - > .date { - display: inline-block; - font-family: $font-light; - font-size: 1rem; - float: right; - width: 15%; - padding-top: 10px; - } - } - } -} - -.meta-editors { - position: relative; - - > .items { - list-style-type: none; - margin: 0; - padding: 0; - white-space: nowrap; - - > .item { - margin: 15px 0; - overflow-x: hidden; - white-space: nowrap; - text-overflow: ellipsis; - width: 90%; - - .avatar-box { - display: inline-block; - margin: 3px 10px 0 0; - vertical-align: top; - } - - .detail { - display: inline-block; - - .name { - font-size: 1rem; - color: $color-off-black; - } - - .changed { - font-size: 0.9rem; - } - - .deleted { - font-size: 0.9rem; - color: $color-red; - } - - .date { - font-size: 0.8rem; - } - } - } - } -} diff --git a/app/app/styles/view/document/all.scss b/app/app/styles/view/document/all.scss index 18251000..47fbf109 100644 --- a/app/app/styles/view/document/all.scss +++ b/app/app/styles/view/document/all.scss @@ -1,11 +1,10 @@ -@import "activity.scss"; @import "content-linker.scss"; -@import "files.scss"; @import "history.scss"; @import "inline-editor.scss"; @import "layout.scss"; @import "section-editor.scss"; -@import "sidebar.scss"; -@import "toolbar.scss"; +@import "sidebar-view-attachments.scss"; +@import "sidebar-view-activity.scss"; +@import "sidebar-zone.scss"; @import "view.scss"; @import "wysiwyg.scss"; diff --git a/app/app/styles/view/document/files.scss b/app/app/styles/view/document/files.scss deleted file mode 100644 index 1469e610..00000000 --- a/app/app/styles/view/document/files.scss +++ /dev/null @@ -1,82 +0,0 @@ -.document-files { - margin: 0; - - > .upload-document-files { - width: 50%; - padding: 20px; - margin: 0 auto; - text-align: center; - color: $color-gray; - border: 2px dotted $color-gray; - cursor: pointer; - font-size: 1rem; - line-height: 1.7rem; - @include border-radius(10px); - @include ease-in(); - - &:hover { - border-color: $color-link; - color: $color-link; - } - - > .dz-preview, - .dz-processing { - display: none !important; - } - } - - > .list { - margin: 0 0 50px; - padding: 7px 0; - - > .item { - color: $color-off-black; - margin-top: 10px; - padding: 0; - list-style-type: none; - border-bottom: 1px solid $color-border; - padding-bottom: 10px; - - &:last-of-type { - border-bottom: none !important; - } - - > .icon { - margin-right: 10px; - } - - > a { - color: $color-gray; - - &:hover { - color: $color-link; - } - - > .file { - font-size: 1rem; - } - } - - > .action { - float: right; - margin-top: -2px; - margin-right: 5px; - @extend .cursor-pointer; - @extend .transition-all; - display: none; - color: $color-gray; - } - - &:hover { - .action { - display: inline-block; - } - } - } - } -} - -.delete-attachment-dialog, -.delete-page-dialog { - display: none; -} diff --git a/app/app/styles/view/document/sidebar-view-activity.scss b/app/app/styles/view/document/sidebar-view-activity.scss new file mode 100644 index 00000000..9a87009e --- /dev/null +++ b/app/app/styles/view/document/sidebar-view-activity.scss @@ -0,0 +1,52 @@ +.document-sidebar-view-activity { + > .items { + list-style-type: none; + margin: 0; + padding: 0; + white-space: nowrap; + + > .item { + margin: 0; + padding: 10px 0; + width: 100%; + + > .avatar-box { + display: inline-block; + margin: 0 10px 0 0; + } + + > .name { + display: inline-block; + font-size: 0.9rem; + color: $color-gray; + width: 200px; + @extend .truncate; + } + + > .detail { + display: block; + font-size: 0.9rem; + color: $color-off-black; + margin-left: 50px; + width: 200px; + @extend .truncate; + + .viewed { + color: $color-goldy; + } + + .added { + color: $color-green; + } + + .changed { + color: $color-blue; + } + + .deleted { + color: $color-red; + } + } + } + } +} diff --git a/app/app/styles/view/document/sidebar-view-attachments.scss b/app/app/styles/view/document/sidebar-view-attachments.scss new file mode 100644 index 00000000..433790bc --- /dev/null +++ b/app/app/styles/view/document/sidebar-view-attachments.scss @@ -0,0 +1,144 @@ +.document-sidebar-view-attachments { + margin: 0; + + > .upload-document-files { + width: 100%; + padding: 20px; + margin-bottom: 20px; + text-align: center; + color: $color-gray; + border: 1px solid $color-stroke; + cursor: pointer; + font-size: 0.9rem; + line-height: 1.7rem; + @include ease-in(); + + &:hover { + border-color: $color-link; + color: $color-link; + } + + > .dz-preview, + .dz-processing { + display: none !important; + } + } + + > .list { + margin: 0 0 50px; + padding: 7px 0; + + > .item { + color: $color-off-black; + margin: 0; + padding: 10px 0; + font-size: 0.9rem; + list-style-type: none; + + &:last-of-type { + border-bottom: none !important; + } + + > .icon { + margin-right: 10px; + } + + > a { + @extend .truncate; + width: 200px; + color: $color-gray; + + &:hover { + color: $color-link; + } + + > .file { + @extend .truncate; + display: inline-block; + font-size: 0.9rem; + width: 200px; + } + } + + > .action { + float: right; + margin-top: -2px; + margin-right: 5px; + @extend .cursor-pointer; + @extend .transition-all; + display: none; + color: $color-gray; + } + + &:hover { + .action { + display: inline-block; + } + } + } + } +} + +.delete-attachment-dialog, +.delete-page-dialog { + display: none; +} + + + +// .document-structure { +// > .toc-controls { +// margin: 0; +// color: $color-gray; + +// > .round-button-mono { +// color: $color-green; +// border-color: $color-green; + +// > .material-icons { +// color: $color-green; +// } +// } + +// > .disabled { +// @extend .cursor-not-allowed; +// color: $color-stroke; +// border-color: $color-stroke; + +// > .material-icons { +// color: $color-stroke; +// } +// } +// } + +// .entries { +// padding: 0; +// list-style: none; +// font-size: 13px; +// overflow-x: hidden; +// list-style-type: none; +// margin: 20px 0 0; +// font-family: $font-semibold; + +// .item { +// padding: 4px 0; +// text-overflow: ellipsis; +// word-wrap: break-word; +// white-space: nowrap; +// overflow: hidden; + +// > .link { +// color: $color-gray; + +// &:hover { +// color: $color-link; +// } +// } + +// > .selected { +// color: $color-link; +// font-weight: bold; +// } +// } +// } +// } diff --git a/app/app/styles/view/document/sidebar-zone.scss b/app/app/styles/view/document/sidebar-zone.scss new file mode 100644 index 00000000..8434a78f --- /dev/null +++ b/app/app/styles/view/document/sidebar-zone.scss @@ -0,0 +1,65 @@ +.document-sidebar-common { + display: inline-block; + width: 340px; + padding: 40px 20px 40px 20px; + + > .pinner { + cursor: pointer; + + > .material-icons { + color: $color-primary; + } + } + + > .template-header { + color: $color-goldy; + font-size: 1.5em; + margin-bottom: 20px; + } +} + +.document-sidebar-toolbar { + display: inline-block; + width: 60px; + background-color: $color-toolbar; + text-align: center; + position: fixed; + right: 0; + top: 0; + height: 100%; + padding: 50px 0 0 0; + + > .selected { + background-color: $color-off-black !important; + + > .material-icons { + color: $color-white !important; + } + } + + > .round-button-mono { + > .material-icons { + color: $color-gray; + } + } +} + +.document-sidebar-wrapper { + padding: 40px 20px 40px 20px; + margin-right: 60px; + + .document-sidebar-panel { + width: 300px; + // top: 0; + // bottom: 0; + // position: fixed; + // overflow-y: scroll; + // overflow-x: hidden; + + > .title { + color: $color-primary; + font-size: 1.1rem; + margin-bottom: 30px; + } + } +} diff --git a/app/app/styles/view/document/sidebar.scss b/app/app/styles/view/document/sidebar.scss deleted file mode 100644 index dcca0bbf..00000000 --- a/app/app/styles/view/document/sidebar.scss +++ /dev/null @@ -1,142 +0,0 @@ -.document-sidebar-common { - display: inline-block; - width: 340px; - padding: 40px 20px; -} - -.document-sidebar-toolbar { - display: inline-block; - width: 60px; - background-color: $color-toolbar; - text-align: center; - position: fixed; - right: 0; - top: 0; - height: 100%; - padding: 50px 0 0 0; -} - -// .xxxx { - -// .is-template { -// color: $color-goldy; -// font-weight: bold; -// font-size: 1.5em; -// margin-bottom: 30px; -// padding-bottom: 5px; -// border-bottom: 1px dotted $color-goldy; -// } - -// @extend .no-select; - -// .stuck-toc { -// position: fixed; -// top: 20px; -// -webkit-animation: fadein 1s; -// -moz-animation: fadein 1s; -// -ms-animation: fadein 1s; -// -o-animation: fadein 1s; -// animation: fadein 1s; -// } - -// .section-tool { -// position: absolute; -// top: 130px; -// right: -18px; -// z-index: 999; -// } - -// .scroll-tool { -// position: absolute; -// top: 130px; -// right: -18px; -// z-index: 999; -// -webkit-animation: fadein 1s; -// -moz-animation: fadein 1s; -// -ms-animation: fadein 1s; -// -o-animation: fadein 1s; -// animation: fadein 1s; -// } - -// .stuck-tool { -// position: fixed !important; -// top: 130px !important; -// right: 0; -// left: 0; -// -webkit-animation: fadein 1s; -// -moz-animation: fadein 1s; -// -ms-animation: fadein 1s; -// -o-animation: fadein 1s; -// animation: fadein 1s; -// } - -// .close-action { -// float: right; - -// > .round-button-mono { -// color: $color-stroke; -// border-color: $color-stroke; - -// > .material-icons { -// color: $color-stroke; -// } -// } -// } - -// .document-structure { -// > .toc-controls { -// margin: 0; -// color: $color-gray; - -// > .round-button-mono { -// color: $color-green; -// border-color: $color-green; - -// > .material-icons { -// color: $color-green; -// } -// } - -// > .disabled { -// @extend .cursor-not-allowed; -// color: $color-stroke; -// border-color: $color-stroke; - -// > .material-icons { -// color: $color-stroke; -// } -// } -// } - -// .entries { -// padding: 0; -// list-style: none; -// font-size: 13px; -// overflow-x: hidden; -// list-style-type: none; -// margin: 20px 0 0; -// font-family: $font-semibold; - -// .item { -// padding: 4px 0; -// text-overflow: ellipsis; -// word-wrap: break-word; -// white-space: nowrap; -// overflow: hidden; - -// > .link { -// color: $color-gray; - -// &:hover { -// color: $color-link; -// } -// } - -// > .selected { -// color: $color-link; -// font-weight: bold; -// } -// } -// } -// } -// } diff --git a/app/app/styles/view/document/toolbar.scss b/app/app/styles/view/document/toolbar.scss deleted file mode 100644 index 9937141c..00000000 --- a/app/app/styles/view/document/toolbar.scss +++ /dev/null @@ -1,114 +0,0 @@ -.document-toolbar { - position: relative; - margin: -30px 0 40px; - height: 60px; - padding: 5px 30px 0; - background-color: $color-sidebar; - @include border-radius-bottom-right(5px); - @include border-radius-bottom-left(5px); - @extend .no-select; - - > .tabs { - width: 70%; - height: 50px; - margin-top: 15px; - display: inline-block; - - > .tab { - list-style-type: none; - display: inline-block; - margin: 0 20px 0 0; - padding: 0; - color: $color-gray; - font-family: $font-semibold; - cursor: pointer; - - &:hover { - color: $color-link; - } - - > a { - color: $color-gray; - @include ease-in(); - - &:hover { - color: $color-link; - } - } - - > .active { - color: $color-link; - - > .add-tab { - > i { - color: $color-link; - } - } - } - - .add-tab { - display: inline-block; - vertical-align: text-top; - @include ease-in(); - - > i { - font-size: 1.5rem; - color: $color-gray; - - &:hover { - color: $color-link; - } - } - } - } - } - - > .options { - width: 30%; - height: 50px; - margin-top: 15px; - display: inline-block; - text-align: right; - float: right; - - > .option { - list-style-type: none; - display: inline-block; - margin: 0 0 0 20px; - padding: 0; - color: $color-gray; - cursor: pointer; - @include ease-in(); - - &:hover { - color: $color-link; - } - - > .pinned { - color: $color-primary; - } - } - - > a { - display: inline-block; - - > .option { - list-style-type: none; - display: inline-block; - margin: 0 0 0 20px; - padding: 0; - color: $color-gray; - cursor: pointer; - @include ease-in(); - - &:hover { - color: $color-link; - } - - > .pinned { - color: $color-primary; - } - } - } - } -} diff --git a/app/app/styles/widget/widget-avatar.scss b/app/app/styles/widget/widget-avatar.scss index c6999fad..9828b58f 100644 --- a/app/app/styles/widget/widget-avatar.scss +++ b/app/app/styles/widget/widget-avatar.scss @@ -3,7 +3,7 @@ background-color: $color-gray; @include border-radius(20px); @include ease-in(); - padding: 7px 0 0 0; + padding: 10px 0 0 0; letter-spacing: 1px; text-align: center; height: 35px; diff --git a/app/app/templates/components/document/edit-tools.hbs b/app/app/templates/components/document/content-linker.hbs similarity index 100% rename from app/app/templates/components/document/edit-tools.hbs rename to app/app/templates/components/document/content-linker.hbs diff --git a/app/app/templates/components/document/document-activity.hbs b/app/app/templates/components/document/document-activity.hbs deleted file mode 100644 index 15aae77e..00000000 --- a/app/app/templates/components/document/document-activity.hbs +++ /dev/null @@ -1,41 +0,0 @@ -
-
    -
  • -
    created
    -
    {{time-ago document.created}}
    -
  • -
  • -
    viewers
    -
    {{activity.viewers.length}}
    -
  • -
  • -
    actions
    -
    {{activity.editors.length}}
    -
  • -
-
    - {{#each sortedItems as |e|}} -
  • -
    -
    {{user-initials e.item.firstname e.item.lastname}}
    -
    -
    {{e.item.firstname}} {{e.item.lastname}}
    -
    - {{#if e.item.deleted}} -
    {{e.item.changeLabel}}
    - {{/if}} - {{#if e.item.changed}} -
    {{e.item.changeLabel}}
    - {{/if}} - {{#if e.item.added}} -
    {{e.item.changeLabel}}
    - {{/if}} - {{#if e.item.viewed}} -
    {{e.item.changeLabel}}
    - {{/if}} -
    -
    {{time-ago e.date}}
    -
  • - {{/each}} -
-
diff --git a/app/app/templates/components/document/document-files.hbs b/app/app/templates/components/document/document-files.hbs deleted file mode 100644 index 2a274815..00000000 --- a/app/app/templates/components/document/document-files.hbs +++ /dev/null @@ -1,44 +0,0 @@ -
-
    - {{#each files key="id" as |a index|}} -
  • - - - {{ a.filename }} - - {{#if isEditor}} -
    - delete -
    - {{/if}} -
  • - {{/each}} -
- - {{#if emptyState}} -
-
- There are no files -
-
- {{/if}} - -
- Drag-drop files or click to select files -
-
- - diff --git a/app/app/templates/components/document/document-toolbar.hbs b/app/app/templates/components/document/document-toolbar.hbs deleted file mode 100644 index 02d7191b..00000000 --- a/app/app/templates/components/document/document-toolbar.hbs +++ /dev/null @@ -1,116 +0,0 @@ - - -
diff --git a/app/app/templates/components/document/sidebar-view-activity.hbs b/app/app/templates/components/document/sidebar-view-activity.hbs new file mode 100644 index 00000000..5e766f00 --- /dev/null +++ b/app/app/templates/components/document/sidebar-view-activity.hbs @@ -0,0 +1,29 @@ +
+
Activity
+
+
    + {{#each sortedItems as |e|}} +
  • +
    +
    {{user-initials e.item.firstname e.item.lastname}}
    +
    +
    {{e.item.firstname}} {{e.item.lastname}}, {{time-ago e.date}}
    +
    + {{#if e.item.deleted}} +
    {{e.item.changeLabel}}
    + {{/if}} + {{#if e.item.changed}} +
    {{e.item.changeLabel}}
    + {{/if}} + {{#if e.item.added}} +
    {{e.item.changeLabel}}
    + {{/if}} + {{#if e.item.viewed}} +
    {{e.item.changeLabel}}
    + {{/if}} +
    +
  • + {{/each}} +
+
+
\ No newline at end of file diff --git a/app/app/templates/components/document/sidebar-view-attachments.hbs b/app/app/templates/components/document/sidebar-view-attachments.hbs new file mode 100644 index 00000000..f28224aa --- /dev/null +++ b/app/app/templates/components/document/sidebar-view-attachments.hbs @@ -0,0 +1,47 @@ +
+
Attachments
+
+
+ Drag-drop files or click to select files +
+ +
    + {{#each files key="id" as |a index|}} +
  • + + + {{ a.filename }} + + {{#if isEditor}} +
    + delete +
    + {{/if}} +
  • + {{/each}} +
+ + {{#if emptyState}} +
+
+ There are no attachments +
+
+ {{/if}} +
+ + +
\ No newline at end of file diff --git a/app/app/templates/components/document/sidebar-zone.hbs b/app/app/templates/components/document/sidebar-zone.hbs new file mode 100644 index 00000000..46f220fe --- /dev/null +++ b/app/app/templates/components/document/sidebar-zone.hbs @@ -0,0 +1,98 @@ +
+ +
+
+ view_headline +
+
+
+ attach_file +
+
+
+ timeline +
+
+
+ person +
+
+
+ chat_bubble +
+
+
+ share +
+
+ +
+ {{#if document.template}} +
Template
+ {{/if}} + {{document/tag-editor documentTags=document.tags isEditor=isEditor onChange=(action 'onTagChange')}} +
+ +
+ {{#if (is-equal currentTab 'attachments')}} + {{document/sidebar-view-attachments document=document isEditor=isEditor}} + {{/if}} + + {{#if (is-equal currentTab 'activity')}} + {{document/sidebar-view-activity document=document pages=pages isEditor=isEditor}} + {{/if}} +
+ +{{#dropdown-menu target="sidebar-zone-more-button" position="bottom right" open="click" onOpenCallback=(action 'onMenuOpen') onCloseCallback=(action 'onMenuOpen')}} + +{{/dropdown-menu}} + +{{#if menuOpen}} + {{#dropdown-dialog target="delete-document-button" position="bottom right" button="Delete" color="flat-red" onAction=(action 'onDeleteDocument')}} +

Are you sure you want to delete this document?

+

There is no undo, so be careful.

+ {{/dropdown-dialog}} + + {{#unless pinState.isPinned}} + {{#dropdown-dialog target="pin-document-button" position="bottom right" button="Pin" color="flat-green" onAction=(action 'onPin') focusOn="pin-document-name" }} +
+ +
A 3 or 4 character name
+ {{input type='text' id="pin-document-name" value=pinState.newName}} +
+ {{/dropdown-dialog}} + {{/unless}} + + {{#dropdown-dialog target="save-template-button" position="bottom right" button="Save as Template" color="flat-green" onAction=(action 'onSaveTemplate') focusOn="new-template-name" }} +
+ +
Short name for this type of document
+ {{input type='text' id="new-template-name" value=saveTemplate.name}} +
+
+ +
Explain use case for this template
+ {{textarea value=saveTemplate.description rows="3" id="new-template-desc"}} +
+ {{/dropdown-dialog}} +{{/if}} + diff --git a/app/app/templates/components/layout/zone-document-sidebar.hbs b/app/app/templates/components/layout/zone-document-sidebar.hbs deleted file mode 100644 index 0a24b564..00000000 --- a/app/app/templates/components/layout/zone-document-sidebar.hbs +++ /dev/null @@ -1,3 +0,0 @@ -

- sidebar -

diff --git a/app/app/templates/components/section/base-editor-inline.hbs b/app/app/templates/components/section/base-editor-inline.hbs index aaa7984a..2ffa32cb 100644 --- a/app/app/templates/components/section/base-editor-inline.hbs +++ b/app/app/templates/components/section/base-editor-inline.hbs @@ -6,7 +6,7 @@ {{/if}} {{#if contentLinkerButton}} - {{document/edit-tools tagName="span" document=document folder=folder page=page onInsertLink=(action 'onInsertLink')}} + {{document/content-linker tagName="span" document=document folder=folder page=page onInsertLink=(action 'onInsertLink')}}
link