From 8719c057ee2e9441088a4beda0db4e17fbf71b1a Mon Sep 17 00:00:00 2001 From: gooseman <16601315+geese-suck@users.noreply.github.com> Date: Sat, 19 Nov 2022 11:54:07 -0800 Subject: [PATCH] de-doooplicate post meta luv u aevann --- files/templates/submission.html | 78 +--------------------- files/templates/submission_listing.html | 88 +------------------------ files/templates/util/macros.html | 84 +++++++++++++++++++++++ 3 files changed, 88 insertions(+), 162 deletions(-) diff --git a/files/templates/submission.html b/files/templates/submission.html index 23e7f3b501..bac92f58e8 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -86,83 +86,7 @@
- {% if p.sub %} - {% if not HOLE_STYLE_FLAIR -%} - /h/{{p.sub}} - {%- else -%} - {{p.sub|capitalize}} - {%- endif %} - {% endif %} - - {% if p.sub and p.author.exiled_from(p.sub) %} - - {% endif %} - - {% if p.bannedfor %} - - {% endif %} - - {% if p.chuddedfor %} - - {% endif %} - - {% for a in p.awards %} - - {% endfor %} - - {% if v and v.admin_level >= PERMS['USER_SHADOWBAN'] and p.author.shadowbanned %}{% endif %} - - {% if p.stickied %} - - {% endif %} - - {% if p.hole_pinned %} - - {% endif %} - - {% if p.is_pinned %}{% endif %} - {% if p.distinguish_level %} {% endif %} - {% if p.is_bot %} {% endif %} - {% if p.over_18 %}+18{% endif %} - {% if p.private %}Draft{% endif %} - {% if p.active_flags(v) %}{% endif %} - - {% if p.ghost %} - 👻 - {% else %} - {% if FEATURES['PATRON_ICONS'] and p.author.patron %} - {{p.author.patron_tooltip}} - {% endif %} - - {% if FEATURES['HOUSES'] and p.author.house %} - House {{p.author.house}} - {% endif %} - - {% if p.author.verified %} - {% endif %} - -
- - {% if p.author.hat_active -%} - - {%- endif %} -
- {{p.author_name}} -
- {% if FEATURES['PRONOUNS'] %} - {{p.author.pronouns}} - {% endif %} - {% if p.author.customtitle %} -   {{p.author.customtitle | safe}} - {% endif %} - {% endif %} -  {{p.age_string}} - ({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.is_audio %}audio post{% elif p.domain %}{% else %}text post{% endif %}) - - {% if p.edited_utc %} - Edited {{p.edited_string}} - {% endif %} - {{p.views}} thread views + {{ macros.post_meta(p) }}
{% if p.active_flags(v) %}
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 74c0095c70..e480c6bd78 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -111,93 +111,11 @@
- -
{% if p.club %}{{CC}}{% endif %} diff --git a/files/templates/util/macros.html b/files/templates/util/macros.html index ebf36255ec..5dcc0e4746 100644 --- a/files/templates/util/macros.html +++ b/files/templates/util/macros.html @@ -25,3 +25,87 @@ {% set path = "assets/images/" + SITE_NAME + "/" + assetdir %} {{ "/" + path + "/" + listdir('files/' + path)|random() + '?v=45' }} {% endmacro -%} + +{% macro post_meta(p) %} + {% if p.sub %} + {% if not HOLE_STYLE_FLAIR -%} + /h/{{p.sub}} + {%- else -%} + {{p.sub|capitalize}} + {%- endif %} + {% endif %} + + {% if p.sub and p.author.exiled_from(p.sub) %} + + {% endif %} + + {% if p.bannedfor %} + + {% endif %} + + {% if p.chuddedfor %} + + {% endif %} + + {% for a in p.awards %} + + {% endfor %} + + {% if v and v.admin_level >= PERMS['USER_SHADOWBAN'] and p.author.shadowbanned %} + + {% endif %} + + {% if p.stickied %} + + {% endif %} + + {% if p.hole_pinned %} + + {% endif %} + + {% if p.distinguish_level %}{% endif %} + {% if p.is_pinned and request.path != '/' %}{% endif %} + {% if p.over_18 %}+18{% endif %} + {% if p.is_bot %} {% endif %} + {% if p.is_blocking and not p.ghost %}{% endif %} + {% if p.is_blocked %}{% endif %} + {% if p.private %}Draft{% endif %} + {% if p.active_flags(v) %}{% endif %} + + {% if p.ghost %} + 👻 + {% else %} + {% if FEATURES['PATRON_ICONS'] and p.author.patron %} + {{p.author.patron_tooltip}} + {% endif %} + + {% if FEATURES['HOUSES'] and p.author.house %} + House {{p.author.house}} + {% endif %} + + {% if p.author.verified %} + {% endif %} + +
+ + {% if p.author.hat_active -%} + + {%- endif %} +
+ {{p.author_name}} +
+ {% if FEATURES['PRONOUNS'] %} + {{p.author.pronouns}} + {% endif %} + {% if p.author.customtitle %} + {{p.author.customtitle | safe}} + {% endif %} + {% endif %} +  {{p.age_string}} +   + ({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.is_audio %}audio post{% elif p.domain %}{% else %}text post{% endif %}) + {% if p.edited_utc %} + Edited {{p.edited_string}} + {% endif %} + {{p.views}} thread views +{% endmacro %}