{%- extends 'root.html' -%}
{% block body_attributes %}id="{% if request.path != '/comments' %}{% block pagetype %}frontpage{% endblock %}{% endif %}" class="has_header"{% endblock %}
{% block body %}
{% block banner %}
{% include "modals/expanded_image.html" %}
{% if err or '@' not in request.path %}
{% if IS_FISTMAS() and not sub %}
{% include 'events/fistmas/banner.html' %}
{% else %}
{% if err and SITE_NAME == 'rDrama' %}
{% set src = "banner_error.webp" | asset_siteimg %}
{% elif sub and sub.has_banners %}
{% set src = sub.random_banner() %}
{% set alt = ['/h/', sub, 'banner']|join %}
{% set class = 'site-banner-hole' %}
{% elif IS_EVENT() %}
{% set src = macros.random_image("assets/events/" ~ IS_EVENT() ~ "/images/banners") %}
{% elif SITE_NAME == "rDrama" %}
{% set href = "https://secure.transequality.org/site/Donation2?df_id=1480" %}
{% set expand = false %}
{% endif %}
{% if SITE_NAME == "WPD" %}
{% if sub %}
{% set href = "/h/" ~ sub %}
{% set expand = false %}
{% else %}
{% set href = "/" %}
{% set expand = false %}
{% endif %}
{% endif %}
{% if src %}
{% set banner_url = src %}
{% else %}
{% set path = "files/assets/images/" ~ SITE_NAME %}
{%- if not v and os_path.exists(path ~ "/cached.webp") -%}
{% set banner_url = 'cached.webp' | asset_siteimg %}
{% elif os_path.exists(path ~ "/banners") -%}
{% set banner_url = macros.random_image("assets/images/" ~ SITE_NAME ~ "/banners") %}
{% else -%}
{% set banner_url = 'banner.webp' | asset_siteimg %}
{% endif %}
{% endif %}
{% macro img_element() %}
{% endmacro %}
{% if sub and sub.has_banners %}
{{img_element()}}
{% else %}
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
{% include "header.html" %}
{% block mobileUserBanner %}{% endblock %}