mobile app database models admin_contests admin_dashboard admin_exams admin_posts admin_teacher_applications admin_users apply_contest apply_teacher base chat contest_detail contest_list exam_result forum notifications profile themes
This commit is contained in:
@@ -4,24 +4,26 @@
|
||||
|
||||
{% block admin_content %}
|
||||
<div class="space-y-6">
|
||||
<h1 class="text-2xl font-bold text-slate-900">杯赛管理</h1>
|
||||
<h1 class="text-3xl font-extrabold bg-gradient-to-r from-blue-400 via-purple-400 to-pink-400 bg-clip-text text-transparent">杯赛管理</h1>
|
||||
|
||||
<div class="bg-white shadow-sm rounded-lg border border-slate-200 overflow-hidden">
|
||||
<table class="min-w-full divide-y divide-slate-200">
|
||||
<thead class="bg-slate-50">
|
||||
<tr>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase">ID</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase">名称</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase">主办方</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase">状态</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase">开始日期</th>
|
||||
<th class="px-6 py-3 text-left text-xs font-medium text-slate-500 uppercase">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="contests-tbody" class="bg-white divide-y divide-slate-200">
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="empty-msg" class="text-center py-12 text-slate-400 hidden">暂无杯赛</div>
|
||||
<div class="futuristic-card-dark overflow-hidden">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table-futuristic">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>名称</th>
|
||||
<th>主办方</th>
|
||||
<th>状态</th>
|
||||
<th>开始日期</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="contests-tbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="empty-msg" class="text-center py-12 text-slate-500 hidden">暂无杯赛</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -29,11 +31,11 @@
|
||||
{% block scripts %}
|
||||
<script>
|
||||
const statusMap = {
|
||||
'upcoming': ['即将开始', 'bg-blue-100 text-blue-800'],
|
||||
'registering': ['正在报名', 'bg-green-100 text-green-800'],
|
||||
'ongoing': ['进行中', 'bg-yellow-100 text-yellow-800'],
|
||||
'ended': ['已结束', 'bg-slate-100 text-slate-800'],
|
||||
'abolished': ['已废止', 'bg-red-100 text-red-800']
|
||||
'upcoming': ['即将开始', 'bg-blue-500/20 text-blue-400 border-blue-500/30'],
|
||||
'registering': ['正在报名', 'bg-green-500/20 text-green-400 border-green-500/30'],
|
||||
'ongoing': ['进行中', 'bg-yellow-500/20 text-yellow-400 border-yellow-500/30'],
|
||||
'ended': ['已结束', 'bg-slate-500/20 text-slate-400 border-slate-500/30'],
|
||||
'abolished': ['已废止', 'bg-red-500/20 text-red-400 border-red-500/30']
|
||||
};
|
||||
|
||||
async function loadContests() {
|
||||
@@ -48,18 +50,18 @@ async function loadContests() {
|
||||
}
|
||||
let html = '';
|
||||
data.contests.forEach(c => {
|
||||
const [statusText, statusClass] = statusMap[c.status] || ['未知', 'bg-slate-100 text-slate-800'];
|
||||
const [statusText, statusClass] = statusMap[c.status] || ['未知', 'bg-slate-500/20 text-slate-400 border-slate-500/30'];
|
||||
const abolishBtn = c.status !== 'abolished'
|
||||
? `<button onclick="abolishContest(${c.id}, '${c.name.replace(/'/g, "\\'")}')" class="px-2 py-1 text-xs bg-red-100 text-red-700 border border-red-300 rounded hover:bg-red-200">废止</button>`
|
||||
? `<button onclick="abolishContest(${c.id}, '${c.name.replace(/'/g, "\\'")}')" class="btn-outline-futuristic px-3 py-1 text-xs border-red-500/30 text-red-400 hover:bg-red-500/20 hover:border-red-500/50">废止</button>`
|
||||
: '<span class="text-xs text-red-500">已废止</span>';
|
||||
html += `<tr>
|
||||
<td class="px-6 py-4 text-sm text-slate-900">${c.id}</td>
|
||||
<td class="px-6 py-4 text-sm text-slate-900">${c.name}</td>
|
||||
<td class="px-6 py-4 text-sm text-slate-500">${c.organizer || '-'}</td>
|
||||
<td class="px-6 py-4"><span class="px-2 py-1 text-xs rounded-full ${statusClass}">${statusText}</span></td>
|
||||
<td class="px-6 py-4 text-sm text-slate-500">${c.start_date || '-'}</td>
|
||||
<td class="px-6 py-4 space-x-2">
|
||||
<a href="/contests/${c.id}" class="text-xs text-primary hover:underline">查看</a>
|
||||
<td>${c.id}</td>
|
||||
<td class="font-medium text-slate-200">${c.name}</td>
|
||||
<td class="text-slate-400">${c.organizer || '-'}</td>
|
||||
<td><span class="badge-futuristic ${statusClass}">${statusText}</span></td>
|
||||
<td class="text-slate-400">${c.start_date || '-'}</td>
|
||||
<td class="space-x-2">
|
||||
<a href="/contests/${c.id}" class="text-xs text-cyan-400 hover:text-cyan-300 hover:underline">查看</a>
|
||||
${abolishBtn}
|
||||
</td>
|
||||
</tr>`;
|
||||
|
||||
Reference in New Issue
Block a user