mirror of
https://github.com/documize/community.git
synced 2025-07-21 06:09:42 +02:00
Move doc meta fields out of sidebar
This commit is contained in:
parent
c0876e7be8
commit
c870547fa1
7 changed files with 48 additions and 122 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
// Copyright 2016 Documize Inc. <legal@documize.com>. 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 <sales@documize.com>.
|
||||
//
|
||||
// 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'));
|
||||
}
|
||||
}
|
||||
});
|
|
@ -70,18 +70,6 @@
|
|||
</Layout::Grid::Sidebar>
|
||||
|
||||
<Layout::Grid::Content>
|
||||
|
||||
{{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
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
> .goto-top {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
cursor: pointer;
|
||||
color: map-get($gray-shades, 500);
|
||||
|
|
|
@ -1,7 +1,41 @@
|
|||
<Ui::UiSpacer @size="300" />
|
||||
|
||||
<div class="document-meta">
|
||||
<div class="title {{if permissions.documentEdit "cursor-pointer"}}" {{action "onEditCategory"}}>CATEGORY / TAG</div>
|
||||
<div class="title">STATUS</div>
|
||||
<div class="{{if (eq document.lifecycle constants.Lifecycle.Draft) "label-draft"}}
|
||||
{{if (eq document.lifecycle constants.Lifecycle.Live) "label-live"}}
|
||||
{{if (eq document.lifecycle constants.Lifecycle.Archived) "label-archived"}}" {{action "onEdit"}}>
|
||||
{{document.lifecycleLabel}}
|
||||
{{#attach-tooltip showDelay=1000}}Lifecycle: Draft · Live · Archived{{/attach-tooltip}}
|
||||
</div>
|
||||
|
||||
{{#if (eq document.protection constants.ProtectionType.None)}}
|
||||
<div class="label-open {{if permissions.documentEdit "cursor-pointer"}}" {{action "onEdit"}}>
|
||||
OPEN
|
||||
{{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if (eq document.protection constants.ProtectionType.Review)}}
|
||||
<div class="label-protected {{if permissions.documentEdit "cursor-pointer"}}" {{action "onEdit"}}>
|
||||
PROTECTED
|
||||
{{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if (eq document.protection constants.ProtectionType.Lock)}}
|
||||
<div class="label-locked {{if permissions.documentEdit "cursor-pointer"}}" {{action "onEdit"}}>
|
||||
LOCKED
|
||||
{{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if document.template}}
|
||||
<div class="label-template">
|
||||
Template
|
||||
{{#attach-tooltip showDelay=1000}}This is a template{{/attach-tooltip}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<Ui::UiSpacer @size="200" />
|
||||
|
||||
<div class="title">CATEGORY / TAG</div>
|
||||
{{#each selectedCategories as |cat|}}
|
||||
<div class="meta-label">
|
||||
<i class="dicon {{constants.Icon.Category}}"/>
|
||||
|
@ -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}}
|
||||
<div class="empty cursor-pointer" {{action "onEditCategory"}}>Unassigned</div>
|
||||
{{else}}
|
||||
<div class="empty">Unassigned</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<Ui::UiSpacer @size="200" />
|
||||
</div>
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
<div class="document-meta">
|
||||
{{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}}
|
||||
<div class="title">VERSION</div>
|
||||
{{#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}}
|
||||
<div class="menu">
|
||||
<li class="item header">Select version to view</li>
|
||||
{{#each versions as |version|}}
|
||||
<a class="item" href="#" {{action "onSelectVersion" version}}>{{version.versionId}}</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/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}}
|
||||
<div class="empty">Not versioned</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<Ui::UiSpacer @size="200" />
|
||||
{{/if}}
|
||||
|
||||
<div class="title {{if permissions.documentEdit "cursor-pointer"}}" {{action "onEditStatus"}}>STATUS</div>
|
||||
<div class="{{if (eq document.lifecycle constants.Lifecycle.Draft) "label-draft"}}
|
||||
{{if (eq document.lifecycle constants.Lifecycle.Live) "label-live"}}
|
||||
{{if (eq document.lifecycle constants.Lifecycle.Archived) "label-archived"}}">
|
||||
{{document.lifecycleLabel}}
|
||||
{{#attach-tooltip showDelay=1000}}Lifecycle: Draft · Live · Archived{{/attach-tooltip}}
|
||||
</div>
|
||||
|
||||
{{#if (eq document.protection constants.ProtectionType.None)}}
|
||||
<div class="label-open">
|
||||
OPEN
|
||||
{{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if (eq document.protection constants.ProtectionType.Review)}}
|
||||
<div class="label-protected">
|
||||
PROTECTED
|
||||
{{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if (eq document.protection constants.ProtectionType.Lock)}}
|
||||
<div class="label-locked">
|
||||
LOCKED
|
||||
{{#attach-tooltip showDelay=1000}}Change Control: Open · Protected · Locked{{/attach-tooltip}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if document.template}}
|
||||
<div class="label-template">
|
||||
Template
|
||||
{{#attach-tooltip showDelay=1000}}This is a template{{/attach-tooltip}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
|
@ -1,3 +1,3 @@
|
|||
<i class="dicon {{constants.Icon.GoTop}}" {{action "onClick"}}>
|
||||
{{#attach-tooltip showDelay=750}}Scroll to top{{/attach-tooltip}}
|
||||
{{#attach-tooltip showDelay=750}}Go top{{/attach-tooltip}}
|
||||
</i>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue