From 08e0dd47bd668f006cd052334463d2c7750efd6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Wed, 13 Nov 2024 10:58:11 +0100 Subject: [PATCH] fix: disable the mail sending test when no SMTP server is configured --- canaille/core/templates/mails/admin.html | 38 ++++++++++++++-------- canaille/translations/messages.pot | 40 +++++++++++++----------- 2 files changed, 47 insertions(+), 31 deletions(-) diff --git a/canaille/core/templates/mails/admin.html b/canaille/core/templates/mails/admin.html index f713cdc0..ee6dfde0 100644 --- a/canaille/core/templates/mails/admin.html +++ b/canaille/core/templates/mails/admin.html @@ -38,21 +38,33 @@ -
- {% trans %} - This form will send a dummy email to the address you want. - This should be used for testing mail configuration. - {% endtrans %} -
+ {% if features.has_smtp %} - {% call fui.render_form(form) %} - {{ fui.render_field(form.email) }} -
-
- -
+
+ {% trans %} + This form will send a dummy email to the address you want. + This should be used for testing mail configuration. + {% endtrans %}
- {% endcall %} + + {% call fui.render_form(form) %} + {{ fui.render_field(form.email) }} +
+
+ +
+
+ {% endcall %} + + {% else %} + +
+ {% trans %} + No mail server has been configured. The mail sending test is disabled. + {% endtrans %} +
+ + {% endif %}
diff --git a/canaille/translations/messages.pot b/canaille/translations/messages.pot index a8b4f68e..8a89e35d 100644 --- a/canaille/translations/messages.pot +++ b/canaille/translations/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2024-10-28 11:57+0100\n" +"POT-Creation-Date: 2024-11-13 10:57+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,35 +17,35 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.16.0\n" -#: canaille/app/flask.py:100 +#: canaille/app/flask.py:53 msgid "No SMTP server has been configured" msgstr "" -#: canaille/app/forms.py:27 +#: canaille/app/forms.py:26 msgid "This is not a valid URL" msgstr "" -#: canaille/app/forms.py:34 canaille/app/forms.py:35 +#: canaille/app/forms.py:33 canaille/app/forms.py:34 msgid "This value is a duplicate" msgstr "" -#: canaille/app/forms.py:47 +#: canaille/app/forms.py:46 msgid "Not a valid phone number" msgstr "" -#: canaille/app/forms.py:55 +#: canaille/app/forms.py:54 msgid "Field must be at least {minimum_password_length} characters long." msgstr "" -#: canaille/app/forms.py:67 +#: canaille/app/forms.py:66 msgid "Field cannot be longer than {maximum_password_length} characters." msgstr "" -#: canaille/app/forms.py:240 +#: canaille/app/forms.py:244 msgid "The page number is not valid" msgstr "" -#: canaille/app/forms.py:268 +#: canaille/app/forms.py:272 msgid "Not a valid datetime value." msgstr "" @@ -666,7 +666,7 @@ msgid "Send again" msgstr "" #: canaille/core/templates/forgotten-password.html:48 -#: canaille/core/templates/mails/admin.html:52 +#: canaille/core/templates/mails/admin.html:54 msgid "Send" msgstr "" @@ -987,7 +987,7 @@ msgstr "" msgid "The user will not be able to authenticate unless the password is set" msgstr "" -#: canaille/core/templates/mails/admin.html:97 +#: canaille/core/templates/mails/admin.html:109 #: canaille/core/templates/mails/reset.html:19 #: canaille/core/templates/profile_settings.html:116 #: canaille/core/templates/reset-password.html:12 @@ -1102,38 +1102,42 @@ msgstr "" msgid "Mail sending test" msgstr "" -#: canaille/core/templates/mails/admin.html:42 +#: canaille/core/templates/mails/admin.html:44 msgid "" "This form will send a dummy email to the address you want. This should be" " used for testing mail configuration." msgstr "" -#: canaille/core/templates/mails/admin.html:61 -msgid "Email preview" +#: canaille/core/templates/mails/admin.html:62 +msgid "No mail server has been configured. The mail sending test is disabled." msgstr "" #: canaille/core/templates/mails/admin.html:73 +msgid "Email preview" +msgstr "" + +#: canaille/core/templates/mails/admin.html:85 #: canaille/core/templates/mails/test.html:19 #: canaille/core/templates/mails/test.txt:1 msgid "Connectivity test" msgstr "" -#: canaille/core/templates/mails/admin.html:85 +#: canaille/core/templates/mails/admin.html:97 #: canaille/core/templates/mails/firstlogin.html:19 #: canaille/core/templates/mails/reset.txt:1 msgid "Password initialization" msgstr "" -#: canaille/core/templates/mails/admin.html:109 +#: canaille/core/templates/mails/admin.html:121 #: canaille/core/templates/mails/email-confirmation.txt:1 msgid "Email verification" msgstr "" -#: canaille/core/templates/mails/admin.html:121 +#: canaille/core/templates/mails/admin.html:133 msgid "Invitation" msgstr "" -#: canaille/core/templates/mails/admin.html:133 +#: canaille/core/templates/mails/admin.html:145 #: canaille/core/templates/mails/registration.html:19 #: canaille/core/templates/mails/registration.txt:1 msgid "Registration"