Changes for #815

This commit is contained in:
the-djmaze 2023-01-03 13:50:38 +01:00
parent 8bd466a656
commit becdf29120
3 changed files with 16 additions and 8 deletions

View file

@ -31,6 +31,7 @@ html.rl-no-preview-pane {
.groupLabel { .groupLabel {
background:rgba(128,128,128,0.2); background:rgba(128,128,128,0.2);
cursor: pointer;
font-size: 12px; font-size: 12px;
line-height: 2; line-height: 2;
opacity: 0.6; opacity: 0.6;

View file

@ -164,6 +164,7 @@ export class MailMessageList extends AbstractViewRight {
current = { current = {
id: email, id: email,
label: msg.from[0].toLine(), label: msg.from[0].toLine(),
search: 'from=' + msg.from[0].email,
messages: [] messages: []
}; };
list.push(current); list.push(current);
@ -175,23 +176,25 @@ export class MailMessageList extends AbstractViewRight {
rtf = Intl.RelativeTimeFormat rtf = Intl.RelativeTimeFormat
? new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" }) : 0; ? new Intl.RelativeTimeFormat(doc.documentElement.lang, { numeric: "auto" }) : 0;
MessagelistUserStore.forEach(msg => { MessagelistUserStore.forEach(msg => {
let date = (new Date(msg.dateTimeStampInUTC() * 1000)), let dt = (new Date(msg.dateTimeStampInUTC() * 1000)),
ymd = Ymd(date); date,
ymd = Ymd(dt);
if (!current || ymd != current.id) { if (!current || ymd != current.id) {
if (rtf && today == ymd) { if (rtf && today == ymd) {
date = rtf.format(0, 'day'); date = rtf.format(0, 'day');
} else if (rtf && today - 1 == ymd) { } else if (rtf && today - 1 == ymd) {
date = rtf.format(-1, 'day'); date = rtf.format(-1, 'day');
// } else if (today - 7 < ymd) { // } else if (today - 7 < ymd) {
// date = date.format({weekday: 'long'}); // date = dt.format({weekday: 'long'});
// date = date.format({dateStyle: 'full'},0,LanguageStore.hourCycle()); // date = dt.format({dateStyle: 'full'},0,LanguageStore.hourCycle());
} else { } else {
// date = date.format({dateStyle: 'medium'},0,LanguageStore.hourCycle()); // date = dt.format({dateStyle: 'medium'},0,LanguageStore.hourCycle());
date = date.format({dateStyle: 'full'},0,LanguageStore.hourCycle()); date = dt.format({dateStyle: 'full'},0,LanguageStore.hourCycle());
} }
current = { current = {
id: ymd, id: ymd,
label: date, label: date,
search: 'on=' + dt.getFullYear() + '-' + pad2(1 + dt.getMonth()) + '-' + pad2(dt.getDate()),
messages: [] messages: []
}; };
list.push(current); list.push(current);
@ -815,6 +818,10 @@ export class MailMessageList extends AbstractViewRight {
showScreenPopup(AdvancedSearchPopupView, [MessagelistUserStore.mainSearch()]); showScreenPopup(AdvancedSearchPopupView, [MessagelistUserStore.mainSearch()]);
} }
groupSearchClick(group) {
group.search && MessagelistUserStore.mainSearch(group.search);
}
quotaTooltip() { quotaTooltip() {
return i18n('MESSAGE_LIST/QUOTA_SIZE', { return i18n('MESSAGE_LIST/QUOTA_SIZE', {
SIZE: FileInfo.friendlySize(FolderUserStore.quotaUsage()), SIZE: FileInfo.friendlySize(FolderUserStore.quotaUsage()),

View file

@ -130,8 +130,8 @@
</div> </div>
<!-- ko if: listGrouped --> <!-- ko if: listGrouped -->
<div class="messageListPlace" data-bind="dragmessages: 1, foreach: groupedList" draggable="true"> <div class="messageListPlace" data-bind="dragmessages: 1, i18nUpdate: groupedList, foreach: groupedList" draggable="true">
<div class="groupLabel" data-bind="text: label"></div> <div class="groupLabel" data-bind="text: label, click: $root.groupSearchClick" data-i18n="[title]GLOBAL/SEARCH"></div>
<!-- ko foreach: messages --> <!-- ko foreach: messages -->
<div class="messageListItem" data-bind="css: lineAsCss()"> <div class="messageListItem" data-bind="css: lineAsCss()">
<div class="messageCheckbox"> <div class="messageCheckbox">