feat: overhaul UI styling, improve templates, enhance services and tests

This commit is contained in:
2026-06-06 00:38:56 +08:00
parent f7f1a4c0cb
commit 904eec392e
38 changed files with 1471 additions and 795 deletions
+18 -20
View File
@@ -1,16 +1,17 @@
{% extends "base.html" %}
{% block title %}{{ page_title }} — HF Daily Papers{% endblock %}
{% block content %}
{% 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">
<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>
@@ -18,9 +19,7 @@
<div class="empty-state">
<p>{{ error }}</p>
</div>
{% endif %}
{% if papers %}
{% endif %} {% if papers %}
<div class="compare-table-wrapper">
<table class="compare-table">
<thead>
@@ -29,8 +28,8 @@
{% for paper in papers %}
<th>
<a href="/paper/{{ paper.arxiv_id }}">{{ paper.arxiv_id }}</a>
<br>
<small style="color: var(--ink-light);">
<br />
<small style="color: var(--ink-light)">
{{ paper.upvotes }} 👍 · {{ paper.paper_date }}
</small>
</th>
@@ -42,7 +41,9 @@
<tr>
<td class="field-label">作者</td>
{% for paper in papers %}
<td class="paper-col">{{ paper.authors|map(attribute='name')|join(', ') }}</td>
<td class="paper-col">
{{ paper.authors|map(attribute='name')|join(', ') }}
</td>
{% endfor %}
</tr>
@@ -58,16 +59,13 @@
{% endfor %}
</tr>
{# 结构化对比字段 #}
{% for row in rows %}
{# 结构化对比字段 #} {% 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>
{% if cell %} {{ cell }} {% else %}
<span class="no-summary">暂无总结</span>
{% endif %}
</td>
{% endfor %}