{% comment %} Expects these variables: newsitem_list, hidden_schema_list, show_upcoming, is_latest_page {% endcomment %} {% load eb eb_filter mapping humanize dateutils %} {% if newsitem_list %} {% regroup newsitem_list by item_date|friendlydate as newsitem_list_byday %} {% for daygroup in newsitem_list_byday %}

{% if not show_upcoming %}New{% endif %} {{ daygroup.grouper }}

{% regroup daygroup.list by schema as newsitem_list_byschema %} {% for schemagroup in newsitem_list_byschema %} {% with schemagroup.list|length as num_newsitems %} {% with hidden_schema_list|contains:schemagroup.grouper as is_hidden %}

{% map_icon_img schemagroup.grouper %} {% if schemagroup.grouper.is_special_report %}Special report: {{ schemagroup.grouper.name }}{% else %}{{ num_newsitems }} {% schema_plural_name schemagroup.grouper num_newsitems %}{% endif %} {% if USER %}{% endif %}

{% endwith %} {% endwith %} {% endfor %} {% endfor %} {% if has_next or has_previous %}

Items {{ page_start_index|intcomma }}-{{ page_end_index|intcomma }} (Page {{ page_number|intcomma }})

{% endif %} {% else %}

We haven't found any {% if show_upcoming %}events {% else %} news {% endif %} available for this area recently.

{% endif %}