44 lines
2.3 KiB
HTML
44 lines
2.3 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}课程管理 - 学生课程管理系统{% endblock %}
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<h4><i class="bi bi-book"></i> 课程管理</h4>
|
|
<div>
|
|
<a href="{{ url_for('course_add') }}" class="btn btn-primary"><i class="bi bi-plus-circle"></i> 新增课程</a>
|
|
{% if current_user.has_permission('course_export') %}<a href="{{ url_for('course_export') }}" class="btn btn-success"><i class="bi bi-download"></i> 导出Excel</a>{% endif %}
|
|
</div>
|
|
</div>
|
|
<div class="card shadow-sm">
|
|
<div class="card-body">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover table-bordered">
|
|
<thead class="table-light">
|
|
<tr><th>ID</th><th>课程名称</th><th>阶段</th><th>每课时单价</th><th>描述</th><th>状态</th><th>操作</th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for c in courses %}
|
|
<tr>
|
|
<td>{{ c.id }}</td>
|
|
<td>{{ c.name }}</td>
|
|
<td><span class="badge bg-info">{{ c.level or '-' }}</span></td>
|
|
<td>¥{{ c.price_per_hour }}</td>
|
|
<td>{{ c.description or '-' }}</td>
|
|
<td>{% if c.status == 1 %}<span class="badge bg-success">启用</span>{% else %}<span class="badge bg-secondary">停用</span>{% endif %}</td>
|
|
<td>
|
|
<a href="{{ url_for('course_edit', id=c.id) }}" class="btn btn-sm btn-warning"><i class="bi bi-pencil"></i></a>
|
|
<form method="POST" action="{{ url_for('course_delete', id=c.id) }}" style="display:inline;" onsubmit="return confirm('确定停用该课程?')">
|
|
<button type="submit" class="btn btn-sm btn-danger"><i class="bi bi-x-circle"></i></button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
{% if not courses %}
|
|
<tr><td colspan="7" class="text-center text-muted">暂无课程数据</td></tr>
|
|
{% endif %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|