/
frosh-mail-archive-detail.twig
87 lines (78 loc) · 4.09 KB
/
frosh-mail-archive-detail.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<sw-page class="frosh-mail-archive-detail">
<template slot="smart-bar-header">
<h2 v-if="archive">{{ archive.subject }}</h2>
</template>
<template slot="smart-bar-actions">
<sw-button variant="ghost" v-if="archive && archive.customer" @click="openCustomer">
{{ $tc('frosh-mail-archive.detail.toolbar.customer') }}
</sw-button>
<sw-button-process :isLoading="downloadIsLoading" :processSuccess="downloadIsSuccessful" @click="downloadMail"
@process-finish="downloadFinish">
{{ $tc('frosh-mail-archive.detail.toolbar.downloadEml') }}
</sw-button-process>
<sw-button-process :isLoading="resendIsLoading" :processSuccess="resendIsSuccessful" @click="resendMail"
@process-finish="resendFinish">
{{ $tc('frosh-mail-archive.detail.toolbar.resend') }}
</sw-button-process>
</template>
<template slot="content">
<sw-card-view v-if="archive">
<sw-alert
v-if="archive.transportState === 'failed'"
variant="warning"
class="frosh-mail-archive__detail-alert"
>
{{ $tc('frosh-mail-archive.detail.alert.transportFailed') }}
</sw-alert>
<sw-card
:title="$tc('frosh-mail-archive.detail.metadata.title')"
position-identifier="frosh-mail-archive-metadata"
>
<sw-text-field :label="$tc('frosh-mail-archive.detail.metadata.sentDate')" :disabled="true"
v-model="createdAtDate"></sw-text-field>
<sw-text-field :label="$tc('frosh-mail-archive.detail.metadata.sender')" :disabled="true"
v-model="senderText"></sw-text-field>
<sw-text-field :label="$tc('frosh-mail-archive.detail.metadata.receiver')" :disabled="true"
v-model="receiverText"></sw-text-field>
<sw-text-field :label="$tc('frosh-mail-archive.detail.metadata.subject')" :disabled="true"
v-model="archive.subject"></sw-text-field>
<sw-text-field :label="$tc('frosh-mail-archive.detail.metadata.salesChannel')"
v-if="archive.salesChannel" :disabled="true"
v-model="archive.salesChannel.name"></sw-text-field>
</sw-card>
<frosh-mail-resend-history :key="resendKey" :currentMailId="archive.id"
:sourceMailId="archive.sourceMailId ?? archive.id"/>
<sw-card
:title="$tc('frosh-mail-archive.detail.content.title')"
position-identifier="frosh-mail-archive-content"
>
<h4>HTML</h4>
<iframe :src="htmlText" sandbox frameborder="0"></iframe>
<h4>Plain</h4>
<iframe :src="plainText" sandbox frameborder="0"></iframe>
<h4>Attachments: {{ archive.attachments.length }}</h4>
<sw-data-grid
v-if="archive.attachments.length > 0"
:showSelection="false"
:dataSource="archive.attachments"
:columns="attachmentsColumns"
>
<template #column-fileSize="{ item }">
<template v-if="item.fileSize < 0">
unknown
</template>
<template v-else>
{{ formatSize(item.fileSize) }}
</template>
</template>
<template slot="actions" slot-scope="{ item }">
<sw-context-menu-item class="sw-entity-listing__context-menu-show-action"
@click="downloadAttachment(item.id)">
Download
</sw-context-menu-item>
</template>
</sw-data-grid>
</sw-card>
</sw-card-view>
</template>
</sw-page>