email list view show attachments

This commit is contained in:
Yuri Kuznetsov
2023-01-06 12:03:29 +02:00
parent 4789c3c2ad
commit 59a95fa3bc
2 changed files with 28 additions and 2 deletions
@@ -1,6 +1,13 @@
{{#if hasAttachment}}
<span class="list-icon-container pull-right">
<span class="fas fa-paperclip small text-muted" title="{{translate 'hasAttachment' category='fields' scope='Email'}}"></span>
<a
role="button"
tabindex="0"
data-action="showAttachments"
><span
class="fas fa-paperclip small text-muted"
title="{{translate 'hasAttachment' category='fields' scope='Email'}}"
></span></a>
</span>
{{/if}}
<a
+20 -1
View File
@@ -32,6 +32,15 @@ define('views/email/fields/subject', ['views/fields/varchar'], function (Dep) {
listLinkTemplate: 'email/fields/subject/list-link',
events: {
'click [data-action="showAttachments"]': function (e) {
e.stopPropagation();
this.showAttachments();
},
...Dep.prototype.events,
},
data: function () {
var data = Dep.prototype.data.call(this);
@@ -81,11 +90,21 @@ define('views/email/fields/subject', ['views/fields/varchar'], function (Dep) {
Dep.prototype.afterRender.call(this);
},
fetch: function () {
var data = Dep.prototype.fetch.call(this);
data.name = data.subject;
return data;
},
showAttachments: function () {
Espo.Ui.notify(' ... ');
this.createView('dialog', 'views/email/modals/attachments', {model: this.model})
.then(view => {
view.render();
Espo.Ui.notify(false);
});
},
});
});