{%- macro plural(value, suffix='s') -%} {%- if value != 1 -%} {{suffix}} {%- endif -%} {%- endmacro -%} {%- macro random_image(path) -%} {{- SITE_FULL_IMAGES ~ "/" ~ path ~ "/" ~ listdir('files/' ~ path)|random() ~ '?x=6' -}} {%- 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.exiler_username(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 and not p.ghost %}{% endif %} {% if p.private %}Draft{% endif %} {% if p.active_reports(v) %}{% endif %} {% if p.ghost %} 👻 {% else %} {% if FEATURES['PATRON_ICONS'] and p.author.patron > 1 %} {{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}} {% endif %} {% if p.author.customtitle %} {{p.author.customtitle | 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 %} Edited {{p.edited_string}} {% endif %} {{p.views}} thread views   #{{p.id}} {% if p.ping_cost %} spent {{p.ping_cost}} currency on pings {% endif %} {% endmacro %} {% macro file_input(input_id, textarea_id, disabled) %}
{% endmacro %} {% macro comment_reply_box(target_fullname, html_id, wrapper_css_classes="", subwrapper_css_classes="", hide="", enable_cancel_button=true) %}
{% if v %}
{{file_input('file-upload-reply-' ~ target_fullname, 'reply-form-body-' ~ target_fullname, False)}} {% 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) %} {# TODO: use in saved (search for "fa-ghost" in source) #} {% 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 %}
{% if m %}{{m.time | timestamp}}{% else %}just now{% 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 %}
@:
{% endmacro %} {% macro chat_users_list() %}
Users Online
{% endmacro %}