some improvements

This commit is contained in:
ridethepig 2022-12-12 16:05:18 +08:00
parent 6055bd1ec8
commit 3c44d27b12
12 changed files with 59 additions and 37 deletions

View File

@ -1,8 +1,6 @@
{% extends 'base.html' %}
{% block header %}
<h2 class="text-center">{% block title %}管理主页{% endblock %}</h2>
{% endblock %}
{% block title %}管理页面{% endblock %}
{% block content %}
<!-- <div>
<form method="post" class="">

View File

@ -1,7 +1,7 @@
{% extends 'base.html' %}
{% block title %}管理页面{% endblock %}
{% block header %}
<h2 class="text-center">{% block title %}管理主页{% endblock %}</h2>
<h2 class="text-center">管理主页</h2>
<script>
function control_modal(op, modal_id, uid='1'){
modal_elm = document.getElementById(modal_id);

View File

@ -1,7 +1,6 @@
{% extends 'base.html' %}
{% block header %}
{% endblock %}
{% block title %}管理页面{% endblock %}
{% block content %}
<div class="container">

View File

@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block title %}登陆页面{% endblock %}
{% block content %}
<div class="columns " style="padding-top:5em;">
<div class="column col-3"></div>

View File

@ -1,16 +1,15 @@
{% extends 'base.html' %}
{% block header %}
<h2 class="text-center">{% block title %}在访问前,需要登陆{% endblock %}</h1>
{% endblock %}
{% block title %}EBookMan{% endblock %}
{% block content %}
<div style="padding-top: 20vh;">
<h2 class="text-center">在访问前,需要登陆</h2>
<div class="text-center">
<div class="p-1">
<a href="{{ url_for('auth.loginadmin') }}" class="btn">管理员登陆</a>
</div>
<div class="p-1">
<a href="{{ url_for('auth.loginuser') }}" class="btn">用户登陆</a>
</div>
</div>
</div>
{% endblock %}

View File

@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block title %}登陆页面{% endblock %}
{% block content %}
<div class="columns " style="padding-top:5em;">
<div class="column col-3"></div>

View File

@ -1,5 +1,5 @@
<!doctype html>
<title>{% block title %}{% endblock %} - DBProject</title>
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='spectre-exp.min.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='spectre-icons.min.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='spectre.min.css') }}">

View File

@ -16,8 +16,9 @@
}
typeinput.value = typestr;
}
function create_type_button(typename) {
function clear_toast(toastid) {
toast_elm = document.getElementById(toastid);
toast_elm.classList.add('d-none');
}
</script>
{% endblock %}
@ -25,11 +26,14 @@
{% block user_content %}
<div class="panel">
<div class="panel-header">
<h2>新建图书</h2>
<div class="panel-title text-center">
<h4>新建图书</h4>
</div>
</div>
<div class="panel-body">
{% if error%}
<div class="toast">
<div class="toast" id="toast1">
<button class="btn btn-clear float-right" onclick="clear_toast('toast1')"></button>
{{error}}
</div>
{% endif %}

View File

@ -1,5 +1,14 @@
{% extends 'user/user_base.html' %}
{% block header %}
<script>
function clear_toast(toastid) {
toast_elm = document.getElementById(toastid);
toast_elm.classList.add('d-none');
}
</script>
{% endblock %}
{% block user_content %}
<div class="panel">
<div class="panel-header">
@ -9,24 +18,37 @@
</div>
<div class="panel-body">
{% if error%}
<div class="toast">
<button class="btn btn-clear float-right"></button>
<div class="toast" id="toast1">
<button class="btn btn-clear float-right" onclick="clear_toast('toast1')"></button>
{{error}}
</div>
{% endif %}
<div class="columns">
<div class="column col-2"></div>
<div class="column col-8">
<form method="post" class="input-group">
<label class="form-label px-1" for="typename">新建类型</label>
<input class="form-input" name="typename" id="typename" required>
<input class="btn btn-primary input-group-btn" type="submit" value="提交">
</form>
<ul>
<table class="table text-center m-2">
<thead >
<tr><th>TID</th><th>标签</th><th>操作</th></tr>
</thead>
<tbody>
{% for atype in typelist%}
<li>
TID:{{ atype['type_id'] }}, 类型名: {{ atype['type_name'] }}
<a href="/removetype?tid={{atype['type_id']}}">删除</a>
</li>
<tr>
<td>{{ atype['type_id'] }}</td>
<td>{{ atype['type_name'] }}</td>
<td><a href="/removetype?tid={{atype['type_id']}}">删除</a></td>
</tr>
{% endfor %}
</ul>
</tbody>
</table>
</div>
<div class="column col-2"></div>
</div>
</div>
</div>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block user_content %}
<div class="panel">
<div class="panel-header">
<div class="panel-title">统计信息</div>
<div class="panel-title text-center"><h4>统计信息</h4></div>
</div>
<div class="panel-body">
<dl>

View File

@ -3,7 +3,7 @@
{% block user_content %}
<div class="panel">
<div class="panel-header">
<div class="panel-title">搜索图书</div>
<div class="panel-title text-center"><h4>搜索图书</h4></div>
</div>
<div class="panel-body">
<form class="form-group" method="get">

View File

@ -1,5 +1,5 @@
{% extends 'base.html' %}
{% block title %}EBookMan{% endblock %}
{% block content %}
<div class="container">
<div class="columns">