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

<textarea id="titleVal" style="display:none;">首页</textarea>
<% if (user) { %>
<div style="text-align: right;">
	<a class="ui pink labeled icon button" href="<%= web_util.makeUrl(['season', 0, 'edit']) %>">
		<i class="icon fas fa-plus"></i>新建运动会
	</a>
</div>
<% } %>
<% if (seasons.length) { for (let a of seasons) { %>
<div class="ui segment">
  <div class="post-head">
    <a class="post-title" href="<%= web_util.makeUrl(['season', a.id]) %>"><h1 class="post-title-link"><%= a.title %></h1></a>
  </div>
<div class="ui two mini statistics">
  <div class="ui mini <%= seasonStatus(a.start_time, a.end_time) == 0 ? 'green' : (seasonStatus(a.start_time, a.end_time) == -1 ? 'grey' : 'red') %> statistic">
    <div class="value">
      <%= seasonStatus(a.start_time, a.end_time) == 0 ? '进行中' : (seasonStatus(a.start_time, a.end_time)==-1 ? '已结束' : '未开始' ) %>
    </div>
    <div class="label">
      状态
    </div>
  </div>
  <div class="ui mini statistic">
    <div class="value req">
      <%= a.contest_len %>
    </div>
    <div class="label">
      比赛数
    </div>
  </div>
</div>
<p class="description">
  <% if (a.content) { %><%- a.content %>
  <% } else { %>暂无描述~<% } %>
</p>
<div style="text-align: right;"><a class="req" href="<%= web_util.makeUrl(['season', a.id]) %>">查看更多 ></a></div>

</div>
<% }} else { %>
<div class="ui placeholder segment">
  <div class="ui icon header">
    <i class="fad fa-calendar" style="margin-bottom: 20px; "></i>
    暂无运动会，敬请期待~
  </div>
</div>
<% } %>

<script>

</script>

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