{% from 'message_box.html' import message_box %} {% macro _hidden_events_block(class, category, events_by_month, format_event_date, is_recent, happening_now, before=none, after=none, message_first=true) %} {% set message=caller() %} {% macro render_message() %} {% call message_box('info', icon=false) %}
{{ message }} {% trans %}Show{% endtrans %} {{ message }} {% trans %}Hide{% endtrans %}
{% endcall %} {% endmacro %} {% macro render_list() %}
{%- if events_by_month -%} {{ event_list_block(events_by_month, format_event_date, is_recent, happening_now) }} {%- endif -%}
{% endmacro %}
{% if message_first %} {{ render_message() }} {{ render_list() }} {% else %} {{ render_list() }} {{ render_message() }} {% endif %}
{% endmacro %} {% macro event_list(events_by_month, format_event_date, is_recent, happening_now, category, future_event_count, past_event_count, future_threshold, past_threshold, future_events_by_month=[], past_events_by_month=[], show_past_events=false) %}
{% if future_event_count %} {% call _hidden_events_block('future-events', category, future_events_by_month, format_event_date, is_recent, happening_now, after=future_threshold) %} {% trans count=future_event_count -%} There is one event in the future. {%- pluralize -%} There are {{ count }} events in the future. {%- endtrans %} {% endcall %} {% endif %}
{{ event_list_block(events_by_month, format_event_date, is_recent, happening_now) }}
{% if past_event_count %} {% call _hidden_events_block('past-events', category, past_events_by_month, format_event_date, is_recent, happening_now, before=past_threshold, message_first=false) %} {% trans count=past_event_count -%} There is one event in the past. {%- pluralize -%} There are {{ count }} events in the past. {%- endtrans %} {% endcall %} {% endif %}
{% endmacro %} {% macro event_list_block(events_by_month, format_event_date, is_recent, happening_now) %} {% for month in events_by_month %}

{{ month.name }}

{% endfor %} {% endmacro %}