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

数据管理

上传新数据或管理现有条目

导出数据
已选择 0 项
创建新数据条目
{{ form.hidden_tag() }}
{{ form.title.label(class="form-label fw-bold small text-uppercase text-muted") }} {{ form.title(class="form-control shadow-sm", placeholder="输入数据标题") }}
{{ form.csv_file.label(class="form-label fw-bold small text-uppercase text-muted") }} {{ form.csv_file(class="form-control shadow-sm") }}
{{ form.attachments.label(class="form-label fw-bold small text-uppercase text-muted") }} {{ form.attachments(class="form-control shadow-sm", multiple=True) }}
{{ form.researcher_id.label(class="form-label fw-bold small text-uppercase text-muted") }} {{ form.researcher_id(class="form-select shadow-sm") }}
{{ form.is_permanent(class="form-check-input", id="isPermanentSwitch") }} {{ form.is_permanent.label(class="form-check-label small", for="isPermanentSwitch") }}
从 {{ form.start_date(class="form-control") }} 至 {{ form.expiration_date(class="form-control") }}
{{ form.content.label(class="form-label fw-bold small text-uppercase text-muted") }} {{ form.content(class="form-control shadow-sm", rows=5, placeholder="输入详细描述...") }}
{{ form.users.label(class="form-label fw-bold small text-uppercase text-muted") }}
{% for subfield in form.users %}
{{ subfield(class="form-check-input") }} {{ subfield.label(class="form-check-label small") }}
{% endfor %}
{{ form.submit(class="btn btn-primary px-4") }}
{% for entry in data_entries %}
{{ entry.title }}

{{ 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 %}
{% block scripts %} {% endblock %} {% endblock %}