mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 03:40:48 +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>
|
||||
{#each Object.values(files) as file}
|
||||
<tr class="tr-body">
|
||||
<td class="item flex-row-center">
|
||||
<td class="item flex-row-center" on:click={() => {
|
||||
closeTooltip()
|
||||
showPopup(PDFViewer, { file: file.file }, 'right')
|
||||
}}>
|
||||
<div class="flex-center file-icon">pdf</div>
|
||||
<div class="flex-col flex-grow" style="cursor: pointer" on:click={() => {
|
||||
closeTooltip()
|
||||
showPopup(PDFViewer, { file: file.file }, 'right')
|
||||
}}>
|
||||
<div class="flex-col flex-grow">
|
||||
<div class="overflow-label caption-color">{trimFilename(file.name)}</div>
|
||||
<div class="overflow-label file-desc">{file.type}</div>
|
||||
</div>
|
||||
@ -66,7 +66,7 @@
|
||||
&:first-child { border-top: none; }
|
||||
}
|
||||
|
||||
.item { padding: .75rem 1rem .75rem 0; }
|
||||
.item { padding: .75rem 1rem .75rem 0; cursor: pointer; }
|
||||
.file-icon {
|
||||
margin-right: 1.25rem;
|
||||
width: 2rem;
|
||||
|
@ -17,7 +17,7 @@
|
||||
<script lang="ts">
|
||||
import type { Bag } from '@anticrm/core'
|
||||
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 AttachmentPopup from './AttachmentPopup.svelte'
|
||||
|
||||
@ -25,10 +25,18 @@
|
||||
|
||||
</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') } }/>
|
||||
{:else if Object.keys(value.attachments).length > 1}
|
||||
<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} />
|
||||
</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}
|
||||
|
Loading…
Reference in New Issue
Block a user