{% extends "base.html" %} {% block title %}暫時規範總表{% endblock %} {% block content %}

暫時規範總表

{% if current_user.role in ['editor', 'admin'] %} 建立新規範 {% endif %}
{% for spec in specs %} {% endfor %}
編號 主題 申請者 建立日期 結束日期 剩餘天數 狀態 操作
{{ spec.spec_code }} {{ spec.title }} {{ spec.applicant }} {{ spec.created_at.strftime('%Y-%m-%d') }} {{ spec.end_date.strftime('%Y-%m-%d') }} {% if spec.status in ['active', 'expired'] %} {% set remaining_days = (spec.end_date - today).days %} {% if remaining_days < 0 %} {% set color_class = 'days-expired' %} {% elif remaining_days <= 3 %} {% set color_class = 'days-critical' %} {% elif remaining_days <= 7 %} {% set color_class = 'days-warning' %} {% else %} {% set color_class = 'days-safe' %} {% endif %} {{ remaining_days if remaining_days >= 0 else '已過期' }} {% else %} - {% endif %} {% if spec.status == 'active' %} 已生效 {% elif spec.status == 'pending_approval' %} 待生效 {% elif spec.status == 'terminated' %} 已終止 {% else %} 已過期 {% endif %} {% if spec.status == 'pending_approval' and current_user.role in ['editor', 'admin'] %} {% endif %} {% if current_user.role == 'admin' and spec.status == 'pending_approval' %} {% endif %} {% if current_user.role in ['editor', 'admin'] and spec.status == 'active' %} {% endif %} {% if current_user.role == 'admin' %}
{% endif %} {% if spec.status == 'pending_approval' %} {% if current_user.role in ['editor', 'admin'] %} {% endif %} {% elif spec.uploads %} {% endif %}
{% endblock %}