fix: 去除页面编号井号显示
This commit is contained in:
@@ -156,7 +156,7 @@ def get_task(session: Session, task_id: str) -> Task | None:
|
|||||||
def hydrate_task_progress(session: Session, task: Task) -> Task:
|
def hydrate_task_progress(session: Session, task: Task) -> Task:
|
||||||
display_number = calculate_task_display_number(session, task)
|
display_number = calculate_task_display_number(session, task)
|
||||||
task.display_number = display_number
|
task.display_number = display_number
|
||||||
task.display_id = f"#{display_number}"
|
task.display_id = str(display_number)
|
||||||
task.created_at_label = format_datetime_minute(task.created_at)
|
task.created_at_label = format_datetime_minute(task.created_at)
|
||||||
task.scale_label = (
|
task.scale_label = (
|
||||||
f"{PLATFORM_LABELS.get(task.platform, task.platform)} · "
|
f"{PLATFORM_LABELS.get(task.platform, task.platform)} · "
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<nav aria-label="breadcrumb"><ol class="breadcrumb">
|
<nav aria-label="breadcrumb"><ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="/">首页</a></li>
|
<li class="breadcrumb-item"><a href="/">首页</a></li>
|
||||||
<li class="breadcrumb-item"><a href="/tasks/{{ task.id }}">任务 {{ task.display_id }}</a></li>
|
<li class="breadcrumb-item"><a href="/tasks/{{ task.id }}">任务 {{ task.display_id }}</a></li>
|
||||||
<li class="breadcrumb-item"><a href="/hotspots/{{ hotspot.id }}/report">热点 #{{ hotspot.rank }}:{{ hotspot.title }}</a></li>
|
<li class="breadcrumb-item"><a href="/hotspots/{{ hotspot.id }}/report">热点 {{ hotspot.rank }}:{{ hotspot.title }}</a></li>
|
||||||
<li class="breadcrumb-item active">{{ item.title or item.source_item_id }}</li>
|
<li class="breadcrumb-item active">{{ item.title or item.source_item_id }}</li>
|
||||||
</ol></nav>
|
</ol></nav>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
{% set ai_percent = rate_percent(task.analysis_success_rate) %}
|
{% set ai_percent = rate_percent(task.analysis_success_rate) %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<strong>{{ task.display_id or ("#" ~ loop.index) }}</strong>
|
<strong>{{ task.display_id or loop.index }}</strong>
|
||||||
{% if task.is_demo %}
|
{% if task.is_demo %}
|
||||||
<br><span class="badge text-bg-info">Demo 数据</span>
|
<br><span class="badge text-bg-info">Demo 数据</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2 class="accordion-header">
|
<h2 class="accordion-header">
|
||||||
<button class="accordion-button {% if not loop.first %}collapsed{% endif %}" type="button" data-bs-toggle="collapse" data-bs-target="#hotspot-{{ hotspot.id }}">
|
<button class="accordion-button {% if not loop.first %}collapsed{% endif %}" type="button" data-bs-toggle="collapse" data-bs-target="#hotspot-{{ hotspot.id }}">
|
||||||
热点 #{{ hotspot.rank }}:{{ hotspot.title }}
|
热点 {{ hotspot.rank }}:{{ hotspot.title }}
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
<div id="hotspot-{{ hotspot.id }}" class="accordion-collapse collapse {% if loop.first %}show{% endif %}" data-bs-parent="#hotspot-list">
|
<div id="hotspot-{{ hotspot.id }}" class="accordion-collapse collapse {% if loop.first %}show{% endif %}" data-bs-parent="#hotspot-list">
|
||||||
|
|||||||
@@ -99,8 +99,9 @@ def test_index_page_uses_short_task_numbers_compact_fields_and_friendly_error_co
|
|||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
visible_text = BeautifulSoup(response.text, "html.parser").get_text(" ")
|
visible_text = BeautifulSoup(response.text, "html.parser").get_text(" ")
|
||||||
assert "#1" in visible_text
|
assert " 1 " in f" {visible_text} "
|
||||||
assert "#2" in visible_text
|
assert " 2 " in f" {visible_text} "
|
||||||
|
assert "#" not in visible_text
|
||||||
assert first_id not in visible_text
|
assert first_id not in visible_text
|
||||||
assert second_id not in visible_text
|
assert second_id not in visible_text
|
||||||
assert "2026-07-03 10:30" in visible_text
|
assert "2026-07-03 10:30" in visible_text
|
||||||
@@ -194,11 +195,12 @@ def test_task_detail_uses_short_number_title_and_keeps_full_uuid_for_diagnostics
|
|||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
visible_text = BeautifulSoup(response.text, "html.parser").get_text(" ")
|
visible_text = BeautifulSoup(response.text, "html.parser").get_text(" ")
|
||||||
assert "<title>任务 #1 - 热榜评论分析工具</title>" in response.text
|
assert "<title>任务 1 - 热榜评论分析工具</title>" in response.text
|
||||||
assert "任务 #1" in visible_text
|
assert "任务 1" in visible_text
|
||||||
assert "完整 ID" in visible_text
|
assert "完整 ID" in visible_text
|
||||||
assert task_id in visible_text
|
assert task_id in visible_text
|
||||||
assert "任务 #33333333-3333-4333-8333-333333333333" not in visible_text
|
assert "任务 #33333333-3333-4333-8333-333333333333" not in visible_text
|
||||||
|
assert "#" not in visible_text
|
||||||
assert "创建时间 2026-07-03 10:30" in visible_text
|
assert "创建时间 2026-07-03 10:30" in visible_text
|
||||||
|
|
||||||
|
|
||||||
@@ -416,6 +418,7 @@ def test_result_pages_render_seeded_data():
|
|||||||
|
|
||||||
assert task_response.status_code == 200
|
assert task_response.status_code == 200
|
||||||
assert "热点标题" in task_response.text
|
assert "热点标题" in task_response.text
|
||||||
|
assert "热点 1:热点标题" in BeautifulSoup(task_response.text, "html.parser").get_text(" ")
|
||||||
assert 'onclick="window.location.reload()"' in task_response.text
|
assert 'onclick="window.location.reload()"' in task_response.text
|
||||||
assert hotspot_response.status_code == 200
|
assert hotspot_response.status_code == 200
|
||||||
assert "热点总结" in hotspot_response.text
|
assert "热点总结" in hotspot_response.text
|
||||||
@@ -431,6 +434,9 @@ def test_result_pages_render_seeded_data():
|
|||||||
assert "<pre" not in hotspot_response.text
|
assert "<pre" not in hotspot_response.text
|
||||||
assert item_response.status_code == 200
|
assert item_response.status_code == 200
|
||||||
assert "内容总结" in item_response.text
|
assert "内容总结" in item_response.text
|
||||||
|
item_visible_text = BeautifulSoup(item_response.text, "html.parser").get_text(" ")
|
||||||
|
assert "热点 1:热点标题" in item_visible_text
|
||||||
|
assert "#" not in item_visible_text
|
||||||
assert "downloadExport('/api/export/items/item-result.md'" in item_response.text
|
assert "downloadExport('/api/export/items/item-result.md'" in item_response.text
|
||||||
assert "downloadExport('/api/export/items/item-result/comments.csv'" in item_response.text
|
assert "downloadExport('/api/export/items/item-result/comments.csv'" in item_response.text
|
||||||
assert "评论样本" in item_response.text
|
assert "评论样本" in item_response.text
|
||||||
|
|||||||
Reference in New Issue
Block a user