功能特性: - 前端文章展示 (Markdown渲染、代码高亮) - 后台管理系统 (文章、分类、标签、作者管理) - 图片上传 (点击、拖拽、粘贴) - 网站设置 (Logo、底部宣传图片上传) - 访问统计 (IP记录、趋势图表) - 参考来源、附件支持 - 单端口部署 (16012) 技术栈: - Flask 3.0 + SQLAlchemy - SQLite数据库 - marked.js + highlight.js (Markdown渲染) - Chart.js (统计图表)
56 lines
1.9 KiB
HTML
56 lines
1.9 KiB
HTML
{% extends 'admin/base.html' %}
|
|
|
|
{% block title %}{% if author %}编辑作者{% else %}新建作者{% endif %}{% endblock %}
|
|
{% block page_title %}{% if author %}编辑作者{% else %}新建作者{% endif %}{% endblock %}
|
|
|
|
{% block content %}
|
|
<form method="POST" class="form-card">
|
|
<div class="form-group">
|
|
<label for="name">姓名 *</label>
|
|
<input type="text" id="name" name="name" required value="{{ author.name if author else '' }}">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="avatar">头像URL</label>
|
|
<input type="url" id="avatar" name="avatar" value="{{ author.avatar if author else '' }}"
|
|
placeholder="https://example.com/avatar.jpg">
|
|
{% if author and author.avatar %}
|
|
<div class="image-preview">
|
|
<img src="{{ author.avatar }}" alt="头像预览" style="max-width: 100px; border-radius: 50%;">
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="bio">简介</label>
|
|
<textarea id="bio" name="bio" rows="3" placeholder="作者简介">{{ author.bio if author else '' }}</textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="website">个人网站/主页</label>
|
|
<input type="url" id="website" name="website" value="{{ author.website if author else '' }}"
|
|
placeholder="https://yourwebsite.com">
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<button type="submit" class="btn btn-primary">
|
|
{% if author %}保存修改{% else %}创建作者{% endif %}
|
|
</button>
|
|
<a href="{{ url_for('admin.authors') }}" class="btn btn-secondary">取消</a>
|
|
</div>
|
|
</form>
|
|
|
|
<style>
|
|
.form-card {
|
|
background: var(--admin-card-bg);
|
|
border-radius: 8px;
|
|
padding: 30px;
|
|
box-shadow: var(--admin-shadow);
|
|
max-width: 600px;
|
|
}
|
|
|
|
.image-preview {
|
|
margin-top: 10px;
|
|
}
|
|
</style>
|
|
{% endblock %} |