add 'MailInfo' Widget

This will be used to show the Subject and From on E-Mail Previews.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-04-14 14:51:35 +02:00 committed by Thomas Lamprecht
parent 816483a244
commit 54d0de79a7
2 changed files with 34 additions and 0 deletions

33
js/MailInfo.js Normal file
View File

@ -0,0 +1,33 @@
Ext.define('PMG.MailInfoBox', {
extend: 'Ext.container.Container',
xtype: 'pmgMailInfo',
cls: 'x-toolbar-default',
style: {
'border-left': '0px',
'border-right': '0px',
},
update: function(data) {
let me = this;
let escaped = {};
for (const [key, value] of Object.entries(data)) {
escaped[key] = Ext.htmlEncode(value);
}
me.items.each((item) => item.update(escaped));
},
layout: {
type: 'vbox',
align: 'stretch',
},
defaults: {
xtype: 'tbtext',
},
items: [
{ tpl: `<b>${gettext("From")}:</b> {from}` },
{ tpl: `<b>${gettext("Subject")}:</b> {subject}` },
],
});

View File

@ -22,6 +22,7 @@ JSSRC= \
MainView.js \ MainView.js \
QuarantineList.js \ QuarantineList.js \
SpamInfoGrid.js \ SpamInfoGrid.js \
MailInfo.js \
SpamQuarantine.js \ SpamQuarantine.js \
UserBlackWhiteList.js \ UserBlackWhiteList.js \
QuarantineView.js \ QuarantineView.js \