You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
3.5 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>随机点名系统</title>
<style>
.biaoti {
font-size: 30px;/* 文字大小 */
position: fixed;
text-align: center;
background-color: #163874;
color: white;
width: 100%;
padding: 45px 0 45px 16px;/* 边框宽度 */
height: 120px;
box-sizing: border-box
}
body {
margin: 0px;
}
ul {
list-style-type: none;
margin: 120px 0 0 0;
border: 0px;
padding: 0;
width: 15%;
background-color: #163874;
position: fixed;
height: 100%;
}
li a {
display: block;
color: white;
font-size: 20px;
padding: 45px;
text-align: center;
text-decoration: none;
}
li a.active {
background-color: #7989E8;
color: white;
}
li a:hover:not(.active) {
background-color: #555;
color: white;
}
</style>
<style>
.biaoge {
width:100%;
margin:0;
border:0;
color:black;
background-color:#EEEEEE;
}
.biaoge,.biaoge th,.biaoge td {
font-size:26px;
text-align:center;
padding:4px;
border-collapse:collapse;
}
.biaoge th,.biaoge td {
border-width:1px 0 1px 0;
border:1px inset #D8D8D8;
}
.biaoge tr {
border: 1px solid #D8D8D8;
height: 20px;
}
.shangchuang{
font-size: 15px;
width: 130px;
height: 45px;
margin: 5px auto 5px 5px;
border: none;
background-color: #d5e4f6;
color: #71c9eb;
border-radius: 8px;
font-weight: bold;
cursor: pointer;
transition: .5s;
}
</style>
</head>
<body>
<div class="biaoti">随机点名系统</div>
<ul>
<li><a href="/first/">点名提问</a></li>
<li><a class="active" href="#news">学生名单</a></li>
<li><a href="/third/">积分排名</a></li>
<li><a href="/fourth/">账号设置</a></li>
</ul>
<!-- 上传Excel文件 -->
<div style="margin-left:15%;padding:120px 0 0 0;height:auto;">
<div style="display: flex ;">
<form action="/upload_excel/" method="get">
<button class="shangchuang">上传名单</button>
</form>
<form action="/delete_excel/" method="get" id="delete">
<button class="shangchuang" >删除名单</button>
</form>
</div>
</div>
<script>
document.getElementById('delete').addEventListener('submit', function(event) {
// 阻止表单提交行为
event.preventDefault();
// 弹出确认对话框
if (confirm('您确定要删除吗?')) {
this.submit();
}else {
return;
}
});
</script>
<!-- 学生名单表格 -->
<div style="margin-left:15%;height:auto;">
<table class="biaoge">
<tr>
<th>学号</th><th>姓名</th><th>专业</th> <th>班级</th>
</tr>
{% for row in form %}
<tr>
<td>{{ row.student_xuehao }}</td>
<td>{{ row.student_name }}</td>
<td>{{ row.student_major }}</td>
<td>{{ row.student_class }}</td>
</tr>
{% endfor %}
</table>
</div>
</body>
</html>