diff --git a/docs/configuration.md b/docs/configuration.md index a46b20c88..c34c3abf8 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -203,7 +203,7 @@ and watch out for indentation if editing the YAML file. #### [`PAPERLESS_EMAIL_PARSE_DEFAULT_LAYOUT=`(#PAPERLESS_EMAIL_PARSE_DEFAULT_LAYOUT) {#PAPERLESS_EMAIL_PARSE_DEFAULT_LAYOUT} : The default layout to use for emails that are consumed as documents. Must be one of the integer choices below. Note that mail -rules can specify this setting, thus this fallback is used for .eml files consumed by other means. +rules can specify this setting, thus this fallback is used for the default selection and for .eml files consumed by other means. - `1` = Text, then HTML - `2` = HTML, then text diff --git a/src-ui/messages.xlf b/src-ui/messages.xlf index 603a2209f..d7abbea6a 100644 --- a/src-ui/messages.xlf +++ b/src-ui/messages.xlf @@ -2030,7 +2030,7 @@ src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 84 + 88 src/app/components/common/edit-dialog/workflow-edit-dialog/workflow-edit-dialog.component.html @@ -4032,123 +4032,130 @@ 58 + + System default + + src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts + 65 + + Text, then HTML src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 65 + 69 HTML, then text src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 69 + 73 HTML only src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 73 + 77 Text only src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 77 + 81 Move to specified folder src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 88 + 92 Mark as read, don't process read mails src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 92 + 96 Flag the mail, don't process flagged mails src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 96 + 100 Tag the mail with specified tag, don't process tagged mails src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 100 + 104 Use subject as title src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 107 + 111 Use attachment filename as title src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 111 + 115 Do not assign title from this rule src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 115 + 119 Do not assign a correspondent src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 122 + 126 Use mail address src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 126 + 130 Use name (or mail address if not available) src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 130 + 134 Use correspondent selected below src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 134 + 138 Create new mail rule src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 186 + 190 Edit mail rule src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts - 190 + 194 diff --git a/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts b/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts index 3e9e7b1cc..3d4924c0b 100644 --- a/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts +++ b/src-ui/src/app/components/common/edit-dialog/mail-rule-edit-dialog/mail-rule-edit-dialog.component.ts @@ -60,6 +60,10 @@ const CONSUMPTION_SCOPE_OPTIONS = [ ] const PDF_LAYOUT_OPTIONS = [ + { + id: MailRulePdfLayout.Default, + name: $localize`System default`, + }, { id: MailRulePdfLayout.TextHtml, name: $localize`Text, then HTML`, @@ -204,7 +208,7 @@ export class MailRuleEditDialogComponent extends EditDialogComponent { filter_attachment_filename_exclude: new FormControl(null), maximum_age: new FormControl(null), attachment_type: new FormControl(MailFilterAttachmentType.Attachments), - pdf_layout: new FormControl(MailRulePdfLayout.TextHtml), + pdf_layout: new FormControl(MailRulePdfLayout.Default), consumption_scope: new FormControl(MailRuleConsumptionScope.Attachments), order: new FormControl(null), action: new FormControl(MailAction.MarkRead), diff --git a/src-ui/src/app/data/mail-rule.ts b/src-ui/src/app/data/mail-rule.ts index 1f7a5a80e..4c47b6500 100644 --- a/src-ui/src/app/data/mail-rule.ts +++ b/src-ui/src/app/data/mail-rule.ts @@ -12,6 +12,7 @@ export enum MailRuleConsumptionScope { } export enum MailRulePdfLayout { + Default = 0, TextHtml = 1, HtmlText = 2, HtmlOnly = 3, diff --git a/src/locale/en_US/LC_MESSAGES/django.po b/src/locale/en_US/LC_MESSAGES/django.po index 0ef4c1dc8..828bed3a1 100644 --- a/src/locale/en_US/LC_MESSAGES/django.po +++ b/src/locale/en_US/LC_MESSAGES/django.po @@ -1,21 +1,21 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: paperless-ngx\n" +"Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-01-27 08:19-0800\n" -"PO-Revision-Date: 2022-02-17 04:17\n" -"Last-Translator: \n" -"Language-Team: English\n" -"Language: en_US\n" +"POT-Creation-Date: 2025-01-27 09:31-0800\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Crowdin-Project: paperless-ngx\n" -"X-Crowdin-Project-ID: 500308\n" -"X-Crowdin-Language: en\n" -"X-Crowdin-File: /dev/src/locale/en_US/LC_MESSAGES/django.po\n" -"X-Crowdin-File-ID: 14\n" #: documents/apps.py:8 msgid "Documents" @@ -90,7 +90,7 @@ msgid "Automatic" msgstr "" #: documents/models.py:67 documents/models.py:433 documents/models.py:1493 -#: paperless_mail/models.py:23 paperless_mail/models.py:136 +#: paperless_mail/models.py:23 paperless_mail/models.py:143 msgid "name" msgstr "" @@ -276,7 +276,7 @@ msgstr "" msgid "warning" msgstr "" -#: documents/models.py:387 paperless_mail/models.py:350 +#: documents/models.py:387 paperless_mail/models.py:363 msgid "error" msgstr "" @@ -818,7 +818,7 @@ msgstr "" msgid "filter filename" msgstr "" -#: documents/models.py:1066 paperless_mail/models.py:193 +#: documents/models.py:1066 paperless_mail/models.py:200 msgid "" "Only consume documents which entirely match this filename if specified. " "Wildcards such as *.pdf or *invoice* are allowed. Case insensitive." @@ -988,15 +988,15 @@ msgid "" "Assign a document title, can include some placeholders, see documentation." msgstr "" -#: documents/models.py:1287 paperless_mail/models.py:261 +#: documents/models.py:1287 paperless_mail/models.py:274 msgid "assign this tag" msgstr "" -#: documents/models.py:1296 paperless_mail/models.py:269 +#: documents/models.py:1296 paperless_mail/models.py:282 msgid "assign this document type" msgstr "" -#: documents/models.py:1305 paperless_mail/models.py:283 +#: documents/models.py:1305 paperless_mail/models.py:296 msgid "assign this correspondent" msgstr "" @@ -1112,7 +1112,7 @@ msgstr "" msgid "workflow actions" msgstr "" -#: documents/models.py:1495 paperless_mail/models.py:138 +#: documents/models.py:1495 paperless_mail/models.py:145 msgid "order" msgstr "" @@ -1124,7 +1124,7 @@ msgstr "" msgid "actions" msgstr "" -#: documents/models.py:1511 paperless_mail/models.py:147 +#: documents/models.py:1511 paperless_mail/models.py:154 msgid "enabled" msgstr "" @@ -1838,161 +1838,185 @@ msgid "Process all files, including 'inline' attachments." msgstr "" #: paperless_mail/models.py:119 -msgid "Delete" +msgid "System default" msgstr "" #: paperless_mail/models.py:120 -msgid "Move to specified folder" +msgid "Text, then HTML" msgstr "" #: paperless_mail/models.py:121 -msgid "Mark as read, don't process read mails" +msgid "HTML, then text" msgstr "" #: paperless_mail/models.py:122 -msgid "Flag the mail, don't process flagged mails" +msgid "HTML only" msgstr "" #: paperless_mail/models.py:123 -msgid "Tag the mail with specified tag, don't process tagged mails" +msgid "Text only" msgstr "" #: paperless_mail/models.py:126 -msgid "Use subject as title" +msgid "Delete" msgstr "" #: paperless_mail/models.py:127 -msgid "Use attachment filename as title" +msgid "Move to specified folder" msgstr "" #: paperless_mail/models.py:128 -msgid "Do not assign title from rule" +msgid "Mark as read, don't process read mails" msgstr "" -#: paperless_mail/models.py:131 -msgid "Do not assign a correspondent" +#: paperless_mail/models.py:129 +msgid "Flag the mail, don't process flagged mails" msgstr "" -#: paperless_mail/models.py:132 -msgid "Use mail address" +#: paperless_mail/models.py:130 +msgid "Tag the mail with specified tag, don't process tagged mails" msgstr "" #: paperless_mail/models.py:133 -msgid "Use name (or mail address if not available)" +msgid "Use subject as title" msgstr "" #: paperless_mail/models.py:134 +msgid "Use attachment filename as title" +msgstr "" + +#: paperless_mail/models.py:135 +msgid "Do not assign title from rule" +msgstr "" + +#: paperless_mail/models.py:138 +msgid "Do not assign a correspondent" +msgstr "" + +#: paperless_mail/models.py:139 +msgid "Use mail address" +msgstr "" + +#: paperless_mail/models.py:140 +msgid "Use name (or mail address if not available)" +msgstr "" + +#: paperless_mail/models.py:141 msgid "Use correspondent selected below" msgstr "" -#: paperless_mail/models.py:144 +#: paperless_mail/models.py:151 msgid "account" msgstr "" -#: paperless_mail/models.py:150 paperless_mail/models.py:305 +#: paperless_mail/models.py:157 paperless_mail/models.py:318 msgid "folder" msgstr "" -#: paperless_mail/models.py:154 +#: paperless_mail/models.py:161 msgid "" "Subfolders must be separated by a delimiter, often a dot ('.') or slash " "('/'), but it varies by mail server." msgstr "" -#: paperless_mail/models.py:160 +#: paperless_mail/models.py:167 msgid "filter from" msgstr "" -#: paperless_mail/models.py:167 +#: paperless_mail/models.py:174 msgid "filter to" msgstr "" -#: paperless_mail/models.py:174 +#: paperless_mail/models.py:181 msgid "filter subject" msgstr "" -#: paperless_mail/models.py:181 +#: paperless_mail/models.py:188 msgid "filter body" msgstr "" -#: paperless_mail/models.py:188 +#: paperless_mail/models.py:195 msgid "filter attachment filename inclusive" msgstr "" -#: paperless_mail/models.py:200 +#: paperless_mail/models.py:207 msgid "filter attachment filename exclusive" msgstr "" -#: paperless_mail/models.py:205 +#: paperless_mail/models.py:212 msgid "" "Do not consume documents which entirely match this filename if specified. " "Wildcards such as *.pdf or *invoice* are allowed. Case insensitive." msgstr "" -#: paperless_mail/models.py:212 +#: paperless_mail/models.py:219 msgid "maximum age" msgstr "" -#: paperless_mail/models.py:214 +#: paperless_mail/models.py:221 msgid "Specified in days." msgstr "" -#: paperless_mail/models.py:218 +#: paperless_mail/models.py:225 msgid "attachment type" msgstr "" -#: paperless_mail/models.py:222 +#: paperless_mail/models.py:229 msgid "" "Inline attachments include embedded images, so it's best to combine this " "option with a filename filter." msgstr "" -#: paperless_mail/models.py:228 +#: paperless_mail/models.py:235 msgid "consumption scope" msgstr "" -#: paperless_mail/models.py:234 +#: paperless_mail/models.py:241 +msgid "pdf layout" +msgstr "" + +#: paperless_mail/models.py:247 msgid "action" msgstr "" -#: paperless_mail/models.py:240 +#: paperless_mail/models.py:253 msgid "action parameter" msgstr "" -#: paperless_mail/models.py:245 +#: paperless_mail/models.py:258 msgid "" "Additional parameter for the action selected above, i.e., the target folder " "of the move to folder action. Subfolders must be separated by dots." msgstr "" -#: paperless_mail/models.py:253 +#: paperless_mail/models.py:266 msgid "assign title from" msgstr "" -#: paperless_mail/models.py:273 +#: paperless_mail/models.py:286 msgid "assign correspondent from" msgstr "" -#: paperless_mail/models.py:287 +#: paperless_mail/models.py:300 msgid "Assign the rule owner to documents" msgstr "" -#: paperless_mail/models.py:313 +#: paperless_mail/models.py:326 msgid "uid" msgstr "" -#: paperless_mail/models.py:321 +#: paperless_mail/models.py:334 msgid "subject" msgstr "" -#: paperless_mail/models.py:329 +#: paperless_mail/models.py:342 msgid "received" msgstr "" -#: paperless_mail/models.py:336 +#: paperless_mail/models.py:349 msgid "processed" msgstr "" -#: paperless_mail/models.py:342 +#: paperless_mail/models.py:355 msgid "status" msgstr "" diff --git a/src/paperless_mail/migrations/0029_mailrule_pdf_layout.py b/src/paperless_mail/migrations/0029_mailrule_pdf_layout.py index ae0afacc0..fe7a93b71 100644 --- a/src/paperless_mail/migrations/0029_mailrule_pdf_layout.py +++ b/src/paperless_mail/migrations/0029_mailrule_pdf_layout.py @@ -15,12 +15,13 @@ class Migration(migrations.Migration): name="pdf_layout", field=models.PositiveIntegerField( choices=[ + (0, "System default"), (1, "Text, then HTML"), (2, "HTML, then text"), (3, "HTML only"), (4, "Text only"), ], - default=1, + default=0, verbose_name="pdf layout", ), ), diff --git a/src/paperless_mail/models.py b/src/paperless_mail/models.py index 2f7640325..045743e67 100644 --- a/src/paperless_mail/models.py +++ b/src/paperless_mail/models.py @@ -116,6 +116,7 @@ class MailRule(document_models.ModelWithOwner): EVERYTHING = 2, _("Process all files, including 'inline' attachments.") class PdfLayout(models.IntegerChoices): + DEFAULT = 0, _("System default") TEXT_HTML = 1, _("Text, then HTML") HTML_TEXT = 2, _("HTML, then text") HTML_ONLY = 3, _("HTML only")