diff --git a/gui/app/components/document/document-toolbar.js b/gui/app/components/document/document-toolbar.js deleted file mode 100644 index 4e717a3c..00000000 --- a/gui/app/components/document/document-toolbar.js +++ /dev/null @@ -1,149 +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 { inject as service } from '@ember/service'; - -import Component from '@ember/component'; -import TooltipMixin from '../../mixins/tooltip'; -import NotifierMixin from '../../mixins/notifier'; - -export default Component.extend(TooltipMixin, NotifierMixin, { - documentService: service('document'), - sectionService: service('section'), - sessionService: service('session'), - appMeta: service(), - userService: service('user'), - localStorage: service(), - pinned: service(), - menuOpen: false, - pinState : { - isPinned: false, - pinId: '', - newName: '', - }, - saveTemplate: { - name: "", - description: "" - }, - - init() { - this._super(...arguments); - }, - - didReceiveAttrs() { - this._super(...arguments); - - this.set('saveTemplate.name', this.get('document.name')); - this.set('saveTemplate.description', this.get('document.excerpt')); - - this.get('pinned').isDocumentPinned(this.get('document.id')).then( (pinId) => { - this.set('pinState.pinId', pinId); - this.set('pinState.isPinned', pinId !== ''); - }); - - this.set('pinState.newName', this.get('document.name')); - }, - - didRender() { - this.destroyTooltips(); - - if (this.get('permissions.documentEdit')) { - this.addTooltip(document.getElementById("document-activity-button")); - } - }, - - actions: { - onMenuOpen() { - this.set('menuOpen', !this.get('menuOpen')); - }, - - onDeleteDocument() { - this.attrs.onDocumentDelete(); - }, - - onPrintDocument() { - $("#sidebar-zone-more-button").click(); - window.print(); - }, - - onPageSequenceChange(changes) { - this.get('onPageSequenceChange')(changes); - }, - - onPageLevelChange(changes) { - this.get('onPageLevelChange')(changes); - }, - - onGotoPage(id) { - this.get('onGotoPage')(id); - }, - - onUnpin() { - this.get('pinned').unpinItem(this.get('pinState.pinId')).then(() => { - this.set('pinState.isPinned', false); - this.set('pinState.pinId', ''); - this.eventBus.publish('pinChange'); - }); - }, - - onPin() { - let pin = { - pin: this.get('pinState.newName'), - documentId: this.get('document.id'), - folderId: this.get('folder.id') - }; - - if (is.empty(pin.pin)) { - $("#pin-document-name").addClass("error").focus(); - return false; - } - - this.get('pinned').pinItem(pin).then((pin) => { - this.set('pinState.isPinned', true); - this.set('pinState.pinId', pin.get('id')); - 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; - }, - - onLayoutChange(layout) { - let doc = this.get('document'); - doc.set('layout', layout); - - if (this.get('permissions.documentEdit')) { - this.get('documentService').save(doc); - } - - return true; - } - } -}); diff --git a/gui/app/components/document/document-view.js b/gui/app/components/document/document-view.js index c8225fb7..3deb430d 100644 --- a/gui/app/components/document/document-view.js +++ b/gui/app/components/document/document-view.js @@ -10,7 +10,6 @@ // https://documize.com import { notEmpty, empty } from '@ember/object/computed'; - import { schedule } from '@ember/runloop'; import { inject as service } from '@ember/service'; import Component from '@ember/component'; diff --git a/gui/app/components/folder/category-admin.js b/gui/app/components/folder/category-admin.js index 21a5f2e6..914cf43c 100644 --- a/gui/app/components/folder/category-admin.js +++ b/gui/app/components/folder/category-admin.js @@ -11,11 +11,10 @@ import Component from '@ember/component'; import { inject as service } from '@ember/service'; -import NotifierMixin from '../../mixins/notifier'; import TooltipMixin from '../../mixins/tooltip'; -import DropdownMixin from '../../mixins/dropdown'; +import ModalMixin from '../../mixins/modal'; -export default Component.extend(NotifierMixin, TooltipMixin, DropdownMixin, { +export default Component.extend(ModalMixin, TooltipMixin, { userService: service('user'), categoryService: service('category'), appMeta: service(), @@ -114,13 +113,11 @@ export default Component.extend(NotifierMixin, TooltipMixin, DropdownMixin, { let cat = this.get('category').findBy('id', id); this.set('deleteId', cat.get('id')); - $('#category-delete-modal').modal('dispose'); - $('#category-delete-modal').modal({show: true}); + this.modalOpen('#category-delete-modal', {show: true}); }, onDelete() { - $('#category-delete-modal').modal('hide'); - $('#category-delete-modal').modal('dispose'); + this.modalClose('#category-delete-modal'); this.get('categoryService').delete(this.get('deleteId')).then(() => { this.load(); diff --git a/gui/app/components/toolbar/for-document.js b/gui/app/components/toolbar/for-document.js index 5b91cd81..b7a9a7db 100644 --- a/gui/app/components/toolbar/for-document.js +++ b/gui/app/components/toolbar/for-document.js @@ -10,12 +10,12 @@ // https://documize.com import Component from '@ember/component'; -// import { schedule } from '@ember/runloop'; import { inject as service } from '@ember/service'; import AuthMixin from '../../mixins/auth'; import TooltipMixin from '../../mixins/tooltip'; +import ModalMixin from '../../mixins/modal'; -export default Component.extend(TooltipMixin, AuthMixin, { +export default Component.extend(ModalMixin, TooltipMixin, AuthMixin, { spaceService: service('folder'), session: service(), appMeta: service(), @@ -25,6 +25,10 @@ export default Component.extend(TooltipMixin, AuthMixin, { pinId: '', newName: '' }, + saveTemplate: { + name: '', + description: '' + }, didReceiveAttrs() { this._super(...arguments); @@ -37,10 +41,15 @@ export default Component.extend(TooltipMixin, AuthMixin, { this.set('pinState.newName', doc.get('name')); this.renderTooltips(); }); + + this.set('saveTemplate.name', this.get('document.name')); + this.set('saveTemplate.description', this.get('document.excerpt')); }, didInsertElement() { this._super(...arguments); + + this.modalInputFocus('#document-template-modal', '#new-template-name'); }, willDestroyElement() { @@ -49,6 +58,10 @@ export default Component.extend(TooltipMixin, AuthMixin, { }, actions: { + onDocumentDelete() { + this.attrs.onDocumentDelete(); + }, + onPrintDocument() { window.print(); }, @@ -80,5 +93,32 @@ export default Component.extend(TooltipMixin, AuthMixin, { return true; }, + + onSaveTemplate() { + let name = this.get('saveTemplate.name'); + let excerpt = this.get('saveTemplate.description'); + + if (is.empty(name)) { + $("#new-template-name").addClass("is-invalid").focus(); + return; + } + + if (is.empty(excerpt)) { + $("#new-template-desc").addClass("is-invalid").focus(); + return; + } + + $("#new-template-name").removeClass("is-invalid"); + $("#new-template-desc").removeClass("is-invalid"); + + this.set('saveTemplate.name', ''); + this.set('saveTemplate.description', ''); + + this.attrs.onSaveTemplate(name, excerpt); + + this.modalClose('#document-template-modal'); + + return true; + }, } }); diff --git a/gui/app/components/toolbar/for-space.js b/gui/app/components/toolbar/for-space.js index 75b8a6c2..96b9eb5c 100644 --- a/gui/app/components/toolbar/for-space.js +++ b/gui/app/components/toolbar/for-space.js @@ -10,14 +10,14 @@ // https://documize.com import Component from '@ember/component'; -import { schedule } from '@ember/runloop'; import { computed } from '@ember/object'; import { inject as service } from '@ember/service'; import NotifierMixin from '../../mixins/notifier'; import TooltipMixin from '../../mixins/tooltip'; +import ModalMixin from '../../mixins/modal'; import AuthMixin from '../../mixins/auth'; -export default Component.extend(NotifierMixin, TooltipMixin, AuthMixin, { +export default Component.extend(NotifierMixin, ModalMixin, TooltipMixin, AuthMixin, { spaceService: service('folder'), session: service(), appMeta: service(), @@ -53,25 +53,17 @@ export default Component.extend(NotifierMixin, TooltipMixin, AuthMixin, { }); this.set('movedFolderOptions', targets); + + if (this.get('inviteMessage').length === 0) { + this.set('inviteMessage', this.getDefaultInvitationMessage()); + } }, didInsertElement() { this._super(...arguments); - $('#space-delete-modal').on('show.bs.modal', function(event) { // eslint-disable-line no-unused-vars - schedule('afterRender', () => { - $("#delete-space-name").focus(); - }); - }); - - $('#space-invite-modal').on('show.bs.modal', () => { // eslint-disable-line no-unused-vars - schedule('afterRender', () => { - $("#space-invite-email").focus(); - if (this.get('inviteMessage').length === 0) { - this.set('inviteMessage', this.getDefaultInvitationMessage()); - } - }); - }); + this.modalInputFocus('#space-delete-modal', '#delete-space-name'); + this.modalInputFocus('#space-invite-modal', '#space-invite-email'); }, willDestroyElement() { @@ -151,8 +143,7 @@ export default Component.extend(NotifierMixin, TooltipMixin, AuthMixin, { $('#space-invite-email').removeClass('is-invalid'); }); - $('#space-invite-modal').modal('hide'); - $('#space-invite-modal').modal('dispose'); + this.modalClose('#space-invite-modal'); }, onSpaceDelete(e) { @@ -171,8 +162,8 @@ export default Component.extend(NotifierMixin, TooltipMixin, AuthMixin, { this.attrs.onDeleteSpace(this.get('space.id')); - $('#space-delete-modal').modal('hide'); - $('#space-delete-modal').modal('dispose'); + + this.modalClose('#space-delete-modal'); }, onAddSpace(e) { diff --git a/gui/app/mixins/modal.js b/gui/app/mixins/modal.js new file mode 100644 index 00000000..9c2dfa48 --- /dev/null +++ b/gui/app/mixins/modal.js @@ -0,0 +1,36 @@ +// 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 Mixin from '@ember/object/mixin'; +import { schedule } from '@ember/runloop'; + +export default Mixin.create({ + // e.g. #document-template-modal, #new-template-name + modalInputFocus(modalId, inputId) { + $(modalId).on('show.bs.modal', function(event) { // eslint-disable-line no-unused-vars + schedule('afterRender', () => { + $(inputId).focus(); + }); + }); + }, + + // e.g. #document-template-modal + modalClose(modalId) { + $(modalId).modal('hide'); + $(modalId).modal('dispose'); + }, + + // e.g. #document-template-modal + modalOpen(modalId, options) { + $(modalId).modal('dispose'); + $(modalId).modal(options); + } +}); diff --git a/gui/app/pods/document/index/template.hbs b/gui/app/pods/document/index/template.hbs index 9854a63b..9d08d91d 100644 --- a/gui/app/pods/document/index/template.hbs +++ b/gui/app/pods/document/index/template.hbs @@ -1,29 +1,31 @@ {{layout/nav-bar}}
- {{toolbar/for-document document=model.document spaces=model.folders space=model.folder permissions=model.permissions}} + {{toolbar/for-document document=model.document spaces=model.folders space=model.folder permissions=model.permissions onDocumentDelete=(action 'onDocumentDelete') onSaveTemplate=(action 'onSaveTemplate')}} + {{document/document-heading document=model.document permissions=model.permissions onSaveDocument=(action 'onSaveDocument')}} + {{document/document-meta document=model.document folder=model.folder folders=model.folders permissions=model.permissions onSaveDocument=(action 'onSaveDocument')}} -
-
- {{document/document-toolbar - document=model.document folder=model.folder folders=model.folders permissions=model.permissions - onDocumentDelete=(action 'onDocumentDelete') onSaveTemplate=(action 'onSaveTemplate') - onPageSequenceChange=(action 'onPageSequenceChange') onPageLevelChange=(action 'onPageLevelChange') - onGotoPage=(action 'onGotoPage')}} -
+
    +
  • Content
  • +
  • Attachments
  • +
  • Activity
  • +
  • Revisions
  • +
+ {{document/document-view + document=model.document links=model.links pages=model.pages + folder=model.folder folders=model.folders sections=model.sections permissions=model.permissions pageId=pageId + onSavePage=(action 'onSavePage') onInsertSection=(action 'onInsertSection') + onSavePageAsBlock=(action 'onSavePageAsBlock') onDeleteBlock=(action 'onDeleteBlock') onGotoPage=(action 'onGotoPage') + onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onPageDeleted')}} + +
{{document/document-sidebar tab=tab document=model.document folder=model.folder pages=model.pages page=model.page permissions=model.permissions onPageSequenceChange=(action 'onPageSequenceChange') onPageLevelChange=(action 'onPageLevelChange') onGotoPage=(action 'onGotoPage')}} - - {{document/document-view - document=model.document links=model.links pages=model.pages - folder=model.folder folders=model.folders sections=model.sections permissions=model.permissions pageId=pageId - onSavePage=(action 'onSavePage') onInsertSection=(action 'onInsertSection') - onSavePageAsBlock=(action 'onSavePageAsBlock') onDeleteBlock=(action 'onDeleteBlock') onGotoPage=(action 'onGotoPage') - onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onPageDeleted')}}
+
diff --git a/gui/app/styles/color.scss b/gui/app/styles/color.scss index 3c38c44d..bec440e2 100644 --- a/gui/app/styles/color.scss +++ b/gui/app/styles/color.scss @@ -25,6 +25,7 @@ $color-off-white: #f5f5f5; $color-dark: #434343; $color-gray: #8b9096; $color-gray-light: #d8d8d8; +$color-gray-light2: #eaeaea; $color-border: #d3d3d3; // colors diff --git a/gui/app/styles/view/document/all.scss b/gui/app/styles/view/document/all.scss index 81367013..f0cd3166 100644 --- a/gui/app/styles/view/document/all.scss +++ b/gui/app/styles/view/document/all.scss @@ -6,4 +6,4 @@ @import "attachments.scss"; @import "toc.scss"; @import "view.scss"; -@import "wysiwyg.scss"; +@import "new-section.scss"; diff --git a/gui/app/styles/view/document/doc-meta.scss b/gui/app/styles/view/document/doc-meta.scss index d7d22446..f82955fa 100644 --- a/gui/app/styles/view/document/doc-meta.scss +++ b/gui/app/styles/view/document/doc-meta.scss @@ -3,9 +3,9 @@ margin-top: 3rem; .doc-title { - font-size: 2rem; margin: 50px 0 10px; - font-weight: normal; + font-size: 2rem; + font-weight: bold; } .doc-excerpt { diff --git a/gui/app/styles/view/document/doc-structure.scss b/gui/app/styles/view/document/doc-structure.scss new file mode 100644 index 00000000..f0673d32 --- /dev/null +++ b/gui/app/styles/view/document/doc-structure.scss @@ -0,0 +1,26 @@ +.document-structure { + margin: 0 0 0 0; + + .page-toolbar { + text-align: right; + } + + .page-header { + margin: 0 0 0.7rem 0; + + > .page-number { + color: $color-dark; + background-color: $color-gray-light2; + padding: 0.4rem 1rem; + font-size: 1.8rem; + margin: 0 1.5rem 0 0; + font-weight: normal; + text-align: center; + display: inline-block; + } + + > .page-title { + display: inline-block; + } + } +} diff --git a/gui/app/styles/view/document/document.scss b/gui/app/styles/view/document/document.scss index 0c80e785..f0349630 100644 --- a/gui/app/styles/view/document/document.scss +++ b/gui/app/styles/view/document/document.scss @@ -1 +1,3 @@ @import "doc-meta.scss"; +@import "doc-structure.scss"; +@import "wysiwyg.scss"; diff --git a/gui/app/styles/view/document/new-section.scss b/gui/app/styles/view/document/new-section.scss new file mode 100644 index 00000000..00a87074 --- /dev/null +++ b/gui/app/styles/view/document/new-section.scss @@ -0,0 +1,192 @@ +.start-section { + @extend .no-select; + height: 60px; + background-color: transparent; + position: relative; + cursor: pointer; + + > .start-button { + display: none; + text-align: center; + padding-top: 20px; + color: $color-green; + font-size: 1rem; + position: relative; + + > .round-button { + opacity: 0.6 !important; + } + + > .label { + display: inline-block; + margin-left: 10px; + } + + > .line { + display: inline-block; + height: 1px; + border: 1px solid $color-green; + width: 100px; + margin: 0 20px 0 20px; + opacity: 0.2; + } + } + + &:first-of-type { + height: 30px; + + > .start-button { + padding-top: 0; + } + } +} + +.start-section-empty-state { + > .start-button { + display: block; + } +} + +.new-section-wizard { + @include border-radius(2px); + margin: 0 0 30px 0; + padding: 30px; + border: 1px solid $color-stroke; + background-color: $color-off-white; + display: none; + + .section-name { + font-weight: bold; + font-size: 1.5rem; + margin: 0 0 30px 0; + color: $color-black; + } + + .template-caption { + color: $color-gray; + margin: 10px 0 10px 0; + font-size: 1.2rem; + } + + > .list-wrapper { + height: 440px; + overflow-y: auto; + + > .preset-list { + margin: 0; + padding: 0; + + > .item { + @include ease-in(); + @include border-radius(4px); + list-style: none; + cursor: pointer; + display: inline-block; + border: 1px solid $color-stroke; + background-color: $color-white; + margin: 0 20px 20px 0; + padding: 15px 0 0 20px; + width: 200px; + height: 60px; + + &:hover { + @include ease-in(); + border-color: $color-link; + } + + .icon { + text-align: center; + display: inline-block; + width: 40px; + margin-right: 10px; + float: left; + + > .img { + text-align: center; + display: inline-block; + height: 30px; + width: 30px; + float: left; + } + } + + > .title { + font-size: 1rem; + font-weight: normal; + color: $color-off-black; + letter-spacing: 0.5px; + margin-top: 6px; + } + } + } + + > .block-list { + margin: 0; + padding: 0; + + > .item { + @include ease-in(); + @include border-radius(4px); + list-style: none; + cursor: pointer; + display: inline-block; + border: 1px solid $color-stroke; + background-color: $color-white; + margin: 0 20px 20px 0; + padding: 12px 0 0 20px; + width: 423px; + height: 60px; + position: relative; + + &:hover { + @include ease-in(); + border-color: $color-link; + + > .block-actions { + display: block; + } + } + + > .block-actions { + @include ease-in(); + display: none; + position: absolute; + top: 10px; + right: 8px; + + .material-icons { + color: $color-stroke; + font-size: 1rem; + } + } + + > .details { + width: 350px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + + > .title { + font-size: 1rem; + font-weight: normal; + color: $color-off-black; + letter-spacing: 0.5px; + margin-top: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + > .desc { + color: $color-gray; + font-size: 0.8rem; + margin-top: 5px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + } + } + } +} diff --git a/gui/app/styles/view/document/view.scss b/gui/app/styles/view/document/view.scss index f1f4f3ed..d60e2542 100644 --- a/gui/app/styles/view/document/view.scss +++ b/gui/app/styles/view/document/view.scss @@ -1,44 +1,8 @@ -.zone-document-content { - .doc-title { - font-size: 2rem; - margin: 50px 0 10px; - font-weight: normal; - // color: $color-primary; - } - - .doc-excerpt { - font-size: 1.2rem; - color: $color-gray; - margin: 0 0 45px; - } - - .edit-document-heading { - margin: 50px 0 0 0; - - .edit-doc-title { - > input { - font-size: 2rem; - font-weight: normal; - margin: 0 0 10px; - color: $color-wysiwyg; - } - } - - .edit-doc-excerpt { - font-size: 1.2rem; - margin: 0 0 10px; - color: $color-gray; - } - } -} - .document-view { margin: 0 0 0 0; .is-a-page { - @include content-container(); @include ease-in(); - @extend .transition-all; overflow-x: auto; &:hover { @@ -122,235 +86,38 @@ height: 60px; background-color: transparent; } - - .start-section { - @extend .no-select; - height: 60px; - background-color: transparent; - position: relative; - cursor: pointer; - - > .start-button { - display: none; - text-align: center; - padding-top: 20px; - color: $color-green; - font-size: 1rem; - position: relative; - - > .round-button { - opacity: 0.6 !important; - } - - > .label { - display: inline-block; - margin-left: 10px; - } - - > .line { - display: inline-block; - height: 1px; - border: 1px solid $color-green; - width: 100px; - margin: 0 20px 0 20px; - opacity: 0.2; - } - } - - &:first-of-type { - height: 30px; - - > .start-button { - padding-top: 0; - } - } - } - - .start-section-empty-state { - > .start-button { - display: block; - } - } - - .new-section-wizard { - @include border-radius(2px); - margin: 0 0 30px 0; - padding: 30px; - border: 1px solid $color-stroke; - background-color: $color-off-white; - display: none; - - .section-name { - font-weight: bold; - font-size: 1.5rem; - margin: 0 0 30px 0; - color: $color-black; - } - - .template-caption { - color: $color-gray; - margin: 10px 0 10px 0; - font-size: 1.2rem; - } - - > .list-wrapper { - height: 440px; - overflow-y: auto; - - > .preset-list { - margin: 0; - padding: 0; - - > .item { - @include ease-in(); - @include border-radius(4px); - list-style: none; - cursor: pointer; - display: inline-block; - border: 1px solid $color-stroke; - background-color: $color-white; - margin: 0 20px 20px 0; - padding: 15px 0 0 20px; - width: 200px; - height: 60px; - - &:hover { - @include ease-in(); - border-color: $color-link; - } - - .icon { - text-align: center; - display: inline-block; - width: 40px; - margin-right: 10px; - float: left; - - > .img { - text-align: center; - display: inline-block; - height: 30px; - width: 30px; - float: left; - } - } - - > .title { - font-size: 1rem; - font-weight: normal; - color: $color-off-black; - letter-spacing: 0.5px; - margin-top: 6px; - } - } - } - - > .block-list { - margin: 0; - padding: 0; - - > .item { - @include ease-in(); - @include border-radius(4px); - list-style: none; - cursor: pointer; - display: inline-block; - border: 1px solid $color-stroke; - background-color: $color-white; - margin: 0 20px 20px 0; - padding: 12px 0 0 20px; - width: 423px; - height: 60px; - position: relative; - - &:hover { - @include ease-in(); - border-color: $color-link; - - > .block-actions { - display: block; - } - } - - > .block-actions { - @include ease-in(); - display: none; - position: absolute; - top: 10px; - right: 8px; - - .material-icons { - color: $color-stroke; - font-size: 1rem; - } - } - - > .details { - width: 350px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - - > .title { - font-size: 1rem; - font-weight: normal; - color: $color-off-black; - letter-spacing: 0.5px; - margin-top: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - > .desc { - color: $color-gray; - font-size: 0.8rem; - margin-top: 5px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - } - } - } - } - } } -.document-view-unified { - margin: 0 0 50px 0; - @include content-container(); - @include ease-in(); - @extend .transition-all; +// .document-view-unified { +// margin: 0 0 50px 0; +// @include content-container(); +// @include ease-in(); +// @extend .transition-all; - .is-a-page, .is-a-tab { - padding: 0 !important; - box-shadow: none !important; - background-color: transparent !important; - @include border-radius(0px); - } +// .is-a-page, .is-a-tab { +// padding: 0 !important; +// box-shadow: none !important; +// background-color: transparent !important; +// @include border-radius(0px); +// } - .tab-min, .tab-max { - padding: 0 !important; - } +// .tab-min, .tab-max { +// padding: 0 !important; +// } - .start-section { - height: 50px !important; - } -} +// .start-section { +// height: 50px !important; +// } +// } -.dropdown-page-toolbar { - width: 300px; -} +// .document-toolbar { +// > .round-button-mono { +// background-color: $color-white; +// border: 1px solid $color-gray; -.document-toolbar { - > .round-button-mono { - background-color: $color-white; - border: 1px solid $color-gray; - - > .material-icons { - @include ease-in(); - color: $color-gray; - } - } -} +// > .material-icons { +// @include ease-in(); +// color: $color-gray; +// } +// } +// } diff --git a/gui/app/styles/view/document/wysiwyg.scss b/gui/app/styles/view/document/wysiwyg.scss index adb396fe..1d1229ef 100644 --- a/gui/app/styles/view/document/wysiwyg.scss +++ b/gui/app/styles/view/document/wysiwyg.scss @@ -38,35 +38,7 @@ } } - h1 { - font-size: 1.7rem; - font-weight: bold; - margin: 16px 0; - } - - h2 { - font-size: 1.5rem; - font-weight: bold; - margin: 16px 0; - } - - h3 { - font-size: 1.3rem; - font-weight: bold; - margin: 16px 0; - } - - h4, - h5, - h6, - h7, - h8, - h9 { - font-size: 1.1rem; - font-weight: bold; - margin: 16px 0; - } - + h1, h2, h3, h4, @@ -75,9 +47,10 @@ h7, h8, h9 { - .page-title { - color: $color-off-black; - } + font-size: 1.8rem; + font-weight: bold; + margin: 16px 0; + color: $color-dark; } pre { diff --git a/gui/app/templates/components/document/document-page.hbs b/gui/app/templates/components/document/document-page.hbs index c30ff0bf..cf684f3d 100644 --- a/gui/app/templates/components/document/document-page.hbs +++ b/gui/app/templates/components/document/document-page.hbs @@ -1,4 +1,4 @@ -
+
{{#if editMode}} {{document/document-editor document=document folder=folder page=page meta=meta onCancel=(action 'onCancelEdit') onAction=(action 'onSavePage')}} {{else}} diff --git a/gui/app/templates/components/document/document-toolbar.hbs b/gui/app/templates/components/document/document-toolbar.hbs deleted file mode 100644 index 237d2cfc..00000000 --- a/gui/app/templates/components/document/document-toolbar.hbs +++ /dev/null @@ -1,74 +0,0 @@ -
-
- more_vert -
-
- -{{#dropdown-menu target="document-more-button" position="bottom right" open="click" onOpenCallback=(action 'onMenuOpen') onCloseCallback=(action 'onMenuOpen')}} - -{{/dropdown-menu}} - -{{#if session.authenticated}} - {{#if menuOpen}} - {{#unless pinState.isPinned}} - {{#dropdown-dialog target="pin-document-button" position="bottom right" button="Pin" color="flat-green" onAction=(action 'onPin') focusOn="pin-document-name" }} -
- -
Provide short name
- {{input type='text' id="pin-document-name" value=pinState.newName}} -
- {{/dropdown-dialog}} - {{/unless}} - {{/if}} - - {{#if permissions.documentDelete}} - {{#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}} - {{/if}} - {{/if}} - - {{#if permissions.documentTemplate}} - {{#if menuOpen}} - {{#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}} - {{/if}} -{{/if}} diff --git a/gui/app/templates/components/document/document-view.hbs b/gui/app/templates/components/document/document-view.hbs index 9f77e702..4dd6ed10 100644 --- a/gui/app/templates/components/document/document-view.hbs +++ b/gui/app/templates/components/document/document-view.hbs @@ -1,57 +1,59 @@ -
+{{#if hasPages}} + {{#each pages key="id" as |page index|}} + {{#if permissions.documentEdit}} +
+
+
+ add +
+
section
+
+
+ {{else}} +
+ {{/if}} - {{#if hasPages}} - {{#each pages key="id" as |page index|}} - {{#if permissions.documentEdit}} -
-
-
- add -
-
section
-
-
- {{else}} -
- {{/if}} - {{#if (is-equal page.pageType 'section')}} - {{#document/document-page document=document folder=folder page=page permissions=permissions toEdit=toEdit pageId=pageId - onSavePage=(action 'onSavePage') onSavePageAsBlock=(action 'onSavePageAsBlock') - onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} - {{/document/document-page}} - {{/if}} - {{#if (is-equal page.pageType 'tab')}} - {{#document/document-tab document=document folder=folder page=page permissions=permissions pageId=pageId - onSavePage=(action 'onSavePage') onSavePageAsBlock=(action 'onSavePageAsBlock') - onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} - {{/document/document-tab}} - {{/if}} - {{/each}} - {{#if permissions.documentEdit}} -
-
-
- add -
-
section
-
-
+ {{#if (is-equal page.pageType 'section')}} + {{#document/document-page document=document folder=folder page=page permissions=permissions toEdit=toEdit pageId=pageId + onSavePage=(action 'onSavePage') onSavePageAsBlock=(action 'onSavePageAsBlock') + onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} + {{/document/document-page}} {{/if}} - {{else}} - {{#if permissions.documentEdit}} -
-
-
- add -
-
section
-
-
+ + {{#if (is-equal page.pageType 'tab')}} + {{#document/document-tab document=document folder=folder page=page permissions=permissions pageId=pageId + onSavePage=(action 'onSavePage') onSavePageAsBlock=(action 'onSavePageAsBlock') + onCopyPage=(action 'onCopyPage') onMovePage=(action 'onMovePage') onDeletePage=(action 'onDeletePage')}} + {{/document/document-tab}} {{/if}} + {{/each}} + + {{#if permissions.documentEdit}} +
+
+
+ add +
+
section
+
+
{{/if}} +{{/if}} + +{{#unless hasPages}} + {{#if permissions.documentEdit}} +
+
+
+ add +
+
section
+
+
+ {{/if}} +{{/unless}}
-
{{input type="text" id="new-section-name" value=newSectionName class=(if newSectionNameMissing 'section-name error-inline' 'section-name') placeholder="Name" autocomplete="off"}} @@ -100,6 +102,4 @@
-
- {{document/document-attachments document=document permissions=permissions}} diff --git a/gui/app/templates/components/document/page-heading.hbs b/gui/app/templates/components/document/page-heading.hbs index fc7e31cc..49fbd24d 100644 --- a/gui/app/templates/components/document/page-heading.hbs +++ b/gui/app/templates/components/document/page-heading.hbs @@ -1,6 +1,11 @@ -
- {{ page.title }} -