EnglishPal/app/templates/admin_index.html

120 lines
5.4 KiB
HTML
Raw Normal View History

2023-03-20 20:16:48 +08:00
<!DOCTYPE html>
<html lang="en">
2022-12-31 18:25:13 +08:00
<head>
2023-03-20 20:16:48 +08:00
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=3.0, user-scalable=yes" />
<meta name="format-detection" content="telephone=no" />
{{ yml['header'] | safe }}
{% if yml['css']['item'] %}
{% for css in yml['css']['item'] %}
<link href="{{ css }}" rel="stylesheet">
{% endfor %}
{% endif %}
{% if yml['js']['head'] %}
{% for js in yml['js']['head'] %}
<script src="{{ js }}"></script>
{% endfor %}
{% endif %}
2022-12-31 18:25:13 +08:00
</head>
<body class="container" style="width: 800px; margin: auto; margin-top:24px;">
2023-03-20 20:16:48 +08:00
<nav class="navbar navbar-expand-lg bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">管理员 {{ username }} 您好!</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
2022-12-31 18:25:13 +08:00
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
2023-03-20 20:16:48 +08:00
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/{{ username }}">返回主页</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/logout">退出登录</a>
</li>
</ul>
</div>
2022-12-31 18:25:13 +08:00
</div>
2023-03-20 20:16:48 +08:00
</nav>
2022-12-31 18:25:13 +08:00
2023-03-20 20:16:48 +08:00
<div class="card" style="margin-top:24px;">
<h5 style="margin-top: 10px;padding-left: 10px;">重置选中用户密码</h5>
2022-12-31 18:25:13 +08:00
<form action="" method="post" class="container mb-3">
<div class="mb-3">
2023-03-20 20:16:48 +08:00
<label for="exampleInputEmail1" class="form-label">用户</label>
<select id="username" name="username" class="form-select" aria-label="Default select example">
<option selected>选择用户</option>
{% for user in user_list %}
<option value="{{ user.name }}">{{ user.name }}</option>
{% endfor %}
</select>
2022-12-31 18:25:13 +08:00
</div>
2023-03-20 20:16:48 +08:00
<input type="submit" value="重置密码为123456" class="btn btn-outline-primary">
2022-12-31 18:25:13 +08:00
</form>
</div>
2023-03-20 20:16:48 +08:00
<div class="card" style="margin-top:24px;">
{% if tips %}
<div class="alert alert-success" role="alert">
{{ tips }}
</div>
{% endif %}
<div class="card-content">
<h5 style="margin-top: 10px;padding-left: 10px;">录入文章</h5>
<form action="" method="post" class="container mb-3">
<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">文章内容</label>
<textarea id="content" name="content" class="form-control" placeholder="请输入文章内容"></textarea>
<label for="exampleInputEmail1" class="form-label">文章来源</label>
<textarea id="source" name="source" class="form-control" placeholder="请输入来源"></textarea>
<label for="exampleInputEmail1" class="form-label">文章等级</label>
<textarea id="level" name="level" class="form-control" placeholder="请输入等级"></textarea>
2023-03-20 20:16:48 +08:00
<label for="exampleInputEmail1" class="form-label">文章问题</label>
<textarea id="question" name="question" class="form-control" placeholder="请输入问题"></textarea>
</div>
<input type="submit" value="保存" class="btn btn-outline-primary">
</form>
</div>
</div>
<div class="card" style="margin-top:24px;">
<h5 style="margin-top: 10px;padding-left: 10px;">文章列表</h5>
<div class="list-group">
{% for text in text_list %}
2022-12-31 18:25:13 +08:00
<div class="list-group-item list-group-item-action" aria-current="true">
<div class="d-flex w-100 justify-content-between">
2023-03-20 20:16:48 +08:00
<h5 class="mb-1">{{ text.source }}</h5>
<small>Date:{{ text.date }} Level:{{ text.level }}</small>
2022-12-31 18:25:13 +08:00
</div>
2023-03-20 20:16:48 +08:00
<div style="text-align: right; padding-bottom: 5px;"><a href="/admin?delete_id={{text.article_id}}"
class="btn btn-outline-danger btn-sm">
删除文章
</a></div>
<p class="mb-1">{{ text.text }}</p>
2022-12-31 18:25:13 +08:00
</div>
2023-03-20 20:16:48 +08:00
{% endfor %}
</div>
</div>
<div style="margin:20px 0;">
<ul class="pagination pagination-sm justify-content-center">
2023-03-23 13:47:53 +08:00
<li class="page-item"><a class="page-link" href="/admin?page={{ cur_page - 1 }}&size={{ page_size }}">Previous</a>
2023-03-20 20:16:48 +08:00
</li>
2023-03-23 13:47:53 +08:00
{% for i in range(1, article_number // page_size + 2) %}
2023-03-20 20:16:48 +08:00
{% if cur_page == i %}
2023-03-23 13:47:53 +08:00
<li class="page-item active"><a class="page-link" href="/admin?page={{ i }}&size={{ page_size }}">{{ i }}</a>
2023-03-20 20:16:48 +08:00
</li>
{% else %}
2023-03-23 13:47:53 +08:00
<li class="page-item"><a class="page-link" href="/admin?page={{ i }}&size={{ page_size }}">{{ i }}</a></li>
2023-03-20 20:16:48 +08:00
{% endif %}
{% endfor %}
2023-03-23 13:47:53 +08:00
<li class="page-item"><a class="page-link" href="/admin?page={{ cur_page + 1 }}&size={{ page_size }}">Next</a>
2023-03-20 20:16:48 +08:00
</li>
</ul>
2022-12-31 18:25:13 +08:00
</div>
</body>
2023-03-20 20:16:48 +08:00
</html>