From e4d915338ade57ec34dd81b2654d3be6f88d6af4 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:19:51 +1300 Subject: [PATCH] reduce duplication in teasers #377 --- app/templates/post/post_teaser/_article.html | 14 +---------- app/templates/post/post_teaser/_image.html | 17 +------------ app/templates/post/post_teaser/_link.html | 20 +--------------- app/templates/post/post_teaser/_poll.html | 20 +++++----------- app/templates/post/post_teaser/_title.html | 25 ++++++++++++++++++++ app/templates/post/post_teaser/_video.html | 22 +---------------- 6 files changed, 35 insertions(+), 83 deletions(-) create mode 100644 app/templates/post/post_teaser/_title.html diff --git a/app/templates/post/post_teaser/_article.html b/app/templates/post/post_teaser/_article.html index 70f3fc55..f5c07503 100644 --- a/app/templates/post/post_teaser/_article.html +++ b/app/templates/post/post_teaser/_article.html @@ -1,17 +1,5 @@
-

{% if post.sticky -%}{% endif -%} - {% if post.nsfw -%}nsfw{% endif -%} - {% if post.nsfl -%}nsfl{% endif -%} - {% if post.reports > 0 and current_user.is_authenticated and post.community.is_moderator(current_user) -%} - - {% endif -%} - {% if post.sticky -%}{% endif -%} - {% if post.deleted -%}{% endif -%} -

- {% if show_post_community -%} - {% if post.community.icon_id and not low_bandwidth %}Community icon{% endif -%} - c/{{ post.community.name }}{% endif -%} - by {{ render_username(post.author) }} + {% include "post/post_teaser/_title.html" %} {% if post.body_html -%}
{{ first_paragraph(post.body_html) | safe }} diff --git a/app/templates/post/post_teaser/_image.html b/app/templates/post/post_teaser/_image.html index e45a97dc..755f88b7 100644 --- a/app/templates/post/post_teaser/_image.html +++ b/app/templates/post/post_teaser/_image.html @@ -1,20 +1,5 @@