fix(ui): 修复图片路径与缩略显示;审核页展示图+介绍+用户
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}作品审核{% endblock %}
|
||||
{% block content %}
|
||||
<h3>作品审核</h3>
|
||||
<table class="table">
|
||||
<tr><th>标题</th><th>作者</th><th>操作</th></tr>
|
||||
<h3 class="mb-3">作品审核</h3>
|
||||
<div class="card-grid">
|
||||
{% for p in posts %}
|
||||
<tr>
|
||||
<td>{{ p.title }}</td>
|
||||
<td>{{ p.user.username }}</td>
|
||||
<td>
|
||||
<div class="card">
|
||||
{% set first = p.images[0] if p.images %}
|
||||
{% if first %}
|
||||
<img class="photo-thumb" src="{{ url_for('main.uploads', filename=first.web_path) }}" alt="{{ p.title }}" />
|
||||
{% endif %}
|
||||
<div class="p-3">
|
||||
<div class="mb-2"><strong>{{ p.title }}</strong> · {{ p.user.username }}</div>
|
||||
{% if p.description %}<div class="text-secondary mb-2">{{ p.description }}</div>{% endif %}
|
||||
<form method="post" action="{{ url_for('admin.approve_post', post_id=p.id) }}" style="display:inline">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-success">通过</button>
|
||||
@@ -17,8 +20,8 @@
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
||||
<button class="btn btn-danger">拒绝</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{% set first = p.images[0] if p.images %}
|
||||
{% if first %}
|
||||
<a href="{{ url_for('posts.detail', post_id=p.id) }}">
|
||||
<img class="photo-thumb" src="{{ url_for('main.uploads', filename=first.web_path.split('uploads\\')[-1]) }}" alt="{{ p.title }}" />
|
||||
<img class="photo-thumb" src="{{ url_for('main.uploads', filename=first.web_path) }}" alt="{{ p.title }}" />
|
||||
</a>
|
||||
{% endif %}
|
||||
<div class="p-3">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{% set first = p.images[0] if p.images %}
|
||||
{% if first %}
|
||||
<a href="{{ url_for('posts.detail', post_id=p.id) }}">
|
||||
<img class="photo-thumb" src="{{ url_for('main.uploads', filename=first.web_path.split('uploads\\')[-1]) }}" alt="{{ p.title }}" />
|
||||
<img class="photo-thumb" src="{{ url_for('main.uploads', filename=first.web_path) }}" alt="{{ p.title }}" />
|
||||
</a>
|
||||
{% endif %}
|
||||
<div class="p-3">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="row">
|
||||
{% for img in post.images %}
|
||||
<div class="col-md-4 mb-2">
|
||||
<img src="{{ url_for('main.uploads', filename=img.web_path.split('uploads\\')[-1]) }}" class="photo-thumb" />
|
||||
<img src="{{ url_for('main.uploads', filename=img.web_path) }}" class="photo-thumb" />
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user