AI 生成: 一个仿 aptv.pro 的视频站点,使用 Python Flask 构建,包含视频列表、分类、搜索和视频播放页面。
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}APTV - 首页{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<nav class="categories">
|
||||
<a href="{{ url_for('index', q=keyword) }}" class="cat {% if not current_category %}active{% endif %}">全部</a>
|
||||
{% for cat in categories %}
|
||||
<a href="{{ url_for('index', category=cat, q=keyword) }}"
|
||||
class="cat {% if current_category == cat %}active{% endif %}">{{ cat }}</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
|
||||
{% if keyword %}
|
||||
<p class="result-tip">搜索 “{{ keyword }}” 共找到 {{ videos|length }} 条结果</p>
|
||||
{% endif %}
|
||||
|
||||
{% if videos %}
|
||||
<div class="grid">
|
||||
{% for v in videos %}
|
||||
<a class="card" href="{{ url_for('detail', vid=v.id) }}">
|
||||
<div class="cover">
|
||||
<img src="{{ v.cover }}" alt="{{ v.title }}" loading="lazy">
|
||||
<span class="rating">{{ v.rating }}</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">{{ v.title }}</h3>
|
||||
<p class="card-meta">{{ v.year }} · {{ v.category }}</p>
|
||||
</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty">
|
||||
<h2>没有找到相关影片</h2>
|
||||
<p>试试其他关键词或分类吧</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user