Get addresses out of details and fix attachments caption

This commit is contained in:
Hadi Nategh 2023-02-07 12:22:23 +01:00
parent cb6f2ee808
commit 98b8258f0f
3 changed files with 21 additions and 24 deletions

View File

@ -2333,7 +2333,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
if (!empty($attachmentHTMLBlock))
{
$content['mail_displayattachments'] = $attachmentHTMLBlock;
$content['attachmentsBlockTitle'] = count($attachmentHTMLBlock).' '.Lang('attachments');
$content['attachmentsBlockTitle'] = count($attachmentHTMLBlock) > 1 ? '+'.(count($attachmentHTMLBlock)-1) : '';
$sel_options['mail_displayattachments']['actions'] = mail_hooks::attachmentsBlockActions();
}

View File

@ -1072,7 +1072,7 @@ app.classes.mail = AppJS.extend(
if (typeof _data == 'object')
{
data.attachmentsBlock = _data;
data.attachmentsBlockTitle = `${_data.length} attachments`;
data.attachmentsBlockTitle = _data.length > 1 ? `+${_data.length-1}` : '';
// Update client cache to avoid resolving winmail.dat attachment again
egw.dataStoreUID(data.uid, data);
mailPreview.set_value({content:data});
@ -1131,7 +1131,7 @@ app.classes.mail = AppJS.extend(
icon: 'collabora/navbar',
value: 'collabora'
};
data.attachmentsBlockTitle = `${data.attachmentsBlock.length} attachments`;
data.attachmentsBlockTitle = data.attachmentsBlock.length > 1 ? `+${data.attachmentsBlock.length-1}` : '';
sel_options.attachmentsBlock = {};
data.attachmentsBlock.forEach(_item =>
{

View File

@ -33,28 +33,25 @@
<et2-hbox width="100%" class="mailPreviewHeaders">
<et2-lavatar src="@fromavatar" lname="@fromaddress" shape="rounded" size="2.75em"></et2-lavatar>
<et2-vbox>
<et2-hbox>
<et2-details class="details" toggleOnHover="true" hoist="true" toggleAlign="left">
<et2-select-email slot="summary" id="fromaddress" readonly="true" multiple="true" onclick="app.mail.onclickCompose"></et2-select-email>
<et2-hbox>
<et2-description value="From" class="firstColumnTitle"></et2-description>
<et2-select-email id="additionalfromaddress" readonly="true" multiple="true" onclick="app.mail.onclickCompose"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@toaddress" width="100%">
<et2-description value="To" class="firstColumnTitle"></et2-description>
<et2-select-email id="additionaltoaddress" readonly="true" multiple="true"
rows="1" maxTagsVisible="1"
onclick="app.mail.onclickCompose"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@ccaddress" width="100%">
<et2-description value="Cc" class="firstColumnTitle"></et2-description>
<et2-select-email id="ccaddress" readonly="true" multiple="true"
rows="1" maxTagsVisible="1"
onclick="app.mail.onclickCompose"></et2-select-email>
</et2-hbox>
</et2-details>
<et2-vbox>
<et2-hbox>
<et2-description value="From" class="firstColumnTitle"></et2-description>
<et2-select-email id="additionalfromaddress" readonly="true" multiple="true" onclick="app.mail.onclickCompose"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@toaddress" width="100%">
<et2-description value="To" class="firstColumnTitle"></et2-description>
<et2-select-email id="additionaltoaddress" readonly="true" multiple="true"
rows="1" maxTagsVisible="1"
onclick="app.mail.onclickCompose"></et2-select-email>
</et2-hbox>
<et2-hbox disabled="!@ccaddress" width="100%">
<et2-description value="Cc" class="firstColumnTitle"></et2-description>
<et2-select-email id="ccaddress" readonly="true" multiple="true"
rows="1" maxTagsVisible="1"
onclick="app.mail.onclickCompose"></et2-select-email>
</et2-hbox>
<et2-date-time align="right" id="date" readonly="true"></et2-date-time>
</et2-hbox>
</et2-vbox>
<et2-details toggleAlign="left" title="@attachmentsBlockTitle" toggleOnHover="true" hoist="true" class="attachments" disabled="!@attachmentsBlock">
<et2-hbox slot="summary">
<grid class="previewAttachmentArea egwGridView_grid" >