diff --git a/gui/app/components/document/document-meta.js b/gui/app/components/document/document-meta.js index 6a14fd4e..bde4f91c 100644 --- a/gui/app/components/document/document-meta.js +++ b/gui/app/components/document/document-meta.js @@ -10,8 +10,6 @@ // https://documize.com import { A } from '@ember/array'; -import { computed } from '@ember/object'; -import { notEmpty } from '@ember/object/computed'; import { inject as service } from '@ember/service'; import Modals from '../../mixins/modal'; import Component from '@ember/component'; @@ -21,99 +19,13 @@ export default Component.extend(Modals, { sessionService: service('session'), categoryService: service('category'), router: service(), - contributorMsg: '', - approverMsg: '', - userChanges: notEmpty('contributorMsg'), - isApprover: computed('permissions', function() { - return this.get('permissions.documentApprove'); - }), - isSpaceAdmin: computed('permissions', function() { - return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage'); - }), - changeControlMsg: computed('document.protection', function() { - let p = this.get('document.protection'); - let constants = this.get('constants'); - let msg = ''; - - switch (p) { - case constants.ProtectionType.None: - msg = constants.ProtectionType.NoneLabel; - break; - case constants.ProtectionType.Lock: - msg = constants.ProtectionType.LockLabel; - break; - case constants.ProtectionType.Review: - msg = constants.ProtectionType.ReviewLabel; - break; - } - - return msg; - }), - approvalMsg: computed('document.{protection,approval}', function() { - let p = this.get('document.protection'); - let a = this.get('document.approval'); - let constants = this.get('constants'); - let msg = ''; - - if (p === constants.ProtectionType.Review) { - switch (a) { - case constants.ApprovalType.Anybody: - msg = constants.ApprovalType.AnybodyLabel; - break; - case constants.ApprovalType.Majority: - msg = constants.ApprovalType.MajorityLabel; - break; - case constants.ApprovalType.Unanimous: - msg = constants.ApprovalType.UnanimousLabel; - break; - } - } - - return msg; - }), didReceiveAttrs() { this._super(...arguments); - this.workflowStatus(); this.load(); }, - workflowStatus() { - let pages = this.get('pages'); - let contributorMsg = ''; - let userPendingCount = 0; - let userReviewCount = 0; - let userRejectedCount = 0; - let approverMsg = ''; - let approverPendingCount = 0; - let approverReviewCount = 0; - let approverRejectedCount = 0; - - pages.forEach((item) => { - if (item.get('userHasChangePending')) userPendingCount+=1; - if (item.get('userHasChangeAwaitingReview')) userReviewCount+=1; - if (item.get('userHasChangeRejected')) userRejectedCount+=1; - if (item.get('changePending')) approverPendingCount+=1; - if (item.get('changeAwaitingReview')) approverReviewCount+=1; - if (item.get('changeRejected')) approverRejectedCount+=1; - }); - - if (userPendingCount > 0 || userReviewCount > 0 || userRejectedCount > 0) { - let label = userPendingCount === 1 ? 'change' : 'changes'; - contributorMsg = `${userPendingCount} ${label} progressing, ${userReviewCount} awaiting review, ${userRejectedCount} rejected`; - } - this.set('contributorMsg', contributorMsg); - - if (approverPendingCount > 0 || approverReviewCount > 0 || approverRejectedCount > 0) { - let label = approverPendingCount === 1 ? 'change' : 'changes'; - approverMsg = `${approverPendingCount} ${label} progressing, ${approverReviewCount} awaiting review, ${approverRejectedCount} rejected`; - } - - this.set('approverMsg', approverMsg); - this.set('selectedVersion', this.get('versions').findBy('documentId', this.get('document.id'))); - }, - load() { this.get('categoryService').getDocumentCategories(this.get('document.id')).then((selected) => { this.set('selectedCategories', selected); @@ -133,20 +45,6 @@ export default Component.extend(Modals, { }, actions: { - onSelectVersion(version) { - let space = this.get('folder'); - - this.get('router').transitionTo('document', - space.get('id'), space.get('slug'), - version.documentId, this.get('document.slug')); - }, - - onEditLifecycle() { - }, - - onEditProtection() { - }, - onEditCategory() { if (!this.get('permissions.spaceManage')) return; diff --git a/gui/app/components/toolbar/for-document.js b/gui/app/components/document/document-toolbar.js similarity index 100% rename from gui/app/components/toolbar/for-document.js rename to gui/app/components/document/document-toolbar.js diff --git a/gui/app/components/document/zdocument-meta.js b/gui/app/components/document/zdocument-meta.js new file mode 100644 index 00000000..6a14fd4e --- /dev/null +++ b/gui/app/components/document/zdocument-meta.js @@ -0,0 +1,156 @@ +// 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 { A } from '@ember/array'; +import { computed } from '@ember/object'; +import { notEmpty } from '@ember/object/computed'; +import { inject as service } from '@ember/service'; +import Modals from '../../mixins/modal'; +import Component from '@ember/component'; + +export default Component.extend(Modals, { + documentService: service('document'), + sessionService: service('session'), + categoryService: service('category'), + router: service(), + contributorMsg: '', + approverMsg: '', + userChanges: notEmpty('contributorMsg'), + isApprover: computed('permissions', function() { + return this.get('permissions.documentApprove'); + }), + isSpaceAdmin: computed('permissions', function() { + return this.get('permissions.spaceOwner') || this.get('permissions.spaceManage'); + }), + changeControlMsg: computed('document.protection', function() { + let p = this.get('document.protection'); + let constants = this.get('constants'); + let msg = ''; + + switch (p) { + case constants.ProtectionType.None: + msg = constants.ProtectionType.NoneLabel; + break; + case constants.ProtectionType.Lock: + msg = constants.ProtectionType.LockLabel; + break; + case constants.ProtectionType.Review: + msg = constants.ProtectionType.ReviewLabel; + break; + } + + return msg; + }), + approvalMsg: computed('document.{protection,approval}', function() { + let p = this.get('document.protection'); + let a = this.get('document.approval'); + let constants = this.get('constants'); + let msg = ''; + + if (p === constants.ProtectionType.Review) { + switch (a) { + case constants.ApprovalType.Anybody: + msg = constants.ApprovalType.AnybodyLabel; + break; + case constants.ApprovalType.Majority: + msg = constants.ApprovalType.MajorityLabel; + break; + case constants.ApprovalType.Unanimous: + msg = constants.ApprovalType.UnanimousLabel; + break; + } + } + + return msg; + }), + + didReceiveAttrs() { + this._super(...arguments); + + this.workflowStatus(); + this.load(); + }, + + workflowStatus() { + let pages = this.get('pages'); + let contributorMsg = ''; + let userPendingCount = 0; + let userReviewCount = 0; + let userRejectedCount = 0; + let approverMsg = ''; + let approverPendingCount = 0; + let approverReviewCount = 0; + let approverRejectedCount = 0; + + pages.forEach((item) => { + if (item.get('userHasChangePending')) userPendingCount+=1; + if (item.get('userHasChangeAwaitingReview')) userReviewCount+=1; + if (item.get('userHasChangeRejected')) userRejectedCount+=1; + if (item.get('changePending')) approverPendingCount+=1; + if (item.get('changeAwaitingReview')) approverReviewCount+=1; + if (item.get('changeRejected')) approverRejectedCount+=1; + }); + + if (userPendingCount > 0 || userReviewCount > 0 || userRejectedCount > 0) { + let label = userPendingCount === 1 ? 'change' : 'changes'; + contributorMsg = `${userPendingCount} ${label} progressing, ${userReviewCount} awaiting review, ${userRejectedCount} rejected`; + } + this.set('contributorMsg', contributorMsg); + + if (approverPendingCount > 0 || approverReviewCount > 0 || approverRejectedCount > 0) { + let label = approverPendingCount === 1 ? 'change' : 'changes'; + approverMsg = `${approverPendingCount} ${label} progressing, ${approverReviewCount} awaiting review, ${approverRejectedCount} rejected`; + } + + this.set('approverMsg', approverMsg); + this.set('selectedVersion', this.get('versions').findBy('documentId', this.get('document.id'))); + }, + + load() { + this.get('categoryService').getDocumentCategories(this.get('document.id')).then((selected) => { + this.set('selectedCategories', selected); + }); + + let tagz = []; + if (!_.isUndefined(this.get('document.tags')) && this.get('document.tags').length > 1) { + let tags = this.get('document.tags').split('#'); + _.each(tags, function(tag) { + if (tag.length > 0) { + tagz.pushObject(tag); + } + }); + } + + this.set('tagz', A(tagz)); + }, + + actions: { + onSelectVersion(version) { + let space = this.get('folder'); + + this.get('router').transitionTo('document', + space.get('id'), space.get('slug'), + version.documentId, this.get('document.slug')); + }, + + onEditLifecycle() { + }, + + onEditProtection() { + }, + + onEditCategory() { + if (!this.get('permissions.spaceManage')) return; + + this.get('router').transitionTo('document.settings', {queryParams: {tab: 'meta'}}); + } + } +}); diff --git a/gui/app/components/toolbar/for-space.js b/gui/app/components/folder/space-toolbar.js similarity index 100% rename from gui/app/components/toolbar/for-space.js rename to gui/app/components/folder/space-toolbar.js diff --git a/gui/app/components/ui/ui-button.js b/gui/app/components/ui/ui-button.js index 2066644c..edcd14da 100644 --- a/gui/app/components/ui/ui-button.js +++ b/gui/app/components/ui/ui-button.js @@ -24,6 +24,7 @@ export default Component.extend({ light: false, themed: false, dismiss: false, + uppercase: true, iconClass: '', hasIcon: computed('iconClass', function() { @@ -46,6 +47,10 @@ export default Component.extend({ bc += '-light'; } + if (!this.uppercase) { + bc += ' text-case-normal'; + } + return bc; }), diff --git a/gui/app/pods/document/index/controller.js b/gui/app/pods/document/index/controller.js index 45437354..0e51926e 100644 --- a/gui/app/pods/document/index/controller.js +++ b/gui/app/pods/document/index/controller.js @@ -11,7 +11,6 @@ import { Promise as EmberPromise } from 'rsvp'; import { inject as service } from '@ember/service'; -import { computed } from '@ember/object'; import Notifier from '../../../mixins/notifier'; import Controller from '@ember/controller'; @@ -24,13 +23,6 @@ export default Controller.extend(Notifier, { sidebarTab: 'toc', tab: 'content', queryParams: ['currentPageId', 'source'], - showRevisions: computed('permissions', 'document.protection', function() { - if (!this.get('session.viewUsers')) return false; - if (this.get('document.protection') === this.get('constants').ProtectionType.None) return true; - if (this.get('document.protection') === this.get('constants').ProtectionType.Review && this.get('permissions.documentApprove')) return true; - - return false; - }), actions: { onSidebarChange(tab) { diff --git a/gui/app/pods/document/index/template.hbs b/gui/app/pods/document/index/template.hbs index c7e04fba..ff606f50 100644 --- a/gui/app/pods/document/index/template.hbs +++ b/gui/app/pods/document/index/template.hbs @@ -1,23 +1,8 @@ {{#layout/master-sidebar}} - {{ui/ui-spacer size=300}} + {{ui/ui-spacer size=200}}
-
status
- -
- {{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}} -
- - {{ui/ui-spacer size=200}} + {{ui/ui-spacer size=100}}
{{#ui/ui-toolbar dark=true light=true raised=true large=false bordered=true}} @@ -30,6 +15,7 @@
{{ui/ui-spacer size=200}} + {{#if (eq sidebarTab "toc")}} {{document/sidebar-toc tab=tab @@ -54,10 +40,18 @@ {{#layout/master-content}}
+ {{document/document-meta + tab=tab + roles=roles + space=folder + spaces=folders + document=document + versions=versions + permissions=permissions}}
- {{toolbar/for-document + {{document/document-toolbar tab=tab roles=roles space=folder @@ -74,71 +68,48 @@ {{ui/ui-spacer size=400}} -
-
    -
  • Content
  • - {{#if session.authenticated}} - {{#if showRevisions}} -
  • Revisions
  • - {{/if}} - {{/if}} -
+
+
+

{{document.name}}

+

{{document.excerpt}}

+ {{#if document.template}} + Template   + {{/if}}
+
-
-
-

- {{#if document.template}} - Template   - {{/if}} - {{document.name}} -

-
{{document.excerpt}}
-
-
- - {{document/document-meta + {{#if (eq tab "content")}} + {{document/view-content + roles=roles + links=links pages=pages + blocks=blocks folder=folder folders=folders + sections=sections document=document - versions=versions permissions=permissions - onSaveDocument=(action "onSaveDocument")}} + currentPageId=currentPageId + refresh=(action "refresh") + onSavePage=(action "onSavePage") + onCopyPage=(action "onCopyPage") + onMovePage=(action "onMovePage") + onDeletePage=(action "onPageDeleted") + onInsertSection=(action "onInsertSection") + onSavePageAsBlock=(action "onSavePageAsBlock") + onPageLevelChange=(action "onPageLevelChange") + onPageSequenceChange=(action "onPageSequenceChange")}} + {{/if}} - {{#if (eq tab "content")}} - {{document/view-content - roles=roles - links=links + {{#if (eq tab "revision")}} + {{#if showRevisions}} + {{document/view-revision pages=pages - blocks=blocks folder=folder - folders=folders - sections=sections document=document permissions=permissions - currentPageId=currentPageId - refresh=(action "refresh") - onSavePage=(action "onSavePage") - onCopyPage=(action "onCopyPage") - onMovePage=(action "onMovePage") - onDeletePage=(action "onPageDeleted") - onInsertSection=(action "onInsertSection") - onSavePageAsBlock=(action "onSavePageAsBlock") - onPageLevelChange=(action "onPageLevelChange") - onPageSequenceChange=(action "onPageSequenceChange")}} + onRollback=(action "onRollback")}} {{/if}} - - {{#if (eq tab "revision")}} - {{#if showRevisions}} - {{document/view-revision - pages=pages - folder=folder - document=document - permissions=permissions - onRollback=(action "onRollback")}} - {{/if}} - {{/if}} - + {{/if}} {{/layout/master-content}} diff --git a/gui/app/pods/folder/index/template.hbs b/gui/app/pods/folder/index/template.hbs index fb7403de..cfa67c0c 100644 --- a/gui/app/pods/folder/index/template.hbs +++ b/gui/app/pods/folder/index/template.hbs @@ -23,7 +23,7 @@ {{layout/page-desc desc="some space desc"}}
- {{toolbar/for-space + {{folder/space-toolbar spaces=model.folders space=model.folder permissions=model.permissions diff --git a/gui/app/pods/folder/settings/template.hbs b/gui/app/pods/folder/settings/template.hbs index 8d38c783..420d4d3e 100644 --- a/gui/app/pods/folder/settings/template.hbs +++ b/gui/app/pods/folder/settings/template.hbs @@ -2,7 +2,7 @@ {{ui/ui-spacer size=300}} {{#link-to "folder.index"}} - {{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.ArrowLeft label="Back to space"}} + {{ui/ui-button color=constants.Color.Yellow light=true icon=constants.Icon.ArrowLeft label="Space"}} {{/link-to}} {{ui/ui-spacer size=400}} diff --git a/gui/app/styles/core/layout/grid.scss b/gui/app/styles/core/layout/grid.scss index 6c4fb294..3bcedaa8 100644 --- a/gui/app/styles/core/layout/grid.scss +++ b/gui/app/styles/core/layout/grid.scss @@ -25,7 +25,7 @@ $display-break-5: 1800px; justify-self: self-start; } - // X- axis alignment + // X-axis alignment .grid-cell-left { justify-self: self-end; } @@ -36,7 +36,7 @@ $display-break-5: 1800px; justify-self: center; } - // Y axis alignment + // Y-axis alignment .grid-cell-top { align-self: self-start; } diff --git a/gui/app/styles/core/layout/sidebar.scss b/gui/app/styles/core/layout/sidebar.scss index e754b147..bc01a662 100644 --- a/gui/app/styles/core/layout/sidebar.scss +++ b/gui/app/styles/core/layout/sidebar.scss @@ -1,6 +1,7 @@ .sidebar-content { display: block; position: relative; + // @extend .text-truncate; > .section { margin: 0; @@ -13,6 +14,12 @@ color: map-get($gray-shades, 700); } + > .nav-button { + width: 100%; + display: inline-block; + @extend .no-select; + } + > .center { text-align: center; } diff --git a/gui/app/styles/core/text.scss b/gui/app/styles/core/text.scss index bdad33ee..4e3f3872 100644 --- a/gui/app/styles/core/text.scss +++ b/gui/app/styles/core/text.scss @@ -31,6 +31,10 @@ text-transform: uppercase; } +.text-case-normal { + text-transform: none !important; +} + .bold-100 { font-weight: 100; } .bold-200 { font-weight: 200; } .bold-300 { font-weight: 300; } diff --git a/gui/app/styles/core/util.scss b/gui/app/styles/core/util.scss index 437d56e8..c56e78a0 100644 --- a/gui/app/styles/core/util.scss +++ b/gui/app/styles/core/util.scss @@ -48,6 +48,17 @@ a.broken-link { user-select: none; } +@media print { + .no-print { + display: none !important; + } +} + +.no-width { + white-space: nowrap; + width: 1%; +} + .cursor-pointer { cursor: pointer; } @@ -56,11 +67,6 @@ a.broken-link { cursor: auto !important; } -.no-width { - white-space: nowrap; - width: 1%; -} - .absolute-center { margin: auto; position: absolute; @@ -77,37 +83,39 @@ a.broken-link { .hide { display: none; } - -.display-block { - display: block; -} - -.display-inline-block { - display: inline-block; -} - .visible { visibility: visible; } - .invisible { visibility: none; } +.display-block { + display: block; +} +.display-inline-block { + display: inline-block; +} .align-top { vertical-align: top!important; } - .align-middle { vertical-align: middle!important; } +.text-left { + text-align: left; +} +.text-right { + text-align: right; +} .text-center { text-align: center; } -@media print { - .no-print { - display: none !important; - } +.float-left { + float: left; +} +.float-right { + float: right; } diff --git a/gui/app/styles/core/view/document/add-section.scss b/gui/app/styles/core/view/document/add-section.scss index f1eac52a..f07de2f5 100644 --- a/gui/app/styles/core/view/document/add-section.scss +++ b/gui/app/styles/core/view/document/add-section.scss @@ -1,28 +1,3 @@ -.start-section { - @extend .no-select; - background-color: transparent; - position: relative; - cursor: pointer; - font-size: 1.3rem; - - > .start-button { - text-align: center; - margin: 30px 0 20px 0; - position: relative; - color: map-get($gray-shades, 300); - - > .cta { - @include ease-in(); - font-weight: bold; - letter-spacing: 0.22rem; - - &:hover { - color: map-get($green-shades, 700); - } - } - } -} - .new-section-wizard { margin: 0; padding: 0; diff --git a/gui/app/styles/core/view/document/all.scss b/gui/app/styles/core/view/document/all.scss index 07ece053..cfc0bd87 100644 --- a/gui/app/styles/core/view/document/all.scss +++ b/gui/app/styles/core/view/document/all.scss @@ -1,7 +1,7 @@ @import "add-section.scss"; @import "copy-move.scss"; -@import "doc-meta.scss"; -@import "doc-structure.scss"; +@import "meta.scss"; +@import "section.scss"; @import "section-editor.scss"; @import "sidebar.scss"; @import "sidebar-toc.scss"; diff --git a/gui/app/styles/core/view/document/doc-meta.scss b/gui/app/styles/core/view/document/doc-meta.scss deleted file mode 100644 index 889e128b..00000000 --- a/gui/app/styles/core/view/document/doc-meta.scss +++ /dev/null @@ -1,96 +0,0 @@ -.view-document { - > .document-heading { - .doc-title { - margin: 50px 0 10px; - font-size: 2.2rem; - font-weight: bold; - } - - .doc-excerpt { - font-size: 1.2rem; - color: map-get($gray-shades, 600); - margin: 0 0 20px; - } - } -} - -.document-lifecycle-live { - @include border-radius(3px); - @include ease-in(); - display: inline-block; - border: 2px solid map-get($green-shades, 700); - padding: 2px 10px; - color: map-get($gray-shades, 600); - background-color: map-get($gray-shades, 100); - font-weight: 800; - font-size: 1rem; - - &:hover { - color: map-get($green-shades, 500); - } -} - -.document-lifecycle-draft { - @extend .document-lifecycle-live; - border: 2px solid map-get($yellow-shades, 700); - - &:hover { - color: map-get($yellow-shades, 700); - } -} - -.document-protection-unlocked { - @include border-radius(3px); - @include ease-in(); - display: inline-block; - padding: 2px 10px; - font-weight: 800; - font-size: 1rem; - color: map-get($gray-shades, 600); - background-color: map-get($gray-shades, 100); - border: 2px solid map-get($gray-shades, 600); - - &:hover { - color: map-get($gray-shades, 800); - } -} - -.document-protection-review { - @extend .document-protection-unlocked; - border: 2px solid map-get($yellow-shades, 700); - - &:hover { - color: map-get($yellow-shades, 700); - } -} - -.document-protection-locked { - @extend .document-protection-unlocked; - border: 2px solid map-get($red-shades, 600); - - &:hover { - color: map-get($red-shades, 600); - } -} - -.document-category { - display: inline-block; - padding: 2px 10px; - font-weight: 600; - font-size: 1rem; - color: map-get($gray-shades, 600); - background-color: map-get($gray-shades, 100); - border: 2px solid map-get($gray-shades, 600); - border-left: 13px solid map-get($gray-shades, 600); - margin-right: 20px; -} - -.document-tag { - display: inline-block; - padding: 2px 0; - font-size: 1.1rem; - font-weight: 600; - font-style: italic; - color: map-get($gray-shades, 600); - margin-right: 20px; -} diff --git a/gui/app/styles/core/view/document/doc-structure.scss b/gui/app/styles/core/view/document/doc-structure.scss deleted file mode 100644 index 890a0cb4..00000000 --- a/gui/app/styles/core/view/document/doc-structure.scss +++ /dev/null @@ -1,69 +0,0 @@ -.document-tabnav { - margin: 20px 0 0 0; - padding: 0; -} - -.document-structure { - margin: 0 0 0 0; - - > .page-header { - margin: 0 0 2rem 0; - - > .page-number { - color: map-get($gray-shades, 600); - background-color: map-get($gray-shades, 200); - padding: 0.2rem 1rem; - font-size: 1.8rem; - margin: 0 1.5rem 0 0; - font-weight: normal; - text-align: center; - display: inline-block; - } - - > .page-state-pending { - color: map-get($red-shades, 600); - } - - > .page-state-review { - color: map-get($green-shades, 600); - } - - > .page-title { - display: inline; - font-size: 2.0rem; - font-weight: bold; - margin: 16px 0; - color: map-get($gray-shades, 800); - } - } - - > .protection-table { - > tbody, > thead { - > tr, > th { - > td, > th { - margin: 0; - padding: 10px 15px; - text-align: center; - } - - > td:first-child { - text-align: left; - } - } - } - - > thead { - > tr { - > th { - background-color: map-get($gray-shades, 100); - color: map-get($gray-shades, 600); - } - - > th:first-child { - background-color: $color-white !important; - border: none !important; - } - } - } - } -} diff --git a/gui/app/styles/core/view/document/meta.scss b/gui/app/styles/core/view/document/meta.scss new file mode 100644 index 00000000..1ac1849d --- /dev/null +++ b/gui/app/styles/core/view/document/meta.scss @@ -0,0 +1,97 @@ +.document-meta { + margin: 0; + padding: 0; + + > .title { + text-transform: uppercase; + font-size: 1rem; + font-weight: 600; + color: map-get($gray-shades, 700); + margin-bottom: 5px; + } + + > .meta-label { + @include border-radius(3px); + @extend .no-select; + display: inline-block; + margin: 5px 5px 5px 0; + padding: 0.3rem 0.7rem; + font-size: 1.1rem; + font-weight: 500; + background-color: map-get($gray-shades, 200); + color: map-get($gray-shades, 700); + + > .dicon { + vertical-align: middle; + font-size: 1.2rem; + margin-right: 5px; + color: map-get($gray-shades, 600); + } + } + + > .label-approval { + @include border-radius(3px); + @extend .no-select; + display: inline-block; + margin: 5px 5px 5px 0; + padding: 0.3rem 0.7rem; + font-size: 1.1rem; + font-weight: 500; + 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: 5px 5px 5px 0; + padding: 0.3rem 0.7rem; + font-size: 1.1rem; + font-weight: 500; + 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: 5px 5px 5px 0; + padding: 0.3rem 0.7rem; + font-size: 1.1rem; + font-weight: 500; + 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: 5px 5px 5px 0; + padding: 0.3rem 0.7rem; + font-size: 1.1rem; + font-weight: 500; + background-color: map-get($red-shades, 300); + color: map-get($gray-shades, 800); + text-transform: uppercase; + } + + > .document-heading { + .name { + color: map-get($gray-shades, 900); + font-size: 2.2rem; + font-weight: 700; + } + + .desc { + color: map-get($gray-shades, 700); + font-size: 1.2rem; + font-weight: 500; + } + } +} diff --git a/gui/app/styles/core/view/document/section.scss b/gui/app/styles/core/view/document/section.scss new file mode 100644 index 00000000..5dc01e68 --- /dev/null +++ b/gui/app/styles/core/view/document/section.scss @@ -0,0 +1,72 @@ +.section-heading { + margin: 0 0 0 0; + + > .page-header { + margin: 0 0 2rem 0; + + > .page-number { + color: $theme-500; + background-color: $theme-100; + padding: 0.2rem 1rem; + font-size: 1.8rem; + margin: 0 1.5rem 0 0; + font-weight: normal; + text-align: center; + display: inline-block; + } + + > .page-state-pending { + color: map-get($red-shades, 600); + } + + > .page-state-review { + color: map-get($green-shades, 600); + } + + > .page-title { + display: inline; + font-size: 2.0rem; + font-weight: bold; + margin: 16px 0; + color: map-get($gray-shades, 800); + } + } + + > .section-toolbar { + > i { + font-size: 20px; + color: map-get($gray-shades, 400); + cursor: pointer; + + &:hover { + color: map-get($gray-shades, 700); + } + } + + > .gap { + width: 5px; + display: inline-block; + } + } +} + +.start-section { + @include border-radius(5px); + @extend .no-select; + text-align: right; + margin: 2rem 0; + display: block; + cursor: pointer; + + > i { + background-color: map-get($yellow-shades, 100); + color: map-get($yellow-shades, 500); + vertical-align: middle; + padding: 0.5rem; + font-size: 16px; + + &:hover { + color: map-get($yellow-shades, 700); + } + } +} diff --git a/gui/app/styles/core/view/document/sidebar.scss b/gui/app/styles/core/view/document/sidebar.scss index c9bf215d..e69de29b 100644 --- a/gui/app/styles/core/view/document/sidebar.scss +++ b/gui/app/styles/core/view/document/sidebar.scss @@ -1,52 +0,0 @@ -.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/templates/components/document/document-meta.hbs b/gui/app/templates/components/document/document-meta.hbs index 2d53cd26..26165ddf 100644 --- a/gui/app/templates/components/document/document-meta.hbs +++ b/gui/app/templates/components/document/document-meta.hbs @@ -1,38 +1,40 @@ -{{#if (eq document.lifecycle constants.Lifecycle.Live)}} -
{{document.lifecycleLabel}}
-{{/if}} -{{#if (eq document.lifecycle constants.Lifecycle.Draft)}} -
{{document.lifecycleLabel}}
-{{/if}} +
+ {{#link-to 'folder.index' space.id space.slug class="no-print"}} + {{ui/ui-button light=true color=constants.Color.Yellow uppercase=false + icon=constants.Icon.ArrowLeft label=space.name}} + {{/link-to}} -
-
+ {{ui/ui-spacer size=300}} -{{#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}} +
CATEGORY / TAG
+ {{#each selectedCategories as |cat|}} +
+ + {{cat.category}} + {{#attach-tooltip showDelay=1000}}Category{{/attach-tooltip}} +
+ {{/each}} + {{#each tagz as |t|}} +
+ + {{t}} + {{#attach-tooltip showDelay=1000}}Tag{{/attach-tooltip}} +
+ {{/each}} -
-
+ {{ui/ui-spacer size=200}} -{{#each selectedCategories as |cat|}} -
- {{cat.category}} - {{#attach-tooltip showDelay=1000}}Category{{/attach-tooltip}} +
STATUS
+
+ {{document.lifecycleLabel}} + {{#attach-tooltip showDelay=1000}}Lifecycle: Draft · Live · Archived{{/attach-tooltip}}
-{{/each}} - -
- -{{#each tagz as |t|}} -
- {{#attach-tooltip showDelay=1000}}Tag{{/attach-tooltip}} - {{concat "#" t}} +
+ {{#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}}
-{{/each}} +
diff --git a/gui/app/templates/components/toolbar/for-document.hbs b/gui/app/templates/components/document/document-toolbar.hbs similarity index 99% rename from gui/app/templates/components/toolbar/for-document.hbs rename to gui/app/templates/components/document/document-toolbar.hbs index 1cd43264..b8431257 100644 --- a/gui/app/templates/components/toolbar/for-document.hbs +++ b/gui/app/templates/components/document/document-toolbar.hbs @@ -1,4 +1,4 @@ -
+
{{#if session.authenticated}} {{#if permissions.documentEdit}} {{#link-to "document.settings" space.id space.slug document.id document.slug class="button-icon-gray align-middle"}} diff --git a/gui/app/templates/components/document/page-heading.hbs b/gui/app/templates/components/document/page-heading.hbs index ccb210a8..a3abced1 100644 --- a/gui/app/templates/components/document/page-heading.hbs +++ b/gui/app/templates/components/document/page-heading.hbs @@ -1,63 +1,58 @@ -
-
-
+
+
+
-
+
{{#unless (eq document.protection constants.ProtectionType.Lock)}} -
-
-
- {{#if canEdit}} -
- mode_edit -
- {{/if}} - {{#if hasMenuPermissions}} -
- - {{/if}} -
+
+
+ {{#if canEdit}} + + {{/if}} + {{#if hasMenuPermissions}} +
+ + {{#attach-popover class="ember-attacher-popper" hideOn="clickout click" showOn="click" isShown=false}} + + {{/attach-popover}} + + {{/if}}
{{/unless}} diff --git a/gui/app/templates/components/document/view-content.hbs b/gui/app/templates/components/document/view-content.hbs index c0f16aa6..13d29c19 100644 --- a/gui/app/templates/components/document/view-content.hbs +++ b/gui/app/templates/components/document/view-content.hbs @@ -1,14 +1,13 @@ {{#if hasPages}} - {{#each pages key="id" as |item|}} {{#if canEdit}} -
-
-
+ SECTION
-
+
+ + {{#attach-tooltip showDelay=1000}}Insert section here{{/attach-tooltip}} +
{{else}} -
+ {{ui/ui-spacer size=700}} {{/if}} {{document/document-page roles=roles @@ -32,10 +31,10 @@ {{/each}} {{#if canEdit}} -
-
-
+ SECTION
-
+
+ + {{#attach-tooltip showDelay=1000}}Insert section here{{/attach-tooltip}} +
{{/if}} @@ -56,17 +55,14 @@
{{/if}} - {{else }} - {{#if canEdit}} -
-
-
+ SECTION
-
+
+ + {{#attach-tooltip showDelay=1000}}Insert section here{{/attach-tooltip}} +
{{/if}} - {{/if}} {{#if canEdit}} diff --git a/gui/app/templates/components/document/zdocument-meta.hbs b/gui/app/templates/components/document/zdocument-meta.hbs new file mode 100644 index 00000000..d0b8ff1b --- /dev/null +++ b/gui/app/templates/components/document/zdocument-meta.hbs @@ -0,0 +1,13 @@ +{{#each selectedCategories as |cat|}} +
+ {{cat.category}} + {{#attach-tooltip showDelay=1000}}Category{{/attach-tooltip}} +
+{{/each}} + +{{#each tagz as |t|}} +
+ {{#attach-tooltip showDelay=1000}}Tag{{/attach-tooltip}} + {{concat "#" t}} +
+{{/each}} diff --git a/gui/app/templates/components/toolbar/for-space.hbs b/gui/app/templates/components/folder/space-toolbar.hbs similarity index 100% rename from gui/app/templates/components/toolbar/for-space.hbs rename to gui/app/templates/components/folder/space-toolbar.hbs diff --git a/gui/app/templates/components/ui/ui-button.hbs b/gui/app/templates/components/ui/ui-button.hbs index dbb468ab..f99b0d83 100644 --- a/gui/app/templates/components/ui/ui-button.hbs +++ b/gui/app/templates/components/ui/ui-button.hbs @@ -1,4 +1,5 @@ {{#if hasIcon}} {{/if}} -
{{label}}
\ No newline at end of file +
{{label}}
+{{yield}} \ No newline at end of file