Files

85 lines
2.3 KiB
HTML

{% extends "base.html" %} {% block title %}{{ page_title }} — HF Daily Papers{%
endblock %} {% block content %}
<section class="compare-page">
<h1>论文对比</h1>
{# ID 输入表单 #}
<form class="search-form" method="get" action="/compare">
<input
type="text"
name="ids"
value="{{ ids_param }}"
placeholder="输入 arXiv ID,逗号分隔(最多 5 篇),如 2401.12345,2401.67890"
class="search-input"
/>
<button type="submit" class="search-btn">对比</button>
</form>
{% if error %}
<div class="empty-state">
<p>{{ error }}</p>
</div>
{% endif %} {% if papers %}
<div class="compare-table-wrapper">
<table class="compare-table">
<thead>
<tr>
<th>字段</th>
{% for paper in papers %}
<th>
<a href="/paper/{{ paper.arxiv_id }}">{{ paper.arxiv_id }}</a>
<br />
<small style="color: var(--ink-light)">
{{ paper.upvotes }} 👍 · {{ paper.paper_date }}
</small>
</th>
{% endfor %}
</tr>
</thead>
<tbody>
{# 作者行 #}
<tr>
<td class="field-label">作者</td>
{% for paper in papers %}
<td class="paper-col">
{{ paper.authors|map(attribute='name')|join(', ') }}
</td>
{% endfor %}
</tr>
{# 标签行 #}
<tr>
<td class="field-label">标签</td>
{% for paper in papers %}
<td class="paper-col">
{% for t in paper.tags[:5] %}
<span class="tag">{{ t.tag }}</span>
{% endfor %}
</td>
{% endfor %}
</tr>
{# 结构化对比字段 #} {% for row in rows %}
<tr>
<td class="field-label">{{ row.label }}</td>
{% for cell in row.cells %}
<td class="paper-col">
{% if cell %} {{ cell }} {% else %}
<span class="no-summary">暂无总结</span>
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% elif ids_param and not error %}
<div class="empty-state">
<p>未找到匹配的论文</p>
<p class="hint">请检查 arXiv ID 是否正确</p>
</div>
{% endif %}
</section>
{% endblock %}