Files
tech-blog/app/templates/admin/authors.html
hz4th_coder e689fed71e 初始化技术博客项目
功能特性:
- 前端文章展示 (Markdown渲染、代码高亮)
- 后台管理系统 (文章、分类、标签、作者管理)
- 图片上传 (点击、拖拽、粘贴)
- 网站设置 (Logo、底部宣传图片上传)
- 访问统计 (IP记录、趋势图表)
- 参考来源、附件支持
- 单端口部署 (16012)

技术栈:
- Flask 3.0 + SQLAlchemy
- SQLite数据库
- marked.js + highlight.js (Markdown渲染)
- Chart.js (统计图表)
2026-06-04 23:12:34 +08:00

60 lines
2.1 KiB
HTML

{% extends 'admin/base.html' %}
{% block title %}作者管理{% endblock %}
{% block page_title %}作者管理{% endblock %}
{% block content %}
<div class="toolbar">
<a href="{{ url_for('admin.author_create') }}" class="btn btn-primary">+ 新建作者</a>
</div>
{% if authors %}
<table class="data-table">
<thead>
<tr>
<th width="10%">头像</th>
<th width="20%">姓名</th>
<th width="30%">简介</th>
<th width="20%">网站</th>
<th width="20%">操作</th>
</tr>
</thead>
<tbody>
{% for author in authors %}
<tr>
<td>
{% if author.avatar %}
<img src="{{ author.avatar }}" alt="{{ author.name }}" style="width: 40px; height: 40px; border-radius: 50%;">
{% else %}
<div style="width: 40px; height: 40px; border-radius: 50%; background: #ccc; display: flex; align-items: center; justify-content: center;">👤</div>
{% endif %}
</td>
<td>{{ author.name }}</td>
<td>{{ author.bio or '-' }}</td>
<td>
{% if author.website %}
<a href="{{ author.website }}" target="_blank">{{ author.website[:30] }}...</a>
{% else %}
-
{% endif %}
</td>
<td>
<div class="action-buttons">
<a href="{{ url_for('admin.author_edit', author_id=author.id) }}" class="btn btn-sm">编辑</a>
<form action="{{ url_for('admin.author_delete', author_id=author.id) }}" method="POST" style="display:inline"
onsubmit="return confirm('确定删除此作者?')">
<button type="submit" class="btn btn-sm btn-danger">删除</button>
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="empty-state">
<p>暂无作者</p>
<a href="{{ url_for('admin.author_create') }}" class="btn btn-primary">创建第一个作者</a>
</div>
{% endif %}
{% endblock %}