49 lines
1.5 KiB
HTML
49 lines
1.5 KiB
HTML
|
{% extends "base.html" %}
|
||
|
|
||
|
{% block content %}
|
||
|
|
||
|
<h2 class="subtitle">
|
||
|
{% if user.is_authenticated and user.role == "admin" %}
|
||
|
<h3 class="subtitle">用户信息:</h3>
|
||
|
<table class="table">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th scope="col">id</th>
|
||
|
<th scope="col">邮箱</th>
|
||
|
<th scope="col">用户名</th>
|
||
|
<th scope="col">角色</th>
|
||
|
<th scope="col">已激活</th>
|
||
|
<th style="display:none" scope="col">提交</th>
|
||
|
<th style="display:none" scope="col">删除</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
{% for account in accounts %}
|
||
|
<tr id="{{ 'account-%d'|format(account.id) }}">
|
||
|
<td scope="row">{{ account.id }}</td>
|
||
|
<td>{{ account.email }}</td>
|
||
|
<td><input type="text" value="{{ account.name }}"></td>
|
||
|
<td>
|
||
|
<select>
|
||
|
<option value="admin" {% if account.role=="admin" %}selected{% endif %}>admin</option>
|
||
|
<option value="user" {% if account.role=="user" %}selected{% endif %}>user</option>
|
||
|
</select>
|
||
|
</td>
|
||
|
<td><input type="checkbox" {% if account.isActivated %}checked{% else %}unchecked{% endif %}></td>
|
||
|
<td><button class="btn btn-info">提交</button></td>
|
||
|
<td><button type="button" class="btn btn-danger">删除</button></td>
|
||
|
</tr>
|
||
|
{% endfor %}
|
||
|
</tbody>
|
||
|
</table>
|
||
|
{% endif %}
|
||
|
</h2>
|
||
|
|
||
|
{% with messages = get_flashed_messages() %}
|
||
|
{% if messages %}
|
||
|
<div class="notification is-danger">
|
||
|
{{ messages[0] }}
|
||
|
</div>
|
||
|
{% endif %}
|
||
|
{% endwith %}
|
||
|
{% endblock %}
|