<% if (!pjax) { %>
<% this.title = season.title %>
<%- include("head") %>
<% } %>

<textarea id="titleVal" style="display:none;"><%= season.title %></textarea>
	
<div style="text-align: center;" id="season_info">
	<h1 style="font-size: 2.4rem !important"><span class="req">「</span><%= season.title %><span class="req">」</span></h1>
	<% if (user) { %>
		<a class="ui purple labeled icon button" href="<%= web_util.makeUrl(['season', season.id, 'edit']) %>">
			<i class="icon fas fa-edit"></i>修改资料
		</a>
		<a class="ui  pink labeled icon button"
			href="<%= web_util.makeUrl(['season', season.id, 'contest', 0, 'edit']) %>">
			<i class="icon fas fa-plus"></i>新建比赛
		</a>
	<% } %>
	<div class="ui two small statistics">
		<div class="ui <%= seasonStatus(season.start_time, season.end_time) == 0 ? 'green' : (seasonStatus(season.start_time, season.end_time) == -1 ? 'grey' : 'red') %> statistic">
			<div class="value">
				<%= seasonStatus(season.start_time, season.end_time) == 0 ? '进行中' : (seasonStatus(season.start_time, season.end_time)==-1 ? '已结束' : '未开始' ) %>
			</div>
			<div class="label">
				状态
			</div>
		</div>
		<div class="ui statistic">
			<div class="value req" id="contest_num">N/A</div>
			<div class="label">
				比赛数
			</div>
		</div>
	</div>
</div>
<h4 class="ui top attached block header"><i class="fad fa-info-circle status pending"></i>公告</h4>
<div class="ui bottom attached segment" id="season_content">
</div>
<h4 class="ui top attached block header"><i class="fad fa-signal status judgement_failed"></i>比赛列表</h4>
<div class="ui bottom attached segment">
	<table class="ui basic celled center aligned unstackable table">
		<thead>
			<tr>
				<th id="title">名称</th>
				<th id="time">时间</th>
				<th id="rankId">排名</th>
				<% if (user) { %>
					<th>操作</th>
				<% } %>
			</tr>
		</thead>
		<tbody id="season_contests">
		</tbody>
	</table>
	<div class="ui placeholder segment" id="no_contest">
		<div class="ui icon header">
			<i class="fad status judgement_failed fa-calendar-exclamation" style="margin-bottom: 20px; "></i>
			<span class="description">暂无比赛，敬请期待~</span>
		</div>
	</div>
</div>
<div class="ui modal" id="rankingModal">
	<div class="ui header" id="rankingTitle"></div>
	<div class="content ui segment">
		<div class="ui inverted disabled dimmer" id="rankingLoader">
			<div class="ui text pink loader">正在拉取排名...</div>
		</div>
		<table class="ui very basic center aligned unstackable table">
			<thead>
				<tr>
					<th>#</th>
					<th>班级</th>
					<th>选手</th>
					<th>得分</th>
					<th>备注</th>
				</tr>
			</thead>
			<tbody id="rankingContent">
			</tbody>
		</table>
	</div>
	<div class="actions">
		<div class="ui approve pink button">确认</div>
	</div>
</div>

<script>
</script>

<% if (!pjax) { %>
<%- include("foot") %>
<% } %>