{%- macro plural(value, suffix='s') -%} {%- if value != 1 -%} {{suffix}} {%- endif -%} {%- endmacro -%} {%- macro banner(src, href, alt, expand, class) %} {{alt|default('site banner')}} {% endmacro -%} {%- macro live_banner() -%} {% set path = "files/assets/images/" ~ SITE_NAME %} {% if SITE_NAME == 'rDrama' %} {{ random_image("assets/images/" ~ SITE_NAME ~ "/banners-event/2023-newyear") -}} {%- elif not v and os_path.exists(path ~ "/cached.webp") -%} {{ 'cached.webp' | asset_siteimg -}} {% elif os_path.exists(path ~ "/banners") -%} {{ random_image("assets/images/" ~ SITE_NAME ~ "/banners") -}} {% else -%} {{ 'banner.webp' | asset_siteimg -}} {% endif %} {%- endmacro -%} {%- macro random_image(path) -%} {{- "/" ~ 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(v)[0] -%} {%- 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 %}{{p.domain|truncate(50, True)}}{% else %}text post{% endif %}) {% if p.edited_utc %} Edited {{p.edited_string}} {% endif %} {{p.views}} thread views {% 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 %} {% 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) %}
{{msg}}
{% endmacro %}