47 lines
2.3 KiB
HTML
47 lines
2.3 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}{{ item.title or item.source_item_id }} 详情 - 热榜评论分析工具{% endblock %}
|
||
{% block breadcrumbs %}
|
||
<nav aria-label="breadcrumb"><ol class="breadcrumb">
|
||
<li class="breadcrumb-item"><a href="/">首页</a></li>
|
||
<li class="breadcrumb-item"><a href="/tasks/{{ task.id }}">任务 #{{ task.id }}</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>
|
||
</ol></nav>
|
||
{% endblock %}
|
||
{% block content %}
|
||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||
<h1 class="h3 mb-0">{{ item.title or item.source_item_id }}</h1>
|
||
<div class="d-flex gap-2">
|
||
<button
|
||
class="btn btn-outline-primary"
|
||
onclick="downloadExport('/api/export/items/{{ item.id }}.md', 'item-report.md', event)"
|
||
{% if not report %}disabled title="报告尚未生成"{% endif %}>
|
||
导出 Markdown 报告
|
||
</button>
|
||
<button
|
||
class="btn btn-outline-secondary"
|
||
onclick="downloadExport('/api/export/items/{{ item.id }}/comments.csv', 'item-comments.csv', event)">
|
||
导出评论 CSV
|
||
</button>
|
||
</div>
|
||
</div>
|
||
{% if report %}
|
||
{% include "partials/report_panel.html" %}
|
||
{% else %}
|
||
<div class="text-center text-muted py-5">
|
||
<div class="spinner-border text-warning mb-3" role="status"></div>
|
||
<p>报告生成中,请稍候...</p>
|
||
<p class="small mb-0">Markdown 报告将在分析完成后开放下载;评论 CSV 可先导出已抓取的数据。</p>
|
||
</div>
|
||
{% endif %}
|
||
<section class="card"><div class="card-header">评论明细</div><div class="table-responsive">
|
||
<table class="table mb-0"><thead><tr><th>评论内容</th><th>情绪</th><th>标签</th><th>点赞</th></tr></thead><tbody>
|
||
{% for comment in comments %}
|
||
<tr><td>{{ comment.content }}</td><td>{{ comment.sentiment }}</td><td>{% for label in comment.labels | from_json %}<span class="badge bg-secondary me-1">{{ label }}</span>{% else %}-{% endfor %}</td><td>{{ comment.like_count or 0 }}</td></tr>
|
||
{% else %}
|
||
<tr><td colspan="4" class="text-center text-muted">暂无评论数据(该内容无评论或评论抓取为空)</td></tr>
|
||
{% endfor %}
|
||
</tbody></table>
|
||
</div></section>
|
||
{% endblock %}
|