diff --git a/gui/app/components/document/document-meta.js b/gui/app/components/document/document-meta.js index 161eadb3..225161bc 100644 --- a/gui/app/components/document/document-meta.js +++ b/gui/app/components/document/document-meta.js @@ -52,6 +52,12 @@ export default Component.extend(Modals, { }, actions: { + onEdit() { + if (!this.get('permissions.documentEdit')) return; + + this.get('router').transitionTo('document.settings'); + }, + onEditCategory() { if (!this.get('permissions.documentEdit')) return; diff --git a/gui/app/components/document/sidebar-meta.js b/gui/app/components/document/sidebar-meta.js deleted file mode 100644 index c6c73264..00000000 --- a/gui/app/components/document/sidebar-meta.js +++ /dev/null @@ -1,41 +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 { 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, { - appMeta: service(), - documentService: service('document'), - sessionService: service('session'), - router: service(), - userChanges: notEmpty('contributorMsg'), - unassigned: computed('selectedCategories', 'tagz', function() { - return this.get('selectedCategories').length === 0 && this.get('tagz').length === 0; - }), - - actions: { - onEditStatus() { - if (!this.get('permissions.documentEdit')) return; - - this.get('router').transitionTo('document.settings', {queryParams: {tab: 'general'}}); - }, - - onSelectVersion(version) { - let space = this.get('space'); - - this.get('router').transitionTo('document', space.get('id'), space.get('slug'), version.documentId, this.get('document.slug')); - } - } -}); diff --git a/gui/app/pods/document/index/template.hbs b/gui/app/pods/document/index/template.hbs index 6a01bf2e..0c2adf1d 100644 --- a/gui/app/pods/document/index/template.hbs +++ b/gui/app/pods/document/index/template.hbs @@ -70,18 +70,6 @@ - - {{document/sidebar-meta - roles=roles - pages=pages - space=folder - spaces=folders - document=document - versions=versions - permissions=permissions - contributionStatus=contributionStatus - approvalStatus=approvalStatus}} - {{document/document-meta tab=tab roles=roles diff --git a/gui/app/styles/core/layout/sidebar.scss b/gui/app/styles/core/layout/sidebar.scss index 6cfe007b..f461e937 100644 --- a/gui/app/styles/core/layout/sidebar.scss +++ b/gui/app/styles/core/layout/sidebar.scss @@ -9,7 +9,7 @@ > .goto-top { position: absolute; - top: 7px; + top: 10px; left: 10px; cursor: pointer; color: map-get($gray-shades, 500); diff --git a/gui/app/templates/components/document/document-meta.hbs b/gui/app/templates/components/document/document-meta.hbs index f38e1bd3..94e5702d 100644 --- a/gui/app/templates/components/document/document-meta.hbs +++ b/gui/app/templates/components/document/document-meta.hbs @@ -1,7 +1,41 @@ - -
-
CATEGORY / TAG
+
STATUS
+
+ {{document.lifecycleLabel}} + {{#attach-tooltip showDelay=1000}}Lifecycle: Draft · Live · Archived{{/attach-tooltip}} +
+ + {{#if (eq document.protection constants.ProtectionType.None)}} +
+ OPEN + {{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}} +
+ {{/if}} + {{#if (eq document.protection constants.ProtectionType.Review)}} +
+ PROTECTED + {{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}} +
+ {{/if}} + {{#if (eq document.protection constants.ProtectionType.Lock)}} +
+ LOCKED + {{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}} +
+ {{/if}} + + {{#if document.template}} +
+ Template + {{#attach-tooltip showDelay=1000}}This is a template{{/attach-tooltip}} +
+ {{/if}} + + + +
CATEGORY / TAG
{{#each selectedCategories as |cat|}}
@@ -19,11 +53,11 @@ {{#if unassigned}} {{#if permissions.spaceManage}} - {{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}} - {{ui/ui-toolbar-icon icon=constants.Icon.Plus color=constants.Color.Gray linkTo="document.settings"}} - {{/ui/ui-toolbar}} +
Unassigned
{{else}}
Unassigned
{{/if}} {{/if}} + +
diff --git a/gui/app/templates/components/document/sidebar-meta.hbs b/gui/app/templates/components/document/sidebar-meta.hbs deleted file mode 100644 index dfdd408e..00000000 --- a/gui/app/templates/components/document/sidebar-meta.hbs +++ /dev/null @@ -1,61 +0,0 @@ -
- {{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}} -
VERSION
- {{#if (gt versions.length 0)}} - {{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}} - {{ui/ui-toolbar-label label=document.versionId color=constants.Color.Gray}} - {{#attach-popover class="ember-attacher-popper" hideOn="click clickout" showOn="click" isShown=false}} - - {{/attach-popover}} - {{/ui/ui-toolbar}} - {{else}} - {{#if permissions.spaceManage}} - {{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}} - {{ui/ui-toolbar-icon icon=constants.Icon.Plus color=constants.Color.Gray linkTo="document.settings"}} - {{/ui/ui-toolbar}} - {{else}} -
Not versioned
- {{/if}} - {{/if}} - - - {{/if}} - -
STATUS
-
- {{document.lifecycleLabel}} - {{#attach-tooltip showDelay=1000}}Lifecycle: Draft · Live · Archived{{/attach-tooltip}} -
- - {{#if (eq document.protection constants.ProtectionType.None)}} -
- OPEN - {{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}} -
- {{/if}} - {{#if (eq document.protection constants.ProtectionType.Review)}} -
- PROTECTED - {{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}} -
- {{/if}} - {{#if (eq document.protection constants.ProtectionType.Lock)}} -
- LOCKED - {{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}} -
- {{/if}} - {{#if document.template}} -
- Template - {{#attach-tooltip showDelay=1000}}This is a template{{/attach-tooltip}} -
- {{/if}} -
diff --git a/gui/app/templates/components/layout/grid/sidebar-go-top.hbs b/gui/app/templates/components/layout/grid/sidebar-go-top.hbs index 343ebf6a..e4e7a217 100644 --- a/gui/app/templates/components/layout/grid/sidebar-go-top.hbs +++ b/gui/app/templates/components/layout/grid/sidebar-go-top.hbs @@ -1,3 +1,3 @@ - {{#attach-tooltip showDelay=750}}Scroll to top{{/attach-tooltip}} + {{#attach-tooltip showDelay=750}}Go top{{/attach-tooltip}}