From bb2809660fdff9a84904b39a78d26d36c850ec18 Mon Sep 17 00:00:00 2001 From: MizukiTemma Date: Fri, 5 Jul 2024 22:36:04 +0200 Subject: [PATCH] Add centralised link list in the network management Co-authored-by: David Venhoff Co-authored-by: Peter Nerlich --- integreat_cms/cms/templates/_base.html | 7 ++ .../templates/linkcheck/link_list_row.html | 37 ++++---- .../templates/linkcheck/links_by_filter.html | 24 ++--- .../cms/templatetags/linkcheck_filters.py | 1 + integreat_cms/cms/templatetags/url_tags.py | 20 +++++ integreat_cms/cms/urls/protected.py | 34 ++++++++ integreat_cms/cms/utils/linkcheck_utils.py | 13 ++- .../cms/views/linkcheck/link_replace_view.py | 10 ++- .../views/linkcheck/linkcheck_list_view.py | 87 +++++++++---------- integreat_cms/locale/de/LC_MESSAGES/django.po | 8 +- .../release_notes/current/unreleased/1443.yml | 2 + 11 files changed, 162 insertions(+), 81 deletions(-) create mode 100644 integreat_cms/release_notes/current/unreleased/1443.yml diff --git a/integreat_cms/cms/templates/_base.html b/integreat_cms/cms/templates/_base.html index b033fbc9ac..67ed8a5b3c 100644 --- a/integreat_cms/cms/templates/_base.html +++ b/integreat_cms/cms/templates/_base.html @@ -269,6 +269,13 @@ {% translate "Admin Dashboard" %} + {% if perms.cms.view_broken_links %} + + + {% translate "Broken Links" %} + + {% endif %} {% if perms.cms.view_region %} diff --git a/integreat_cms/cms/templates/linkcheck/link_list_row.html b/integreat_cms/cms/templates/linkcheck/link_list_row.html index 256038cf54..f9e2aa77d3 100644 --- a/integreat_cms/cms/templates/linkcheck/link_list_row.html +++ b/integreat_cms/cms/templates/linkcheck/link_list_row.html @@ -4,7 +4,8 @@ {% load model_tags %} {% load widget_tweaks %} {% load linkcheck_filters %} -{% object_translation_has_view_perm request.user url.region_links.0.content_object as show_source_link %} +{% load url_tags %} +{% object_translation_has_view_perm request.user content_object as show_source_link %} @@ -65,28 +66,30 @@ - -
- {{ url.region_links.0.text }} - - - - -
- + {% with link_text=url.region_links.0.text %} + +
+ {{ link_text }} + + + + +
+ + {% endwith %}
{% spaceless %} {% if show_source_link %} - - {{ url.region_links.0.content_object.title }} + {{ content_object.title }} {% else %} - {{ url.region_links.0.content_object.title }} + {{ content_object.title }} {% endif %} {% endspaceless %} @@ -100,8 +103,8 @@ {{ url.region_links|length }} - @@ -112,7 +115,7 @@
{% render_field edit_url_form.url|add_error_class:"border-red-500" type="url" form="edit-url-form" %} - {% translate "Cancel" %}