From 4c0eb87c254673ec09b8379b5558c0e3dd0f1f41 Mon Sep 17 00:00:00 2001 From: Hendrik L Date: Thu, 4 Jul 2024 14:26:18 +0200 Subject: [PATCH] cleanup, add macro render_communityname --- app/templates/admin/communities.html | 6 ++---- app/templates/base.html | 10 ++++++++++ app/templates/community/add_remote.html | 3 +-- app/templates/community/community.html | 4 +--- app/templates/community/lookup_remote.html | 3 +-- app/templates/index.html | 4 +--- app/templates/post/post.html | 4 +--- app/templates/search/results.html | 4 +--- app/templates/topic/show_topic.html | 4 +--- app/templates/user/notifications.html | 4 ++-- app/templates/user/show_profile.html | 4 ++-- 11 files changed, 23 insertions(+), 27 deletions(-) diff --git a/app/templates/admin/communities.html b/app/templates/admin/communities.html index af65ec8f..07eaa64a 100644 --- a/app/templates/admin/communities.html +++ b/app/templates/admin/communities.html @@ -31,9 +31,7 @@ {% for community in communities.items %} {{ community.name }} - - - {{ community.display_name() }}{% if community.banned %} (banned){% endif %} + {{ render_communityname(community) }}{% if community.banned %} (banned){% endif %} {{ community.topic.name }} {{ community.post_count }} {{ '✓'|safe if community.show_home else '✗'|safe }} @@ -67,4 +65,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/app/templates/base.html b/app/templates/base.html index 77b984ba..f1dc6102 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -26,6 +26,16 @@ {% endif -%} {% endmacro -%} +{% macro render_communityname(community) -%} + + + {% if community.icon_id and not low_bandwidth and not collapsed -%} + + {% endif -%} + c/{{ community.display_name() }} + + +{% endmacro -%} diff --git a/app/templates/community/add_remote.html b/app/templates/community/add_remote.html index f756d0b3..3e61544a 100644 --- a/app/templates/community/add_remote.html +++ b/app/templates/community/add_remote.html @@ -25,8 +25,7 @@
{{ _('Found a community:') }}

- - {{ new_community.title }}@{{ new_community.ap_domain }} + {{ render_communityname(new_community) }}

{% if subscribed %} {{ _('Leave') }} diff --git a/app/templates/community/community.html b/app/templates/community/community.html index 28cb16cf..38b6b8f4 100644 --- a/app/templates/community/community.html +++ b/app/templates/community/community.html @@ -170,9 +170,7 @@

diff --git a/app/templates/community/lookup_remote.html b/app/templates/community/lookup_remote.html index 074204da..08fd524e 100644 --- a/app/templates/community/lookup_remote.html +++ b/app/templates/community/lookup_remote.html @@ -14,8 +14,7 @@
{{ _('Found a community:') }}

- - {{ new_community.title }}@{{ new_community.ap_domain }} + {{ render_communityname(new_community) }}

{% if subscribed %} {{ _('Leave') }} diff --git a/app/templates/index.html b/app/templates/index.html index 23b326b6..2e8798bf 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -53,9 +53,7 @@

diff --git a/app/templates/post/post.html b/app/templates/post/post.html index e14c3aa3..5af93bf1 100644 --- a/app/templates/post/post.html +++ b/app/templates/post/post.html @@ -193,9 +193,7 @@ diff --git a/app/templates/search/results.html b/app/templates/search/results.html index bced2814..95f5bfdd 100644 --- a/app/templates/search/results.html +++ b/app/templates/search/results.html @@ -51,9 +51,7 @@ diff --git a/app/templates/topic/show_topic.html b/app/templates/topic/show_topic.html index de8761fd..b41b5b1a 100644 --- a/app/templates/topic/show_topic.html +++ b/app/templates/topic/show_topic.html @@ -92,9 +92,7 @@ diff --git a/app/templates/user/notifications.html b/app/templates/user/notifications.html index 3df7c3a4..a6596542 100644 --- a/app/templates/user/notifications.html +++ b/app/templates/user/notifications.html @@ -71,7 +71,7 @@ @@ -81,7 +81,7 @@ diff --git a/app/templates/user/show_profile.html b/app/templates/user/show_profile.html index 6caedee6..7d9ec758 100644 --- a/app/templates/user/show_profile.html +++ b/app/templates/user/show_profile.html @@ -171,7 +171,7 @@ @@ -181,7 +181,7 @@