{%- macro plural(value, suffix='s') -%} {%- if value != 1 -%} {{suffix}} {%- endif -%} {%- endmacro -%} {%- macro random_image(path) -%} {{- SITE_FULL_IMAGES ~ "/" ~ path ~ "/" ~ listdir('files/' ~ path)|seeded_random(p) ~ '?x=8' -}} {%- endmacro -%} {% macro post_meta(p) %} {% if p.hole %} {% if SITE_NAME == 'WPD' -%} {{p.hole|capitalize}} {%- else -%} /h/{{p.hole}} {%- endif %} {% endif %} {% if p.hole and p.author.exiler_username(p.hole) %} {% endif %} {% if p.bannedfor %} {% endif %} {% if p.chuddedfor %} {% endif %} {% for a in p.awards %} {% if a.kind in ["emoji","emoji-hz"] %} {{a.title}} Award given by @{{a.user.username}}: "{{a.note}}" {% else %} {% endif %} {% endfor %} {% with user = p.author %} {%- include 'admin/shadowbanned_tooltip.html' -%} {% endwith %} {% if p.pinned %} {% endif %} {% if p.hole_pinned %} {% endif %} {% if p.distinguished %} {% endif %} {% if p.profile_pinned and request.path != '/' %} {% endif %} {% if p.nsfw %} NSFW {% endif %} {% if p.is_bot %} {% endif %} {% if p.is_blocking and not p.ghost %} {% endif %} {% if p.is_blocked and not p.ghost %} {% endif %} {% if p.draft %} Draft {% endif %} {% if p.active_reports(v) %} {% endif %} {% if p.ghost %} 👻 {% else %} {% if FEATURES['PATRON_ICONS'] and p.author.patron > 1 and p.author.lifetimedonated_visible %} {{p.author.patron_tooltip}} {% endif %} {% if FEATURES['HOUSES'] and p.author.house %} House {{p.author.house}} {% endif %} {% if p.author.verified %} {% endif %}
@{{p.author.username}}'s profile picture {% if p.author.hat_active(v)[0] -%} @{{p.author.username}}'s hat {%- endif %}
{{p.author_name}}
{% if FEATURES['PRONOUNS'] %} {{p.author.pronouns_display}} {% endif %} {% if p.author.flair_html %} {{p.author.flair_html | safe}} {% endif %} {% endif %}  {{p.age_string}} {% if not p.deleted_utc %} ({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.is_audio %}audio post{% elif p.domain %}{{p.domain|truncate(50, True)}}{% else %}text post{% endif %}) {% endif %} {% if p.edited_utc %} {% if v and (v.id == p.author_id or v.admin_level >= PERMS['VIEW_VERSIONS']) %} Edited {{p.edited_string}} {% else %} Edited {{p.edited_string}} {% endif %} {% endif %} {{p.views}} thread views #{{p.id}} {% if p.ping_cost %} spent {{p.ping_cost}} currency on pings {% endif %} {% endmacro %} {% macro emoji_btn(textarea_id, previous_modal) %} {% endmacro %} {% macro gif_btn(textarea_id, previous_modal) %} {% endmacro %} {% macro file_btn(input_id, disabled, image_only) %} {% endmacro %} {% macro comment_reply_box(target_fullname, html_id, wrapper_css_classes="", subwrapper_css_classes="", hide="", enable_cancel_button=true) %}
{% if v %}
{{emoji_btn('reply-form-body-' ~ target_fullname)}} {{gif_btn('reply-form-body-' ~ target_fullname)}} {{file_btn('file-upload-reply-' ~ target_fullname)}}
{% if v.admin_level >= PERMS['ADMIN_NOTES'] and target_fullname.startswith('u_') %}
{% endif %} {% if enable_cancel_button %} {% endif %}
{% else %}
Jump in the discussion.

No email address required.

Sign up Sign in
{% endif %}
{% endmacro %} {% macro ghost_box(text1, text2, mode, extra_css) %} {% if mode == 1 %}
{% if text1 %}
{{text1|safe}}

{% endif %} {% if text2 %}

{{text2|safe}}

{% endif %}
{% elif mode == 2 %}

{{text1|safe}}

{% endif %} {% endmacro %} {% macro alert(msg, error=false) %}
{{msg}}
{% endmacro %} {% macro reports(i, kind) %} {% if i.active_reports(v) %}
Reported by:
{% endif %} {% endmacro %} {% macro chat_users_online() %}
0
{% endmacro %} {% macro chat_group_template(id, m) %}
{% if m %}{{m.username}}{% endif %}
{% endmacro %} {% macro chat_line_template(id, m, vlink) %} {% set quote_exists = m and m.quotes and messages.get(m.quotes) %} {% set mentioned = m and vlink in m.text_html or (quote_exists and messages[m.quotes].user_id == v.id) %}
{% if m %} {% if v.slurreplacer %} {{m.text_html_censored | safe}} {% else %} {{m.text_html | safe}} {% endif %} {% endif %} {%- if m -%} {%- if v.slurreplacer -%} {{m.text_censored}} {%- else -%} {{m.text}} {%- endif -%} {%- endif -%} {% if v.admin_level >= PERMS.POST_COMMENT_MODERATION %} {% endif %}
{% endmacro %} {% macro chat_window(vlink)%}
{% set messages_list = messages.items()|list %} {% for id, m in messages_list %} {% set same = loop.index > 1 and m.user_id == messages_list[loop.index-2][1].user_id %} {% if not same %} {% if loop.index > 1 %}
{% endif %} {{chat_group_template(id, m)}} {% endif %} {{chat_line_template(id, m, vlink)}} {% endfor %}
@:
{{emoji_btn('input-text-chat')}} {{gif_btn('input-text-chat')}} {{file_btn('file', False, True)}}
{% endmacro %} {% macro chat_users_list() %}
{% if SITE_NAME == 'WPD' %}
Chat Rules
{% endif %}
Users Online
{% endmacro %} {% macro time_filter_buttons() %} {% endmacro %} {% macro sorting_buttons(sorts, hot_allowed) %} {% endmacro %} {% macro pagination(classes="pl-1 mt-4") %} {% endmacro %}