From becdf29120a64082ae2a1f7cd1285c2939c2f728 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 3 Jan 2023 13:50:38 +0100 Subject: [PATCH] Changes for #815 --- dev/Styles/User/MessageList.less | 1 + dev/View/User/MailBox/MessageList.js | 19 +++++++++++++------ .../templates/Views/User/MailMessageList.html | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/dev/Styles/User/MessageList.less b/dev/Styles/User/MessageList.less index 7026f6b5f..56b3a822f 100644 --- a/dev/Styles/User/MessageList.less +++ b/dev/Styles/User/MessageList.less @@ -31,6 +31,7 @@ html.rl-no-preview-pane { .groupLabel { background:rgba(128,128,128,0.2); + cursor: pointer; font-size: 12px; line-height: 2; opacity: 0.6; diff --git a/dev/View/User/MailBox/MessageList.js b/dev/View/User/MailBox/MessageList.js index 46dbd75cf..0a17250c3 100644 --- a/dev/View/User/MailBox/MessageList.js +++ b/dev/View/User/MailBox/MessageList.js @@ -164,6 +164,7 @@ export class MailMessageList extends AbstractViewRight { current = { id: email, label: msg.from[0].toLine(), + search: 'from=' + msg.from[0].email, messages: [] }; list.push(current); @@ -175,23 +176,25 @@ export class MailMessageList extends AbstractViewRight { rtf = Intl.RelativeTimeFormat ? new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" }) : 0; MessagelistUserStore.forEach(msg => { - let date = (new Date(msg.dateTimeStampInUTC() * 1000)), - ymd = Ymd(date); + let dt = (new Date(msg.dateTimeStampInUTC() * 1000)), + date, + ymd = Ymd(dt); if (!current || ymd != current.id) { if (rtf && today == ymd) { date = rtf.format(0, 'day'); } else if (rtf && today - 1 == ymd) { date = rtf.format(-1, 'day'); // } else if (today - 7 < ymd) { -// date = date.format({weekday: 'long'}); -// date = date.format({dateStyle: 'full'},0,LanguageStore.hourCycle()); +// date = dt.format({weekday: 'long'}); +// date = dt.format({dateStyle: 'full'},0,LanguageStore.hourCycle()); } else { -// date = date.format({dateStyle: 'medium'},0,LanguageStore.hourCycle()); - date = date.format({dateStyle: 'full'},0,LanguageStore.hourCycle()); +// date = dt.format({dateStyle: 'medium'},0,LanguageStore.hourCycle()); + date = dt.format({dateStyle: 'full'},0,LanguageStore.hourCycle()); } current = { id: ymd, label: date, + search: 'on=' + dt.getFullYear() + '-' + pad2(1 + dt.getMonth()) + '-' + pad2(dt.getDate()), messages: [] }; list.push(current); @@ -815,6 +818,10 @@ export class MailMessageList extends AbstractViewRight { showScreenPopup(AdvancedSearchPopupView, [MessagelistUserStore.mainSearch()]); } + groupSearchClick(group) { + group.search && MessagelistUserStore.mainSearch(group.search); + } + quotaTooltip() { return i18n('MESSAGE_LIST/QUOTA_SIZE', { SIZE: FileInfo.friendlySize(FolderUserStore.quotaUsage()), diff --git a/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html b/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html index 57d9fe607..5597bf0b9 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/MailMessageList.html @@ -130,8 +130,8 @@ -
-
+
+