Files
KSP_project/app/templates/asset_list.html
T
2026-05-08 15:16:04 +08:00

114 lines
4.4 KiB
HTML

{% extends "base.html" %}
{% from "_datetime_picker_field.html" import datetime_picker_field %}
{% block content %}
{% include "_mission_ops_tabs.html" %}
{% include "_mission_preview_header.html" %}
<section class="panel catalog-actions-panel top-gap">
<div>
<p class="eyebrow">Actions</p>
<h2>新增内容</h2>
</div>
<div class="button-row">
<a class="primary-button" href="{{ url_for('web.asset_new', sim_time=simulation_time_input) }}">新增任务资产</a>
<form method="post" action="{{ url_for('web.asset_import_log_book') }}" class="inline-form">
<input type="hidden" name="sim_time" value="{{ simulation_time_input }}">
<button class="secondary-button" type="submit">导入 Log Book</button>
</form>
</div>
</section>
<section class="panel panel-wide top-gap">
<form class="search-form filter-row" method="get">
<input type="search" name="q" value="{{ search_term }}" placeholder="Asset / Type / Program / Region">
<select name="asset_type">
<option value="">全部类型</option>
{% for option in asset_type_options %}
<option value="{{ option }}" {% if option == asset_type_filter %}selected{% endif %}>{{ option }}</option>
{% endfor %}
</select>
<select name="sort">
{% for option in sort_options %}
<option value="{{ option.value }}" {% if option.value == sort_option %}selected{% endif %}>{{ option.label }}</option>
{% endfor %}
</select>
<button class="primary-button" type="submit">应用</button>
<a class="secondary-button" href="{{ url_for('web.asset_list') }}">重置</a>
</form>
{% if rows %}
<div class="table-shell top-gap">
<table class="data-table compact-table">
<thead>
<tr>
<th>Asset</th>
<th>Type</th>
<th>Program</th>
<th>Current Event</th>
<th>Next Event</th>
<th>Entries</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>
<td>
<strong><a class="table-link" href="{{ url_for('web.asset_detail', asset_id=row.asset.id, sim_time=simulation_time_input) }}">{{ row.asset.name }}</a></strong>
</td>
<td>{{ row.asset.asset_type }}</td>
<td>{{ row.asset.program or '-' }}</td>
<td>{{ row.current_event }}</td>
<td>{{ row.next_event }}</td>
<td>{{ row.entry_count }}</td>
<td>
<div class="table-actions">
<a class="table-link" href="{{ url_for('web.asset_edit', asset_id=row.asset.id, sim_time=simulation_time_input) }}">编辑</a>
<a class="table-link" href="{{ url_for('web.asset_entry_new', asset_id=row.asset.id, sim_time=simulation_time_input) }}">加条目</a>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if total_pages > 1 %}
<nav class="pagination-bar" aria-label="Asset pagination">
{% if has_prev %}
<a class="pagination-link" href="{{ prev_url }}">上一页</a>
{% else %}
<span class="pagination-link disabled">上一页</span>
{% endif %}
<div class="pagination-pages">
{% for item in page_links %}
{% if item.ellipsis %}
<span class="pagination-ellipsis">...</span>
{% elif item.current %}
<span class="pagination-link current">{{ item.number }}</span>
{% else %}
<a class="pagination-link" href="{{ item.url }}">{{ item.number }}</a>
{% endif %}
{% endfor %}
</div>
{% if has_next %}
<a class="pagination-link" href="{{ next_url }}">下一页</a>
{% else %}
<span class="pagination-link disabled">下一页</span>
{% endif %}
</nav>
{% endif %}
{% else %}
<section class="empty-state compact-empty">
<h2>没有命中结果</h2>
<p>调整筛选条件或重置后重试。</p>
</section>
{% endif %}
</section>
{% endblock %}