{% extends 'base.html' %} {% load custom_filters %} {% block content %}
最初活动

{{ earliest_act.branch }}{{ earliest_act.name }}

{{ earliest_act.description }}

{{ earliest_act.start_time|format_chinese_full_date }}
最后活动

{{ latest_act.branch }}{{ latest_act.name }}

{{ latest_act.description }}

{{ latest_act.start_time|format_chinese_full_date }}

分支机构活动统计

{% for item in branches %} {% endfor %}
分支机构名称 (新建-搬迁-装修)
活动总数
进行中
{{ item.branch.name }} {{ item.total_count }} {{ item.onging_count }}
总计 ({{ total_branch_count }} 个分支机构)
{{ total_activities }} {{ ongoing_activities_count }}

事件列表 {{ ongoing_events|length }} 个事件

{% for event in ongoing_events %}

{{ event.name }}{% if not event.end_time %}进行中{% endif %}

{{ event.description }}

{{ event.start_time|date:"Y年m月d日" }} {% if event.end_time %} {{ event.end_time|date:"Y年m月d日" }} {% endif %}
{% with branch_count=event.branches.count %} {% if branch_count == all_branch_count %} 涉及:全辖分支机构 {% elif branch_count == 1 %} 涉及:{{ event.branches.first.name }} {% elif branch_count > 1 %} 涉及:{{ event.branches.all.0.name }}、{{ event.branches.all.1.name }}等{{ branch_count }}个营业部 {% else %} 涉及:暂无 {% endif %} {% endwith %}
{% empty %}
暂无事件
{% endfor %}

进行中的活动 {{ ongoing_activities|length }} 个活动

{% for huodong in ongoing_activities %}
{{ huodong.branch }}

{{ huodong.name }}

未完成

{{ huodong.description }}

开始时间:{{ huodong.start_time|date:"Y年m月d日" }}
{% empty %}
暂无进行中的活动
{% endfor %}
{% for scope, scope_data in grouped_activities.items %}

今年的{{ scope }} {{ scope_data.branch_count }} 个分支机构

{% for activity in scope_data.activities %}
{% if not activity.end_time %} {% else %} {% endif %}
{{ activity.branch }}

{{ activity.name }}

{% if not activity.end_time %} 未完成 {% endif %}

{{ activity.description }}

{{ activity.start_time|date:"Y年m月d日" }} {% if activity.end_time %} {{ activity.end_time|date:"Y年m月d日" }} {% endif %}
{% empty %}
暂无活动
{% endfor %}
{% endfor %}

今年统计

{% for scope, scope_data in grouped_activities.items %} {{ scope }} {{ scope_data.branch_count }}个 {% endfor %}

历年活动统计

{% for year in historical_years %} {% with year_data=historical_grouped_activities|get_item:year %} {% if year_data %}

{{ year }} 年统计

{% for scope, scope_data in year_data.items %} {{ scope }} {{ scope_data.branch_count }}个 {% endfor %}
{% endif %} {% endwith %} {% endfor %}
{% endblock %}