{# app/templates/admin/dashboard.html (修改此文件) #} {% extends "dashboard_base.html" %} {% block dashboard_content %}

管理员仪表盘

概览系统中的所有数据条目与状态

新增数据
{% for entry in data_entries %}
{{ entry.title }}
{% if entry.is_expired() %} 已过期 {% else %} 有效 {% endif %}

{{ entry.content | truncate(80) }}

可见用户
{% set visible_users = entry.visible_to_users.all() %} {% for user in visible_users[:3] %} {{ user.username }} {% else %} 无特定用户 {% endfor %} {% if visible_users|length > 3 %} +{{ visible_users|length - 3 }} {% endif %}
{% set entry_attachments = entry.attachments.all() %} {% if entry_attachments %}
附件
{% for attachment in entry_attachments[:2] %} {{ attachment.original_name | truncate(15) }} {% endfor %} {% if entry_attachments|length > 2 %} +{{ entry_attachments|length - 2 }} {% endif %}
{% endif %}
{% else %}

暂无数据条目

立即添加
{% endfor %}
{% endblock %}