From 64cf19746df6ac7ce499b8e695abfdbf722be888 Mon Sep 17 00:00:00 2001 From: djmaze Date: Sat, 27 Mar 2021 16:02:48 +0100 Subject: [PATCH] Finish the sort feature --- dev/Common/EnumsUser.js | 2 +- dev/Stores/User/Folder.js | 4 ++-- dev/View/User/MailBox/MessageList.js | 8 +++++--- .../app/localization/webmail/_source.en.yml | 13 +++++++------ .../0.0.0/app/localization/webmail/de_DE.yml | 9 +++++++++ .../0.0.0/app/localization/webmail/en_GB.yml | 9 +++++++++ .../0.0.0/app/localization/webmail/en_US.yml | 9 +++++++++ .../0.0.0/app/localization/webmail/es_ES.yml | 9 +++++++++ .../0.0.0/app/localization/webmail/fr_FR.yml | 9 +++++++++ .../0.0.0/app/localization/webmail/nl_NL.yml | 9 +++++++++ .../0.0.0/app/localization/webmail/zh_CN.yml | 9 +++++++++ .../templates/Views/User/MailMessageList.html | 8 ++++---- vendors/fontastic/fonts/snappymail.woff | Bin 9712 -> 9920 bytes vendors/fontastic/fonts/snappymail.woff2 | Bin 7808 -> 7916 bytes 14 files changed, 82 insertions(+), 16 deletions(-) diff --git a/dev/Common/EnumsUser.js b/dev/Common/EnumsUser.js index 12514e334..9ede882ee 100644 --- a/dev/Common/EnumsUser.js +++ b/dev/Common/EnumsUser.js @@ -17,7 +17,7 @@ export const FolderType = { /** * @enum {string} */ -export const FolderSortType = { +export const FolderSortMode = { DateDesc: '', // default 'REVERSE DATE' DateAsc: 'DATE', FromDesc: 'REVERSE FROM', diff --git a/dev/Stores/User/Folder.js b/dev/Stores/User/Folder.js index f8ab9b6a5..34ed105bf 100644 --- a/dev/Stores/User/Folder.js +++ b/dev/Stores/User/Folder.js @@ -1,6 +1,6 @@ import ko from 'ko'; -import { FolderType, FolderSortType } from 'Common/EnumsUser'; +import { FolderType, FolderSortMode } from 'Common/EnumsUser'; import { UNUSED_OPTION_VALUE } from 'Common/Consts'; import { addObservablesTo, addSubscribablesTo } from 'Common/Utils'; import { folderListOptionsBuilder } from 'Common/UtilsUser'; @@ -42,7 +42,7 @@ export const FolderUserStore = new class { foldersInboxUnreadCount: 0 }); - this.sortMode = ko.observable('').extend({ limitedList: Object.values(FolderSortType) }); + this.sortMode = ko.observable('').extend({ limitedList: Object.values(FolderSortMode) }); this.namespace = ''; diff --git a/dev/View/User/MailBox/MessageList.js b/dev/View/User/MailBox/MessageList.js index 3f6048952..3701cbe93 100644 --- a/dev/View/User/MailBox/MessageList.js +++ b/dev/View/User/MailBox/MessageList.js @@ -179,13 +179,15 @@ export class MessageListMailBoxUserView extends AbstractViewRight { messageListFocused: () => Scope.MessageList === AppUserStore.focusedState(), sortText: () => { - let mode = FolderUserStore.sortMode().split(/\s+/); - if ('' === mode[0]) { + let mode = FolderUserStore.sortMode(); + if ('' === mode) { return '📅⬇'; } + mode = mode.split(/\s+/); return (mode.includes('SIZE') ? '✉' : (mode.includes('FROM') ? '@' - : (mode.includes('SUBJECT') ? '𝐒' : '📅'))) + : (mode.includes('SUBJECT') ? '𝐒' + : '📅'))) + (mode.includes('REVERSE') ? '⬇' : '⬆'); } }); diff --git a/snappymail/v/0.0.0/app/localization/webmail/_source.en.yml b/snappymail/v/0.0.0/app/localization/webmail/_source.en.yml index db0d833ff..e5e8a3bde 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/_source.en.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/_source.en.yml @@ -101,14 +101,15 @@ en: YESTERDAY_AT: "yesterday at %TIME%" NEW_MESSAGE_NOTIFICATION: "You have %COUNT% new messages!" QUOTA_SIZE: "Using %SIZE% (%PROC%%) of your %LIMIT%" - SORT_DATE_DESC: "Date descending" + SORT: "Sort" SORT_DATE_ASC: "Date ascending" - SORT_SIZE_DESC: "Size descending" + SORT_DATE_DESC: "Date descending" SORT_SIZE_ASC: "Size ascending" - SORT_SUBJECT_DESC: "Subject descending" - SORT_SUBJECT_ASC: "Subject ascending" - SORT_FROM_DESC: "From descending" - SORT_FROM_ASC: "From ascending" + SORT_SIZE_DESC: "Size descending" + SORT_SUBJECT_ASC: "Subject A-Z" + SORT_SUBJECT_DESC: "Subject Z-A" + SORT_FROM_ASC: "From A-Z" + SORT_FROM_DESC: "From Z-A" MESSAGE: BUTTON_EDIT: "Edit" BUTTON_UNSUBSCRIBE: "Unsubscribe from this list" diff --git a/snappymail/v/0.0.0/app/localization/webmail/de_DE.yml b/snappymail/v/0.0.0/app/localization/webmail/de_DE.yml index 93e0ff611..a042e84b7 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/de_DE.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/de_DE.yml @@ -101,6 +101,15 @@ de_DE: YESTERDAY_AT: "Gestern um %TIME%" NEW_MESSAGE_NOTIFICATION: "Sie haben %COUNT% neue Nachrichten!" QUOTA_SIZE: "Sie nutzen %SIZE% (%PROC%%) von %LIMIT%." + SORT: "Sortieren" + SORT_DATE_ASC: "Datum aufsteigend" + SORT_DATE_DESC: "Datum absteigend" + SORT_SIZE_ASC: "Größe aufsteigend" + SORT_SIZE_DESC: "Größe absteigend" + SORT_SUBJECT_ASC: "Betreff A-Z" + SORT_SUBJECT_DESC: "Betreff Z-A" + SORT_FROM_ASC: "Von A-Z" + SORT_FROM_DESC: "Von Z-A" MESSAGE: BUTTON_EDIT: "Bearbeiten" BUTTON_UNSUBSCRIBE: "Diese Liste abbestellen" diff --git a/snappymail/v/0.0.0/app/localization/webmail/en_GB.yml b/snappymail/v/0.0.0/app/localization/webmail/en_GB.yml index 1e7f1fc30..840950b7c 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/en_GB.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/en_GB.yml @@ -101,6 +101,15 @@ en_GB: YESTERDAY_AT: "yesterday at %TIME%" NEW_MESSAGE_NOTIFICATION: "You have %COUNT% new messages!" QUOTA_SIZE: "Using %SIZE% (%PROC%%) of your %LIMIT%" + SORT: "Sort" + SORT_DATE_ASC: "Date ascending" + SORT_DATE_DESC: "Date descending" + SORT_SIZE_ASC: "Size ascending" + SORT_SIZE_DESC: "Size descending" + SORT_SUBJECT_ASC: "Subject A-Z" + SORT_SUBJECT_DESC: "Subject Z-A" + SORT_FROM_ASC: "From A-Z" + SORT_FROM_DESC: "From Z-A" MESSAGE: BUTTON_EDIT: "Edit" BUTTON_UNSUBSCRIBE: "Unsubscribe from this list" diff --git a/snappymail/v/0.0.0/app/localization/webmail/en_US.yml b/snappymail/v/0.0.0/app/localization/webmail/en_US.yml index 6b58bec90..b1bedc535 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/en_US.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/en_US.yml @@ -101,6 +101,15 @@ en_US: YESTERDAY_AT: "yesterday at %TIME%" NEW_MESSAGE_NOTIFICATION: "You have %COUNT% new messages!" QUOTA_SIZE: "Using %SIZE% (%PROC%%) of your %LIMIT%" + SORT: "Sort" + SORT_DATE_ASC: "Date ascending" + SORT_DATE_DESC: "Date descending" + SORT_SIZE_ASC: "Size ascending" + SORT_SIZE_DESC: "Size descending" + SORT_SUBJECT_ASC: "Subject A-Z" + SORT_SUBJECT_DESC: "Subject Z-A" + SORT_FROM_ASC: "From A-Z" + SORT_FROM_DESC: "From Z-A" MESSAGE: BUTTON_EDIT: "Edit" BUTTON_UNSUBSCRIBE: "Unsubscribe from this list" diff --git a/snappymail/v/0.0.0/app/localization/webmail/es_ES.yml b/snappymail/v/0.0.0/app/localization/webmail/es_ES.yml index 17b2bb532..8b0d43ede 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/es_ES.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/es_ES.yml @@ -101,6 +101,15 @@ es_ES: YESTERDAY_AT: "ayer a las %TIME%" NEW_MESSAGE_NOTIFICATION: "Tiene %COUNT% nuevos mensajes." QUOTA_SIZE: "Usando %SIZE% (%PROC%%) de sus %LIMIT%" + SORT: "Ordenar" + SORT_DATE_ASC: "Fecha ascendente" + SORT_DATE_DESC: "Fecha descendente" + SORT_SIZE_ASC: "Tamaño ascendente" + SORT_SIZE_DESC: "Tamaño descendente" + SORT_SUBJECT_ASC: "Asunto A-Z" + SORT_SUBJECT_DESC: "Asunto Z-A" + SORT_FROM_ASC: "Desde A-Z" + SORT_FROM_DESC: "Desde Z-A" MESSAGE: BUTTON_EDIT: "Editar" BUTTON_UNSUBSCRIBE: "Eliminar suscripción de esta lista" diff --git a/snappymail/v/0.0.0/app/localization/webmail/fr_FR.yml b/snappymail/v/0.0.0/app/localization/webmail/fr_FR.yml index a67a06f02..f67640847 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/fr_FR.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/fr_FR.yml @@ -101,6 +101,15 @@ fr_FR: YESTERDAY_AT: "hier à %TIME%" NEW_MESSAGE_NOTIFICATION: "Vous avez %COUNT% nouveaux messages !" QUOTA_SIZE: "Vous utilisez %SIZE% (%PROC%%) sur %LIMIT%" + SORT: "Trier" + SORT_DATE_ASC: "Date ascendante" + SORT_DATE_DESC: "Date décroissante" + SORT_SIZE_ASC: "Taille ascendante" + SORT_SIZE_DESC: "Taille décroissante" + SORT_SUBJECT_ASC: "Sujet A-Z" + SORT_SUBJECT_DESC: "Sujet Z-A" + SORT_FROM_ASC: "De A-Z" + SORT_FROM_DESC: "De Z-A" MESSAGE: BUTTON_EDIT: "Modifier" BUTTON_UNSUBSCRIBE: "Se désinscrire de cette liste" diff --git a/snappymail/v/0.0.0/app/localization/webmail/nl_NL.yml b/snappymail/v/0.0.0/app/localization/webmail/nl_NL.yml index 7bc303307..8a37c4761 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/nl_NL.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/nl_NL.yml @@ -101,6 +101,15 @@ nl_NL: YESTERDAY_AT: "gisteren om %TIME%" NEW_MESSAGE_NOTIFICATION: "U heeft %COUNT% nieuwe berichten!" QUOTA_SIZE: "U gebruikt %SIZE% (%PROC%%) van %LIMIT%" + SORT: "Sorteren" + SORT_DATE_ASC: "Datum oplopend" + SORT_DATE_DESC: "Datum aflopend" + SORT_SIZE_ASC: "Grootte oplopend" + SORT_SIZE_DESC: "Grootte aflopend" + SORT_SUBJECT_ASC: "Onderwerp A-Z" + SORT_SUBJECT_DESC: "Onderwerp Z-A" + SORT_FROM_ASC: "Van A-Z" + SORT_FROM_DESC: "Van Z-A" MESSAGE: BUTTON_EDIT: "Aanpassen" BUTTON_UNSUBSCRIBE: "Abonnement op deze e-mail lijst opzeggen" diff --git a/snappymail/v/0.0.0/app/localization/webmail/zh_CN.yml b/snappymail/v/0.0.0/app/localization/webmail/zh_CN.yml index 37337a3a4..2ff83d1d1 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/zh_CN.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/zh_CN.yml @@ -101,6 +101,15 @@ zh_CN: YESTERDAY_AT: "昨天 %TIME%" NEW_MESSAGE_NOTIFICATION: "您有 %COUNT% 封新邮件!" QUOTA_SIZE: "使用了 %LIMIT% 存储空间中的%SIZE% (%PROC%%)" + SORT: "排序" + SORT_DATE_ASC: "日期升序" + SORT_DATE_DESC: "日期降序" + SORT_SIZE_ASC: "大小递增" + SORT_SIZE_DESC: "大小递减" + SORT_SUBJECT_ASC: "主题 A-Z" + SORT_SUBJECT_DESC: "主题 Z-A" + SORT_FROM_ASC: "发送自 A-Z" + SORT_FROM_DESC: "发送自 Z-A" MESSAGE: BUTTON_EDIT: "编辑" BUTTON_UNSUBSCRIBE: "从此列表中取消订阅" 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 9f89d752d..3a039252f 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 @@ -101,8 +101,8 @@ -