2014-04-21 18:19:03 +00:00
|
|
|
<h1 class="fancy">
|
|
|
|
<span><%= @contest.name %></span>
|
|
|
|
</h1>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-21 18:19:03 +00:00
|
|
|
<% content_for :sidebar do %>
|
|
|
|
<div class="widget contest">
|
|
|
|
<h4>Contest Details</h4>
|
2014-04-15 09:59:52 +00:00
|
|
|
|
2014-04-21 18:19:03 +00:00
|
|
|
<dl>
|
|
|
|
<dt>Start - End</dt>
|
|
|
|
<dd>
|
|
|
|
<%= longdate @contest.start %><br>
|
|
|
|
<%= longdate @contest.end %>
|
|
|
|
</dd>
|
|
|
|
<dt>Rules</dt>
|
|
|
|
<dd><%= namelink @contest.rules %></dd>
|
|
|
|
<dt>Status</dt>
|
|
|
|
<dd><%= @contest.statuses[@contest.status] %></dd>
|
|
|
|
<dt>Default</dt>
|
|
|
|
<dd>Sunday: <%= Time.use_zone(timezone_offset) { @contest.default_time.strftime("%H:%M %Z") } %></dd>
|
|
|
|
</dl>
|
2014-04-15 09:59:52 +00:00
|
|
|
|
2017-10-08 12:46:45 +00:00
|
|
|
<%= link_to 'Scheduled Matches', confirmed_matches_path(@contest), class: 'button' %>
|
|
|
|
|
2014-04-21 18:19:03 +00:00
|
|
|
<% if cuser and cuser.admin? %>
|
|
|
|
<%= link_to 'Edit Contest', edit_contest_path(@contest), class: 'button' %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<div class="standings">
|
|
|
|
<% if @contest.contest_type == Contest::TYPE_BRACKET %>
|
|
|
|
<%= render partial: 'bracket', locals: { contest: @contest } %>
|
2015-05-16 13:54:14 +00:00
|
|
|
<% elsif @contest.contest_type == Contest::TYPE_LADDER %>
|
|
|
|
<%= render partial: "contesters/ladder",
|
|
|
|
locals: { actions: true, contest: @contest } %>
|
2014-04-21 18:19:03 +00:00
|
|
|
<% else %>
|
|
|
|
<%= render partial: 'normal' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
2014-04-15 09:59:52 +00:00
|
|
|
<div id="contest" class="tabbed">
|
|
|
|
<ul id="contest-nav" class="tabs">
|
2014-03-23 00:22:25 +00:00
|
|
|
<li><a href="#results">Matches</a></li>
|
|
|
|
<li><a href="#predictions">Predictions</a></li>
|
|
|
|
<li><a href="#maps">Maps</a></li>
|
|
|
|
</ul>
|
|
|
|
|
2014-04-15 09:59:52 +00:00
|
|
|
<div class="tabbed-contents">
|
2014-03-23 00:22:25 +00:00
|
|
|
<div class="tab" id="results">
|
|
|
|
<h3>
|
|
|
|
Matches Played
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
<% if @contest.weeks.count > 0 %>
|
2014-04-25 22:15:15 +00:00
|
|
|
<table class="striped weeks">
|
2014-03-23 00:22:25 +00:00
|
|
|
<% @contest.weeks.ordered.each do |week| %>
|
2014-04-21 18:19:03 +00:00
|
|
|
<% next if week.matches.realfinished.size == 0 %>
|
2014-03-23 00:22:25 +00:00
|
|
|
<tr>
|
2014-04-25 22:15:15 +00:00
|
|
|
<th class="week"><%= week.name %></th>
|
|
|
|
<th class="date">Date</th>
|
|
|
|
<th class="score">Score</th>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% if @contest.contest_type == Contest::TYPE_LADDER %>
|
2014-04-25 22:15:15 +00:00
|
|
|
<th class="points">Points</th>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
<% week.matches.realfinished.ordered.reverse_each do |match| %>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<%= namelink match.contester1.team if match.contester1 %>
|
|
|
|
vs
|
|
|
|
<%= namelink match.contester2.team if match.contester1 %>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%= shorttime match.match_time %>
|
|
|
|
</td>
|
2014-04-25 22:15:15 +00:00
|
|
|
<td class="score">
|
2014-03-23 00:22:25 +00:00
|
|
|
<%= link_to match, :class => "bold #{match.score_color}" do %>
|
|
|
|
<b><%= h match.score1 %> - <%= h match.score2 %></b>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
<% if @contest.contest_type == Contest::TYPE_LADDER %>
|
2014-04-25 22:15:15 +00:00
|
|
|
<td class="points">
|
2018-02-12 22:21:08 +00:00
|
|
|
<%= match.points1 || 0 %> / <%= match.points2 || 0 %>
|
2014-03-23 00:22:25 +00:00
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
<% else %>
|
2014-04-25 22:15:15 +00:00
|
|
|
<table class="striped teams">
|
2014-03-23 00:22:25 +00:00
|
|
|
<tr>
|
2014-04-25 22:15:15 +00:00
|
|
|
<th class="team">Teams</th>
|
|
|
|
<th class="date">Date</th>
|
|
|
|
<th class="score">Score</th>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% if @contest.contest_type == Contest::TYPE_LADDER %>
|
2014-04-25 22:15:15 +00:00
|
|
|
<th class="points">Points</th>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% @contest.matches.realfinished.ordered.each do |match| %>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<%= namelink match.contester1.team %>
|
|
|
|
vs
|
|
|
|
<%= namelink match.contester2.team %>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%= shorttime match.match_time %>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<%= link_to(match) do %>
|
|
|
|
<b><%= h match.score1 %> - <%= h match.score2 %></b>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
<% if @contest.contest_type == Contest::TYPE_LADDER %>
|
|
|
|
<td>
|
2018-02-12 22:21:08 +00:00
|
|
|
<%= match.points1 || 0 %> / <%= match.points2 || 0 %>
|
2014-03-23 00:22:25 +00:00
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if @contest.matches.unfinished.ordered.count > 0 %>
|
|
|
|
<h3>
|
|
|
|
Matches to be played
|
|
|
|
</h3>
|
|
|
|
|
2014-04-25 22:15:15 +00:00
|
|
|
<table class="striped matches">
|
2014-03-23 00:22:25 +00:00
|
|
|
<tr>
|
2014-04-25 22:15:15 +00:00
|
|
|
<th class="team">Teams</th>
|
|
|
|
<th class="date">Date</th>
|
2014-03-23 00:22:25 +00:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% @contest.matches.unfinished.ordered.reverse_each do |match| %>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<%= namelink match.contester1.team if match.contester1 %>
|
|
|
|
vs
|
|
|
|
<%= namelink match.contester2.team if match.contester2 %>
|
|
|
|
</td>
|
2014-04-25 22:15:15 +00:00
|
|
|
<td class="date">
|
2014-03-23 00:22:25 +00:00
|
|
|
<%= link_to shorttime(match.match_time), match %>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab" id="predictions">
|
2014-04-25 22:15:15 +00:00
|
|
|
<table class="striped predictions">
|
2014-03-23 00:22:25 +00:00
|
|
|
<tr>
|
2014-04-25 22:15:15 +00:00
|
|
|
<th class="user">User</th>
|
|
|
|
<th class="result">Result</th>
|
2014-03-23 00:22:25 +00:00
|
|
|
</tr>
|
|
|
|
<% @contest.preds_with_score.each do |prediction| %>
|
|
|
|
<tr>
|
|
|
|
<td><%= namelink prediction.user %></td>
|
2014-04-25 22:15:15 +00:00
|
|
|
<td class="result"><%= prediction.correct %> / <%= prediction.total %> correct (<%= prediction.score.to_f.round(2) %>%)</td>
|
2014-03-23 00:22:25 +00:00
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="tab" id="maps">
|
2014-04-25 22:15:15 +00:00
|
|
|
<ul class="disc">
|
2014-03-23 00:22:25 +00:00
|
|
|
<% @contest.maps.each do |map| %>
|
|
|
|
<li><%= map %></li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2014-04-15 09:59:52 +00:00
|
|
|
new Yetii({
|
|
|
|
id: 'contest'
|
|
|
|
});
|
2014-03-23 00:22:25 +00:00
|
|
|
</script>
|