1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-20 13:49:42 +02:00

Change position of doc attachments

This commit is contained in:
McMatts 2019-05-29 16:57:22 +01:00
parent ca4a9a74ee
commit fe7548cd97
7 changed files with 136 additions and 147 deletions

View file

@ -17,7 +17,7 @@ import Notifier from '../../mixins/notifier';
import Component from '@ember/component'; import Component from '@ember/component';
export default Component.extend(Modals, Notifier, { export default Component.extend(Modals, Notifier, {
classNames: ["section"], classNames: ["document-meta"],
documentService: service('document'), documentService: service('document'),
browserSvc: service('browser'), browserSvc: service('browser'),
appMeta: service(), appMeta: service(),
@ -56,7 +56,7 @@ export default Component.extend(Modals, Notifier, {
let uploadUrl = `${url}/documents/${documentId}/attachments`; let uploadUrl = `${url}/documents/${documentId}/attachments`;
// Handle upload clicks on button and anything inside that button. // 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++) { for (var i=0; i < 2; i++) {
let dzone = new Dropzone(sel[i], { let dzone = new Dropzone(sel[i], {
headers: { headers: {
@ -109,15 +109,6 @@ export default Component.extend(Modals, Notifier, {
this.notifySuccess('File deleted'); this.notifySuccess('File deleted');
this.getAttachments(); 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");
} }
} }
}); });

View file

@ -29,8 +29,6 @@
{{#ui/ui-toolbar dark=false light=true raised=true large=false bordered=true}} {{#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" {{ui/ui-toolbar-icon icon=constants.Icon.Index color=constants.Color.Gray tooltip="Table of contents"
selected=(eq sidebarTab "toc") onClick=(action "onSidebarChange" "toc")}} 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)}} {{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}}
{{ui/ui-toolbar-icon icon=constants.Icon.Chat color=constants.Color.Gray tooltip="Comments & Feedback" {{ui/ui-toolbar-icon icon=constants.Icon.Chat color=constants.Color.Gray tooltip="Comments & Feedback"
selected=(eq sidebarTab "feedback") onClick=(action "onSidebarChange" "feedback")}} selected=(eq sidebarTab "feedback") onClick=(action "onSidebarChange" "feedback")}}
@ -55,12 +53,6 @@
onPageSequenceChange=(action "onPageSequenceChange")}} onPageSequenceChange=(action "onPageSequenceChange")}}
{{/if}} {{/if}}
{{#if (eq sidebarTab "files")}}
{{document/sidebar-attachment
document=document
permissions=permissions}}
{{/if}}
{{#if (eq sidebarTab "feedback")}} {{#if (eq sidebarTab "feedback")}}
{{enterprise/sidebar-feedback {{enterprise/sidebar-feedback
document=document document=document
@ -89,6 +81,7 @@
spaces=folders spaces=folders
document=document document=document
versions=versions versions=versions
attachments=attachments
permissions=permissions permissions=permissions
contributionStatus=contributionStatus contributionStatus=contributionStatus
approvalStatus=approvalStatus}} approvalStatus=approvalStatus}}

View file

@ -1,9 +1,3 @@
#upload-document-files {
> .dz-preview, .dz-processing {
display: none !important;
}
}
.document-sidebar-attachment { .document-sidebar-attachment {
> .files { > .files {
margin: 0; margin: 0;
@ -11,30 +5,48 @@
> .file { > .file {
list-style-type: none; list-style-type: none;
margin: 10px 0 0 0; margin: 0;
padding: 5px; padding: 0 10px 0 0;
width: 100%;
font-size: 0.9rem; font-size: 0.9rem;
position: relative; position: relative;
display: inline-block;
> a { > a {
display: inline-block; display: inline-block;
font-size: 0.9rem; font-size: 1rem;
vertical-align: text-top;
margin-right: 10px;
width: 90%;
@extend .text-truncate; @extend .text-truncate;
} }
> .menu { > .menu {
position: absolute; display: inline-block;
right: -10px; color: map-get($gray-shades, 300);
top: 0; 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 { .dz-preview, .dz-processing {
display: none !important; display: none !important;
} }

View file

@ -17,7 +17,6 @@
} }
.view-space { .view-space {
> .documents { > .documents {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -76,84 +75,84 @@
margin-top: 0.4rem; margin-top: 0.4rem;
color: $color-black-light-3; color: $color-black-light-3;
} }
}
> .meta { > .meta {
padding: 25px 0 0 0; padding: 25px 0 0 0;
> .lifecycle { > .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;
display: inline-block; 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 { > .draft {
color: map-get($gray-shades, 500); color: map-get($yellow-shades, 600);
font-size: 20px;
vertical-align: bottom;
} }
> .name { > .live {
display: inline-block; color: map-get($green-shades, 600);
color: map-get($gray-shades, 800); }
font-size: 1rem;
> .archived {
color: map-get($red-shades, 600);
} }
} }
}
.hashtags { > .dicon {
display: inline-block; color: map-get($gray-shades, 600);
padding: 0; font-size: 20px;
}
> .hashtag { .categories {
padding: 0 15px 0 0; display: inline-block;
padding: 0;
> .dicon { > .category {
color: map-get($gray-shades, 500); padding: 0 15px 0 0;
font-size: 20px;
vertical-align: bottom;
}
> .name {
display: inline-block; display: inline-block;
color: map-get($gray-shades, 800);
font-size: 1rem;
}
&:hover { > .dicon {
> .dicon, > .name { color: map-get($gray-shades, 500);
color: map-get($gray-shades, 600); 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);
}
} }
} }
} }

View file

@ -62,7 +62,6 @@
{{#attach-tooltip showDelay=1000}}Tag{{/attach-tooltip}} {{#attach-tooltip showDelay=1000}}Tag{{/attach-tooltip}}
</div> </div>
{{/each}} {{/each}}
{{#if unassigned}} {{#if unassigned}}
{{#if permissions.spaceManage}} {{#if permissions.spaceManage}}
<div class="empty cursor-pointer" {{action "onEditCategory"}}>Unassigned</div> <div class="empty cursor-pointer" {{action "onEditCategory"}}>Unassigned</div>
@ -70,6 +69,8 @@
<div class="empty">Unassigned</div> <div class="empty">Unassigned</div>
{{/if}} {{/if}}
{{/if}} {{/if}}
<Ui::UiSpacer @size="200" />
</div> </div>
{{document/sidebar-attachment document=document permissions=permissions}}
<Ui::UiSpacer @size="200" />

View file

@ -1,13 +1,6 @@
<div class="title center">attachments</div> {{#if (or hasAttachments canEdit)}}
{{#if canEdit}} <Ui::UiSpacer @size="200" />
<div class="text-center"> <div class="title">attachments</div>
<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}}
<div class="document-sidebar-attachment"> <div class="document-sidebar-attachment">
<ul class="files"> <ul class="files">
{{#each files key="id" as |file|}} {{#each files key="id" as |file|}}
@ -18,21 +11,19 @@
</a> </a>
{{#if canEdit}} {{#if canEdit}}
<div class="menu"> <div class="menu">
{{#ui/ui-toolbar dark=false light=false raised=false large=false bordered=false}} <i class="dicon {{constants.Icon.Cross}}">
{{#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}}
{{#attach-popover class="ember-attacher-popper" hideOn="escapekey, clickout" showOn="click" isShown=false}} <div class="form">
<div class="form"> <p>Are you sure you want to delete this file?</p>
<p>Are you sure you want to delete this file?</p> <Ui::UiSpacer @size="100" />
<Ui::UiSpacer @size="100" /> {{ui/ui-button
{{ui/ui-button light=false
light=false label=constants.Label.Delete
label=constants.Label.Delete color=constants.Color.Red
color=constants.Color.Red onClick=(action "onDelete" file)}}
onClick=(action "onDelete" file)}} </div>
</div> {{/attach-popover}}
{{/attach-popover}} </i>
{{/ui/ui-toolbar-icon}}
{{/ui/ui-toolbar}}
</div> </div>
{{/if}} {{/if}}
</li> </li>
@ -40,10 +31,12 @@
{{/each}} {{/each}}
</ul> </ul>
</div> </div>
{{else}} {{#if canEdit}}
<p class="empty-label">No attachments</p> {{#unless hasAttachments}}
<Ui::UiSpacer @size="100" />
{{/unless}}
<div id="upload-document-files">
<span>Upload</span>
</div>
{{/if}}
{{/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}}

View file

@ -71,20 +71,20 @@
{{#if (not-eq viewDensity "3")}} {{#if (not-eq viewDensity "3")}}
<div class="desc">{{ document.excerpt }}</div> <div class="desc">{{ document.excerpt }}</div>
{{/if}} {{/if}}
{{/link-to}} {{#if (eq viewDensity "1")}}
{{#if (eq viewDensity "1")}} <div class="meta">
<div class="meta"> <div class="lifecycle">
<div class="lifecycle"> <div class="{{if (eq document.lifecycle constants.Lifecycle.Draft) "draft"}}
<div class="{{if (eq document.lifecycle constants.Lifecycle.Draft) "draft"}} {{if (eq document.lifecycle constants.Lifecycle.Live) "live"}}
{{if (eq document.lifecycle constants.Lifecycle.Live) "live"}} {{if (eq document.lifecycle constants.Lifecycle.Archived) "archived"}}">
{{if (eq document.lifecycle constants.Lifecycle.Archived) "archived"}}"> {{document.lifecycleLabel}}
{{document.lifecycleLabel}} </div>
</div> </div>
{{folder/document-categories categories=document.category}}
{{folder/document-tags documentTags=document.tags}}
</div> </div>
{{folder/document-categories categories=document.category}} {{/if}}
{{folder/document-tags documentTags=document.tags}} {{/link-to}}
</div>
{{/if}}
{{#if hasDocumentActions}} {{#if hasDocumentActions}}
<div class="checkbox" {{action "selectDocument" document.id}}> <div class="checkbox" {{action "selectDocument" document.id}}>