mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Change position of doc attachments
This commit is contained in:
parent
ca4a9a74ee
commit
fe7548cd97
7 changed files with 136 additions and 147 deletions
|
@ -17,7 +17,7 @@ import Notifier from '../../mixins/notifier';
|
|||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(Modals, Notifier, {
|
||||
classNames: ["section"],
|
||||
classNames: ["document-meta"],
|
||||
documentService: service('document'),
|
||||
browserSvc: service('browser'),
|
||||
appMeta: service(),
|
||||
|
@ -56,7 +56,7 @@ export default Component.extend(Modals, Notifier, {
|
|||
let uploadUrl = `${url}/documents/${documentId}/attachments`;
|
||||
|
||||
// Handle upload clicks on button and anything inside that button.
|
||||
let sel = ['#upload-document-files ', '#upload-document-files > div'];
|
||||
let sel = ['#upload-document-files ', '#upload-document-files > span'];
|
||||
for (var i=0; i < 2; i++) {
|
||||
let dzone = new Dropzone(sel[i], {
|
||||
headers: {
|
||||
|
@ -109,15 +109,6 @@ export default Component.extend(Modals, Notifier, {
|
|||
this.notifySuccess('File deleted');
|
||||
this.getAttachments();
|
||||
});
|
||||
},
|
||||
|
||||
onExport() {
|
||||
this.get('documentSvc').export({}).then((htmlExport) => {
|
||||
this.get('browserSvc').downloadFile(htmlExport, this.get('space.slug') + '.html');
|
||||
this.notifySuccess('Exported');
|
||||
});
|
||||
|
||||
this.modalClose("#space-export-modal");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
{{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}}
|
||||
{{ui/ui-toolbar-icon icon=constants.Icon.Index color=constants.Color.Gray tooltip="Table of contents"
|
||||
selected=(eq sidebarTab "toc") onClick=(action "onSidebarChange" "toc")}}
|
||||
{{ui/ui-toolbar-icon icon=constants.Icon.Attachment color=constants.Color.Gray tooltip="Attachments"
|
||||
selected=(eq sidebarTab "files") onClick=(action "onSidebarChange" "files")}}
|
||||
{{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}}
|
||||
{{ui/ui-toolbar-icon icon=constants.Icon.Chat color=constants.Color.Gray tooltip="Comments & Feedback"
|
||||
selected=(eq sidebarTab "feedback") onClick=(action "onSidebarChange" "feedback")}}
|
||||
|
@ -55,12 +53,6 @@
|
|||
onPageSequenceChange=(action "onPageSequenceChange")}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq sidebarTab "files")}}
|
||||
{{document/sidebar-attachment
|
||||
document=document
|
||||
permissions=permissions}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (eq sidebarTab "feedback")}}
|
||||
{{enterprise/sidebar-feedback
|
||||
document=document
|
||||
|
@ -89,6 +81,7 @@
|
|||
spaces=folders
|
||||
document=document
|
||||
versions=versions
|
||||
attachments=attachments
|
||||
permissions=permissions
|
||||
contributionStatus=contributionStatus
|
||||
approvalStatus=approvalStatus}}
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
#upload-document-files {
|
||||
> .dz-preview, .dz-processing {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.document-sidebar-attachment {
|
||||
> .files {
|
||||
margin: 0;
|
||||
|
@ -11,30 +5,48 @@
|
|||
|
||||
> .file {
|
||||
list-style-type: none;
|
||||
margin: 10px 0 0 0;
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0 10px 0 0;
|
||||
font-size: 0.9rem;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
|
||||
> a {
|
||||
display: inline-block;
|
||||
font-size: 0.9rem;
|
||||
vertical-align: text-top;
|
||||
margin-right: 10px;
|
||||
width: 90%;
|
||||
font-size: 1rem;
|
||||
@extend .text-truncate;
|
||||
}
|
||||
|
||||
> .menu {
|
||||
position: absolute;
|
||||
right: -10px;
|
||||
top: 0;
|
||||
display: inline-block;
|
||||
color: map-get($gray-shades, 300);
|
||||
font-size: 1.2rem;
|
||||
|
||||
&:hover {
|
||||
color: map-get($gray-shades, 600);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#upload-document-files {
|
||||
> span {
|
||||
display: block;
|
||||
color: map-get($gray-shades, 600);
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: map-get($gray-shades, 800);
|
||||
}
|
||||
}
|
||||
|
||||
> .dz-preview, .dz-processing {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.dz-preview, .dz-processing {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
}
|
||||
|
||||
.view-space {
|
||||
|
||||
> .documents {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
@ -76,84 +75,84 @@
|
|||
margin-top: 0.4rem;
|
||||
color: $color-black-light-3;
|
||||
}
|
||||
}
|
||||
|
||||
> .meta {
|
||||
padding: 25px 0 0 0;
|
||||
> .meta {
|
||||
padding: 25px 0 0 0;
|
||||
|
||||
> .lifecycle {
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
@include border-radius(5px);
|
||||
background-color: map-get($gray-shades, 300);
|
||||
padding: 0.25rem 1rem;
|
||||
margin-right: 20px;
|
||||
|
||||
> .draft {
|
||||
color: map-get($yellow-shades, 600);
|
||||
}
|
||||
|
||||
> .live {
|
||||
color: map-get($green-shades, 600);
|
||||
}
|
||||
|
||||
> .archived {
|
||||
color: map-get($red-shades, 600);
|
||||
}
|
||||
}
|
||||
|
||||
> .dicon {
|
||||
color: map-get($gray-shades, 600);
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.categories {
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
|
||||
> .category {
|
||||
padding: 0 15px 0 0;
|
||||
> .lifecycle {
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
@include border-radius(5px);
|
||||
background-color: map-get($gray-shades, 300);
|
||||
padding: 0.25rem 1rem;
|
||||
margin-right: 20px;
|
||||
|
||||
> .dicon {
|
||||
color: map-get($gray-shades, 500);
|
||||
font-size: 20px;
|
||||
vertical-align: bottom;
|
||||
> .draft {
|
||||
color: map-get($yellow-shades, 600);
|
||||
}
|
||||
|
||||
> .name {
|
||||
display: inline-block;
|
||||
color: map-get($gray-shades, 800);
|
||||
font-size: 1rem;
|
||||
> .live {
|
||||
color: map-get($green-shades, 600);
|
||||
}
|
||||
|
||||
> .archived {
|
||||
color: map-get($red-shades, 600);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hashtags {
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
> .dicon {
|
||||
color: map-get($gray-shades, 600);
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
> .hashtag {
|
||||
padding: 0 15px 0 0;
|
||||
.categories {
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
|
||||
> .dicon {
|
||||
color: map-get($gray-shades, 500);
|
||||
font-size: 20px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
> .name {
|
||||
> .category {
|
||||
padding: 0 15px 0 0;
|
||||
display: inline-block;
|
||||
color: map-get($gray-shades, 800);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
> .dicon, > .name {
|
||||
color: map-get($gray-shades, 600);
|
||||
> .dicon {
|
||||
color: map-get($gray-shades, 500);
|
||||
font-size: 20px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
> .name {
|
||||
display: inline-block;
|
||||
color: map-get($gray-shades, 800);
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hashtags {
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
|
||||
> .hashtag {
|
||||
padding: 0 15px 0 0;
|
||||
|
||||
> .dicon {
|
||||
color: map-get($gray-shades, 500);
|
||||
font-size: 20px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
> .name {
|
||||
display: inline-block;
|
||||
color: map-get($gray-shades, 800);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
> .dicon, > .name {
|
||||
color: map-get($gray-shades, 600);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
{{#attach-tooltip showDelay=1000}}Tag{{/attach-tooltip}}
|
||||
</div>
|
||||
{{/each}}
|
||||
|
||||
{{#if unassigned}}
|
||||
{{#if permissions.spaceManage}}
|
||||
<div class="empty cursor-pointer" {{action "onEditCategory"}}>Unassigned</div>
|
||||
|
@ -70,6 +69,8 @@
|
|||
<div class="empty">Unassigned</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<Ui::UiSpacer @size="200" />
|
||||
</div>
|
||||
|
||||
{{document/sidebar-attachment document=document permissions=permissions}}
|
||||
|
||||
<Ui::UiSpacer @size="200" />
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
<div class="title center">attachments</div>
|
||||
{{#if canEdit}}
|
||||
<div class="text-center">
|
||||
<Ui::UiSpacer @size="100" />
|
||||
{{ui/ui-button color=constants.Color.Gray label="Upload" id="upload-document-files"}}
|
||||
<Ui::UiSpacer @size="100" />
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if hasAttachments}}
|
||||
{{#if (or hasAttachments canEdit)}}
|
||||
<Ui::UiSpacer @size="200" />
|
||||
<div class="title">attachments</div>
|
||||
<div class="document-sidebar-attachment">
|
||||
<ul class="files">
|
||||
{{#each files key="id" as |file|}}
|
||||
|
@ -18,21 +11,19 @@
|
|||
</a>
|
||||
{{#if canEdit}}
|
||||
<div class="menu">
|
||||
{{#ui/ui-toolbar dark=false light=false raised=false large=false bordered=false}}
|
||||
{{#ui/ui-toolbar-icon icon=constants.Icon.Delete color=constants.Color.Red}}
|
||||
{{#attach-popover class="ember-attacher-popper" hideOn="escapekey, clickout" showOn="click" isShown=false}}
|
||||
<div class="form">
|
||||
<p>Are you sure you want to delete this file?</p>
|
||||
<Ui::UiSpacer @size="100" />
|
||||
{{ui/ui-button
|
||||
light=false
|
||||
label=constants.Label.Delete
|
||||
color=constants.Color.Red
|
||||
onClick=(action "onDelete" file)}}
|
||||
</div>
|
||||
{{/attach-popover}}
|
||||
{{/ui/ui-toolbar-icon}}
|
||||
{{/ui/ui-toolbar}}
|
||||
<i class="dicon {{constants.Icon.Cross}}">
|
||||
{{#attach-popover class="ember-attacher-popper" hideOn="escapekey, clickout" showOn="click" isShown=false}}
|
||||
<div class="form">
|
||||
<p>Are you sure you want to delete this file?</p>
|
||||
<Ui::UiSpacer @size="100" />
|
||||
{{ui/ui-button
|
||||
light=false
|
||||
label=constants.Label.Delete
|
||||
color=constants.Color.Red
|
||||
onClick=(action "onDelete" file)}}
|
||||
</div>
|
||||
{{/attach-popover}}
|
||||
</i>
|
||||
</div>
|
||||
{{/if}}
|
||||
</li>
|
||||
|
@ -40,10 +31,12 @@
|
|||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
{{else}}
|
||||
<p class="empty-label">No attachments</p>
|
||||
{{#if canEdit}}
|
||||
{{#unless hasAttachments}}
|
||||
<Ui::UiSpacer @size="100" />
|
||||
{{/unless}}
|
||||
<div id="upload-document-files">
|
||||
<span>Upload</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#ui/ui-dialog title="Delete Attachment" confirmCaption="Delete" buttonColor=constants.Color.Red show=showDialog onAction=(action "onDelete")}}
|
||||
<p>Are you sure you want to delete {{deleteAttachment.name}}?</p>
|
||||
{{/ui/ui-dialog}}
|
||||
|
|
|
@ -71,20 +71,20 @@
|
|||
{{#if (not-eq viewDensity "3")}}
|
||||
<div class="desc">{{ document.excerpt }}</div>
|
||||
{{/if}}
|
||||
{{/link-to}}
|
||||
{{#if (eq viewDensity "1")}}
|
||||
<div class="meta">
|
||||
<div class="lifecycle">
|
||||
<div class="{{if (eq document.lifecycle constants.Lifecycle.Draft) "draft"}}
|
||||
{{if (eq document.lifecycle constants.Lifecycle.Live) "live"}}
|
||||
{{if (eq document.lifecycle constants.Lifecycle.Archived) "archived"}}">
|
||||
{{document.lifecycleLabel}}
|
||||
{{#if (eq viewDensity "1")}}
|
||||
<div class="meta">
|
||||
<div class="lifecycle">
|
||||
<div class="{{if (eq document.lifecycle constants.Lifecycle.Draft) "draft"}}
|
||||
{{if (eq document.lifecycle constants.Lifecycle.Live) "live"}}
|
||||
{{if (eq document.lifecycle constants.Lifecycle.Archived) "archived"}}">
|
||||
{{document.lifecycleLabel}}
|
||||
</div>
|
||||
</div>
|
||||
{{folder/document-categories categories=document.category}}
|
||||
{{folder/document-tags documentTags=document.tags}}
|
||||
</div>
|
||||
{{folder/document-categories categories=document.category}}
|
||||
{{folder/document-tags documentTags=document.tags}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/link-to}}
|
||||
|
||||
{{#if hasDocumentActions}}
|
||||
<div class="checkbox" {{action "selectDocument" document.id}}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue