From 22a11f426e4cd6d7b6f8245987c464355a211fb2 Mon Sep 17 00:00:00 2001 From: JoeyStk Date: Tue, 12 Nov 2024 18:13:58 +0100 Subject: [PATCH 1/8] Correct translation for archive contact Co-authored-by: KateGithub12 --- integreat_cms/locale/de/LC_MESSAGES/django.po | 2 +- integreat_cms/release_notes/current/unreleased/3181.yml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 integreat_cms/release_notes/current/unreleased/3181.yml diff --git a/integreat_cms/locale/de/LC_MESSAGES/django.po b/integreat_cms/locale/de/LC_MESSAGES/django.po index 9b5749b470..0d55812138 100644 --- a/integreat_cms/locale/de/LC_MESSAGES/django.po +++ b/integreat_cms/locale/de/LC_MESSAGES/django.po @@ -5282,7 +5282,7 @@ msgstr "Zur Zeit wird dieser Kontakt in keiner Veranstaltung verwendet." #: cms/templates/contacts/contact_form.html #: cms/templates/contacts/contact_list_row.html msgid "Archive contact" -msgstr "Kontakte archivieren" +msgstr "Kontakt archivieren" #: cms/templates/contacts/contact_form.html msgid "Archive this contact" diff --git a/integreat_cms/release_notes/current/unreleased/3181.yml b/integreat_cms/release_notes/current/unreleased/3181.yml new file mode 100644 index 0000000000..6c17d9d944 --- /dev/null +++ b/integreat_cms/release_notes/current/unreleased/3181.yml @@ -0,0 +1,2 @@ +en: Correct translation for archive contact +de: Korrigiere Übersetzung für Kontakt archivieren From 4dedf96ea567925fd3be9dae1de6e3502f5e2113 Mon Sep 17 00:00:00 2001 From: JoeyStk Date: Tue, 12 Nov 2024 19:32:11 +0100 Subject: [PATCH 2/8] Add edit icon to contact, page, event and poi Co-authored-by: KateGithub12 --- .../cms/templates/contacts/contact_list_row.html | 5 +++++ .../cms/templates/events/event_list_row.html | 5 +++++ .../cms/templates/pages/page_tree_node.html | 2 +- integreat_cms/cms/templates/pois/poi_list_row.html | 10 ++++++++++ integreat_cms/locale/de/LC_MESSAGES/django.po | 12 +++++++++--- .../release_notes/current/unreleased/3187.yml | 2 ++ 6 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 integreat_cms/release_notes/current/unreleased/3187.yml diff --git a/integreat_cms/cms/templates/contacts/contact_list_row.html b/integreat_cms/cms/templates/contacts/contact_list_row.html index 87be1622b3..07746c2245 100644 --- a/integreat_cms/cms/templates/contacts/contact_list_row.html +++ b/integreat_cms/cms/templates/contacts/contact_list_row.html @@ -59,6 +59,11 @@ {% endif %} {% else %} {% if perms.cms.change_contact %} + + + diff --git a/integreat_cms/cms/templates/events/event_list_row.html b/integreat_cms/cms/templates/events/event_list_row.html index aec013655a..3532f8fcd6 100644 --- a/integreat_cms/cms/templates/events/event_list_row.html +++ b/integreat_cms/cms/templates/events/event_list_row.html @@ -146,6 +146,11 @@ {% has_perm 'cms.change_event' request.user as can_edit_event %} {% if can_edit_event %} {% if not is_archive %} + + + {% if not event.external_calendar %}
diff --git a/integreat_cms/cms/templates/pages/page_tree_node.html b/integreat_cms/cms/templates/pages/page_tree_node.html index dfce0bb660..21203e4c53 100644 --- a/integreat_cms/cms/templates/pages/page_tree_node.html +++ b/integreat_cms/cms/templates/pages/page_tree_node.html @@ -176,7 +176,7 @@ - + {% if can_edit_pages %} {% if page.mirroring_pages.exists %} diff --git a/integreat_cms/cms/templates/pois/poi_list_row.html b/integreat_cms/cms/templates/pois/poi_list_row.html index 05db3ad3a2..9640071e2c 100644 --- a/integreat_cms/cms/templates/pois/poi_list_row.html +++ b/integreat_cms/cms/templates/pois/poi_list_row.html @@ -140,10 +140,20 @@ {% endif %} {% if perms.cms.change_poi %} {% if poi.is_used %} + + + {% else %} + + + - + - - - - - - - - - - - - - - - - - {% elif can_edit %} diff --git a/integreat_cms/cms/views/content_version_view.py b/integreat_cms/cms/views/content_version_view.py index 3f3e583794..3bf38471a0 100644 --- a/integreat_cms/cms/views/content_version_view.py +++ b/integreat_cms/cms/views/content_version_view.py @@ -13,6 +13,7 @@ from django.views.generic.detail import SingleObjectMixin from ..constants import status +from ..models import Event if TYPE_CHECKING: from typing import Any @@ -274,6 +275,24 @@ def post( :return: The rendered template response """ + if self.model is Event and self.get_object().external_calendar: + logger.info( + "%s %s can not change its status as it was imported from an external calendar", + self.model_name, + self.get_object(), + ) + + messages.info( + request, + _( + "%s %s can not change its status as it was imported from an external calendar" + ) + % ( + self.model_name, + self.get_object(), + ), + ) + return redirect(self.versions_url) if desired_status := request.POST.get("status"): try: diff --git a/integreat_cms/locale/de/LC_MESSAGES/django.po b/integreat_cms/locale/de/LC_MESSAGES/django.po index 8331315274..5ca752db97 100644 --- a/integreat_cms/locale/de/LC_MESSAGES/django.po +++ b/integreat_cms/locale/de/LC_MESSAGES/django.po @@ -5532,6 +5532,10 @@ msgstr "Diese Übersetzung wird nicht in den Apps angezeigt" msgid "Minor edit" msgstr "Geringfügige Änderung" +#: cms/templates/content_versions.html +msgid "The status of imported events can't be changed" +msgstr "Der Status von importierten Veranstaltungen kann nicht geändert werden" + #: cms/templates/content_versions.html msgid "Discard auto save" msgstr "Automatische Speicherung verwerfen" @@ -9228,6 +9232,14 @@ msgstr "Link zum {}" msgid "The version {} does not exist." msgstr "Die Version {} existiert nicht." +#: cms/views/content_version_view.py +#, python-format +msgid "" +"%s %s can not change its status as it was imported from an external calendar" +msgstr "" +"Der Status von %s %s kann nicht geändert " +"werden, da diese Veranstaltung aus einem externen Kalender importiert wurde" + #: cms/views/content_version_view.py msgid "You cannot reject changes if there is no version to return to." msgstr "" From e56db91e90ce54ba98ffab5455710386d0e78e18 Mon Sep 17 00:00:00 2001 From: Sven Seeberg Date: Sat, 7 Dec 2024 12:47:50 +0100 Subject: [PATCH 6/8] Add timeout setting for Integreat chat --- integreat_cms/api/v3/chat/utils/chat_bot.py | 6 ++++-- integreat_cms/core/settings.py | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/integreat_cms/api/v3/chat/utils/chat_bot.py b/integreat_cms/api/v3/chat/utils/chat_bot.py index 146bb5a1f4..dddd251650 100644 --- a/integreat_cms/api/v3/chat/utils/chat_bot.py +++ b/integreat_cms/api/v3/chat/utils/chat_bot.py @@ -42,7 +42,7 @@ def automatic_answer(message: str, region: Region, language_slug: str) -> str | f"https://{settings.INTEGREAT_CHAT_BACK_END_DOMAIN}/chatanswers/extract_answer/" ) body = {"message": message, "language": language_slug, "region": region.slug} - r = requests.post(url, json=body, timeout=120) + r = requests.post(url, json=body, timeout=settings.INTEGREAT_CHAT_BACK_END_TIMEOUT) return format_message(r.json()) @@ -58,7 +58,9 @@ def automatic_translation( "source_language": source_language_slug, "target_language": target_language_slug, } - response = requests.post(url, json=body, timeout=120).json() + response = requests.post( + url, json=body, timeout=settings.INTEGREAT_CHAT_BACK_END_TIMEOUT + ).json() if "status" in response and response["status"] == "success": return response["translation"] raise ValueError("Did not receive success response for translation request.") diff --git a/integreat_cms/core/settings.py b/integreat_cms/core/settings.py index dabcb0a3b3..074f5e2601 100644 --- a/integreat_cms/core/settings.py +++ b/integreat_cms/core/settings.py @@ -1339,7 +1339,14 @@ USER_CHAT_TICKET_GROUP: Final[str] = "integreat-chat" #: Integreat Chat (app) backend server domain -INTEGREAT_CHAT_BACK_END_DOMAIN = "igchat-inference.tuerantuer.org" +INTEGREAT_CHAT_BACK_END_DOMAIN = os.environ.get( + "INTEGREAT_CMS_INTEGREAT_CHAT_BACK_END_DOMAIN", "igchat-inference.tuerantuer.org" +) + +#: Integreat Chat (app) backend timeout +INTEGREAT_CHAT_BACK_END_TIMEOUT = os.environ.get( + "INTEGREAT_CMS_INTEGREAT_CHAT_BACK_END_TIMEOUT", 300 +) ########## # CELERY # From 91ad98073644807b3ca28dfbc4395d28343a58b7 Mon Sep 17 00:00:00 2001 From: charludo Date: Tue, 10 Dec 2024 07:22:21 +0100 Subject: [PATCH 7/8] Fix sudden ruff complaint --- integreat_cms/core/wsgi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integreat_cms/core/wsgi.py b/integreat_cms/core/wsgi.py index ab4a129d72..f4eca56600 100644 --- a/integreat_cms/core/wsgi.py +++ b/integreat_cms/core/wsgi.py @@ -40,9 +40,9 @@ def application(environ: dict[str, str], start_response: Callable) -> WSGIHandle os.environ.setdefault(f"INTEGREAT_CMS_{KEY.upper()}", VALUE) # Read config from environment - for key in environ: + for key, value in environ.items(): if key.startswith("INTEGREAT_CMS_"): - os.environ[key] = environ[key] + os.environ[key] = value _application = get_wsgi_application() From 1cbf7cd2c33d030a1516ae2491fdaa884bbb9cd0 Mon Sep 17 00:00:00 2001 From: MizukiTemma Date: Mon, 2 Dec 2024 11:48:03 +0100 Subject: [PATCH 8/8] Adjust link type wording --- integreat_cms/cms/constants/linkcheck.py | 2 +- .../analytics/_broken_links_widget.html | 4 +- .../templates/linkcheck/links_by_filter.html | 6 +-- .../views/linkcheck/linkcheck_list_view.py | 6 ++- integreat_cms/locale/de/LC_MESSAGES/django.po | 39 +++++++++---------- 5 files changed, 29 insertions(+), 28 deletions(-) diff --git a/integreat_cms/cms/constants/linkcheck.py b/integreat_cms/cms/constants/linkcheck.py index 9348c195a6..b9cb918392 100644 --- a/integreat_cms/cms/constants/linkcheck.py +++ b/integreat_cms/cms/constants/linkcheck.py @@ -26,5 +26,5 @@ ("external", _("External links")), ("mailto", _("Email links")), ("phone", _("Phone links")), - ("invalid", _("Invalid links")), + ("invalid", _("Verification needed")), ] diff --git a/integreat_cms/cms/templates/analytics/_broken_links_widget.html b/integreat_cms/cms/templates/analytics/_broken_links_widget.html index 4b4e19c0db..574d341542 100644 --- a/integreat_cms/cms/templates/analytics/_broken_links_widget.html +++ b/integreat_cms/cms/templates/analytics/_broken_links_widget.html @@ -31,7 +31,7 @@ - {% translate "Invalid links" %} + {% translate "Verification needed" %} @@ -45,7 +45,7 @@ - {% translate "Ignored links" %} + {% translate "Link verified" %} diff --git a/integreat_cms/cms/templates/linkcheck/links_by_filter.html b/integreat_cms/cms/templates/linkcheck/links_by_filter.html index 3fed65fd19..9d7868c311 100644 --- a/integreat_cms/cms/templates/linkcheck/links_by_filter.html +++ b/integreat_cms/cms/templates/linkcheck/links_by_filter.html @@ -13,7 +13,7 @@

{% elif view.kwargs.url_filter == 'unchecked' %} {% translate "Unchecked links" %} {% elif view.kwargs.url_filter == 'ignored' %} - {% translate "Ignored links" %} + {% translate "Link verified" %} {% elif LINKCHECK_EMAIL_ENABLED and view.kwargs.url_filter == 'email' %} {% translate "Email links" %} {% elif LINKCHECK_PHONE_ENABLED and view.kwargs.url_filter == 'phone' %} @@ -143,7 +143,7 @@

{% if view.kwargs.url_filter == 'valid' %} {% translate "No valid links could be found." %} {% elif view.kwargs.url_filter == 'invalid' %} - {% translate "No invalid links could be found." %} + {% translate "No links needing verification could be found." %} {% elif view.kwargs.url_filter == 'unchecked' %} {% translate "No unchecked links could be found." %} {% elif LINKCHECK_EMAIL_ENABLED and view.kwargs.url_filter == 'email' %} @@ -151,7 +151,7 @@

{% elif LINKCHECK_PHONE_ENABLED and view.kwargs.url_filter == 'phone' %} {% translate "No phone links could be found." %} {% else %} - {% translate "No ignored links could be found." %} + {% translate "No verified links could be found." %} {% endif %} diff --git a/integreat_cms/cms/views/linkcheck/linkcheck_list_view.py b/integreat_cms/cms/views/linkcheck/linkcheck_list_view.py index ba26443f6e..0d0489a9cf 100644 --- a/integreat_cms/cms/views/linkcheck/linkcheck_list_view.py +++ b/integreat_cms/cms/views/linkcheck/linkcheck_list_view.py @@ -206,7 +206,9 @@ def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: else url.links.all() ) Link.objects.filter(id__in=link_ids).update(ignore=True) - messages.success(request, _("Links were successfully ignored")) + messages.success( + request, _("Links were successfully marked as verified") + ) elif action == "unignore": for url in selected_urls: link_ids = ( @@ -215,7 +217,7 @@ def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: else url.links.all() ) Link.objects.filter(id__in=link_ids).update(ignore=False) - messages.success(request, _("Links were successfully unignored")) + messages.success(request, _("Verification was revoked for the links")) elif action == "recheck": for url in selected_urls: url.check_url(external_recheck_interval=0) diff --git a/integreat_cms/locale/de/LC_MESSAGES/django.po b/integreat_cms/locale/de/LC_MESSAGES/django.po index 5ca752db97..8312166ea4 100644 --- a/integreat_cms/locale/de/LC_MESSAGES/django.po +++ b/integreat_cms/locale/de/LC_MESSAGES/django.po @@ -1445,8 +1445,9 @@ msgid "Phone links" msgstr "Telefonnummern-Links" #: cms/constants/linkcheck.py cms/templates/analytics/_broken_links_widget.html -msgid "Invalid links" -msgstr "Ungültige Links" +#: cms/templates/linkcheck/links_by_filter.html +msgid "Verification needed" +msgstr "Überprüfung notwendig" #: cms/constants/machine_translation_permissions.py msgid "No" @@ -5014,8 +5015,8 @@ msgstr "Gültige Links" #: cms/templates/analytics/_broken_links_widget.html #: cms/templates/linkcheck/links_by_filter.html -msgid "Ignored links" -msgstr "Ignorierte Links" +msgid "Link verified" +msgstr "Link überprüft" #: cms/templates/analytics/_broken_links_widget.html #: cms/templates/linkcheck/links_by_filter.html @@ -6800,18 +6801,10 @@ msgstr "Suchen & Ersetzen" msgid "Valid" msgstr "Gültig" -#: cms/templates/linkcheck/links_by_filter.html -msgid "Verification needed" -msgstr "Überprüfung notwendig" - #: cms/templates/linkcheck/links_by_filter.html msgid "Unchecked" msgstr "Nicht geprüft" -#: cms/templates/linkcheck/links_by_filter.html -msgid "Link verified" -msgstr "Link überprüft" - #: cms/templates/linkcheck/links_by_filter.html msgid "" "SSL is the standard technology for securing Internet connections and " @@ -6882,8 +6875,8 @@ msgid "No valid links could be found." msgstr "Es konnten keine gültigen Links gefunden werden." #: cms/templates/linkcheck/links_by_filter.html -msgid "No invalid links could be found." -msgstr "Es konnten keine ungültigen Links gefunden werden." +msgid "No links needing verification could be found." +msgstr "Es konnten keine zu überprüfenden Links gefunden werden." #: cms/templates/linkcheck/links_by_filter.html msgid "No unchecked links could be found." @@ -6898,8 +6891,8 @@ msgid "No phone links could be found." msgstr "Es konnten keine Telefonnummern-Links gefunden werden." #: cms/templates/linkcheck/links_by_filter.html -msgid "No ignored links could be found." -msgstr "Es konnten keine ignorierten Links gefunden werden." +msgid "No verified links could be found." +msgstr "Es konnten keine überprüften Links gefunden werden." #: cms/templates/linkcheck/links_by_filter.html msgid "Links selected" @@ -9615,12 +9608,12 @@ msgid "URL was successfully replaced" msgstr "URL wurde erfolgreich ersetzt" #: cms/views/linkcheck/linkcheck_list_view.py -msgid "Links were successfully ignored" -msgstr "Links wurden erfolgreich ignoriert" +msgid "Links were successfully marked as verified" +msgstr "Links wurden erfolgreich als überprüft markiert" #: cms/views/linkcheck/linkcheck_list_view.py -msgid "Links were successfully unignored" -msgstr "Links werden nicht mehr ignoriert" +msgid "Verification was revoked for the links" +msgstr "Verifizierung wurde für die Links entzogen" #: cms/views/linkcheck/linkcheck_list_view.py msgid "Links were successfully checked" @@ -11158,6 +11151,12 @@ msgstr "" "Diese Seite konnte nicht importiert werden, da sie zu einer anderen Region " "gehört ({})." +#~ msgid "Invalid links" +#~ msgstr "Ungültige Links" + +#~ msgid "Ignored links" +#~ msgstr "Ignorierte Links" + #~ msgid "Invalid" #~ msgstr "Ungültig"