mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 00:10:37 +00:00
update AttachmentsPresenter
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
bfc81b562c
commit
7199b20f6c
@ -32,12 +32,12 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{#each Object.values(files) as file}
|
{#each Object.values(files) as file}
|
||||||
<tr class="tr-body">
|
<tr class="tr-body">
|
||||||
<td class="item flex-row-center">
|
<td class="item flex-row-center" on:click={() => {
|
||||||
<div class="flex-center file-icon">pdf</div>
|
|
||||||
<div class="flex-col flex-grow" style="cursor: pointer" on:click={() => {
|
|
||||||
closeTooltip()
|
closeTooltip()
|
||||||
showPopup(PDFViewer, { file: file.file }, 'right')
|
showPopup(PDFViewer, { file: file.file }, 'right')
|
||||||
}}>
|
}}>
|
||||||
|
<div class="flex-center file-icon">pdf</div>
|
||||||
|
<div class="flex-col flex-grow">
|
||||||
<div class="overflow-label caption-color">{trimFilename(file.name)}</div>
|
<div class="overflow-label caption-color">{trimFilename(file.name)}</div>
|
||||||
<div class="overflow-label file-desc">{file.type}</div>
|
<div class="overflow-label file-desc">{file.type}</div>
|
||||||
</div>
|
</div>
|
||||||
@ -66,7 +66,7 @@
|
|||||||
&:first-child { border-top: none; }
|
&:first-child { border-top: none; }
|
||||||
}
|
}
|
||||||
|
|
||||||
.item { padding: .75rem 1rem .75rem 0; }
|
.item { padding: .75rem 1rem .75rem 0; cursor: pointer; }
|
||||||
.file-icon {
|
.file-icon {
|
||||||
margin-right: 1.25rem;
|
margin-right: 1.25rem;
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Bag } from '@anticrm/core'
|
import type { Bag } from '@anticrm/core'
|
||||||
import type { Attachment } from '@anticrm/chunter'
|
import type { Attachment } from '@anticrm/chunter'
|
||||||
import { IconFile, Link, Tooltip, showPopup } from '@anticrm/ui'
|
import { IconFile, Link, Tooltip, IconAttachment } from '@anticrm/ui'
|
||||||
import { PDFViewer } from '@anticrm/presentation'
|
import { PDFViewer } from '@anticrm/presentation'
|
||||||
import AttachmentPopup from './AttachmentPopup.svelte'
|
import AttachmentPopup from './AttachmentPopup.svelte'
|
||||||
|
|
||||||
@ -25,10 +25,18 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if Object.keys(value.attachments).length === 1}
|
<!-- {#if Object.keys(value.attachments).length === 1}
|
||||||
<Link label={Object.values(value.attachments)[0].name} href={'#'} icon={IconFile} on:click={ () => { showPopup(PDFViewer, { file: Object.values(value.attachments)[0].file }, 'right') } }/>
|
<Link label={Object.values(value.attachments)[0].name} href={'#'} icon={IconFile} on:click={ () => { showPopup(PDFViewer, { file: Object.values(value.attachments)[0].file }, 'right') } }/>
|
||||||
{:else if Object.keys(value.attachments).length > 1}
|
{:else if Object.keys(value.attachments).length > 1}
|
||||||
<Tooltip label={'Attachments (' + Object.values(value.attachments).length + ')'} component={AttachmentPopup} props={{ files: value.attachments }}>
|
<Tooltip label={'Attachments (' + Object.values(value.attachments).length + ')'} component={AttachmentPopup} props={{ files: value.attachments }}>
|
||||||
<Link label={Object.values(value.attachments).length + ' files'} href={'#'} icon={IconFile} />
|
<Link label={Object.values(value.attachments).length + ' files'} href={'#'} icon={IconFile} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
{/if} -->
|
||||||
|
|
||||||
|
{#if Object.keys(value.attachments).length > 0}
|
||||||
|
<Tooltip label={'Attachments (' + Object.values(value.attachments).length + ')'} component={AttachmentPopup} props={{ files: value.attachments }}>
|
||||||
|
<div class="flex-row-center">
|
||||||
|
<IconAttachment size="small"/> {Object.keys(value.attachments).length}
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
Reference in New Issue
Block a user