{%- macro plural(value, suffix='s') -%} {%- if value != 1 -%} {{suffix}} {%- endif -%} {%- endmacro -%} {%- macro random_image(path) -%} {{- "/" ~ path ~ "/" ~ listdir('files/' ~ path)|random() ~ '?x=2' }} {%- 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 and not p.ghost %}{% endif %} {% if p.private %}Draft{% endif %} {% if p.active_flags(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}} {% endmacro %} {% macro file_input(id, image_only, disabled) %} {% endmacro %} {% macro comment_reply_box(target_fullname, html_id, wrapper_css_classes="", subwrapper_css_classes="", hide="", allow_file_upload=true, enable_cancel_button=true) %}
{% if v %}
{% if allow_file_upload %} {{file_input('file-upload-reply-' ~ target_fullname, False)}} {% 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) %} {# 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) %} {% if request.referrer and request.referrer.split('?')[0] == request.base_url %}
{{msg}}
{% endif %} {% endmacro %} {% macro flags(i) %} {% if i.active_flags(v) %}
Reported by:
{% endif %} {% endmacro %}