<% if @match.score1 and @match.score2 %>

<%= namelink @match.contester1.team if @match.contester1 %>

<%= h @match.score1 %>
<%= h @match.score2 %>

<%= namelink @match.contester2.team if @match.contester2 %>

<% else %>

<%= namelink @match.contester1.team if @match.contester1 %>

VS

<%= namelink @match.contester2.team if @match.contester2 %>

<% end %>
<% if @match.team1_lineup.any? || @match.team2_lineup.any? %>
<% if @match.team1_lineup.any? %>
    <% @match.team1_lineup.each do |teamer| %>
  • <% if teamer.user == @match.motm %> <%= icon 'star' %> <% end %> <%= teamer.user.username %> <%= flag teamer.user.country %>
  • <% end %>
<% end %> <% if @match.team2_lineup.any? %>
    <% @match.team2_lineup.each do |teamer| %>
  • <%= flag teamer.user.country %> <%= teamer.user.username %> <% if teamer.user == @match.motm %> <%= icon 'star' %> <% end %>
  • <% end %>
<% end %>
<% end %>

<%= @match.contest %>

<%= @match.match_time.strftime("%A %e %B %Y") %>
<%= Time.use_zone(timezone_offset) { @match.match_time.strftime("%H:%M %Z") } %>

Predictions (<%= @match.predictions.count %>)

<% if @newpred.can_create? cuser %> <%= form_for @newpred do |f| %> <%= f.hidden_field :match_id %>
<%= f.text_field :score1, size: 1, placeholder: 0 %>
<%= f.text_field :score2, size: 1, placeholder: 0 %>
<%= submit_tag "Add Prediction", class: 'button tiny' %>
<% end %> <% else %>
<%= @match.contester1.team if @match.contester1 %>
<%= @match.preds(1) %>%
<%= @match.preds(2) %>%
<%= @match.contester2.team if @match.contester2 %>
<% end %>
<%= cascade @match, [:server, :demo, :referee] %> Maps
<%= namelink @match.map1 %>, <%= namelink @match.map2 %> <% if @match.caster && @match.caster.profile.stream %>
Stream
<%= link_to @match.caster.profile.stream, @match.caster.profile.stream %>
<% end %>
<% unless @match.report.nil? or @match.report.empty? %>

Match Report

<%= @match.report.html_safe %>

<% end %> <% if cuser and @match.can_update? cuser, [:report] %>
<%= link_to "Referee Admin", match_ref_path(@match), class: 'button' %>
<% end %> <% if cuser and @match.referee.nil? and cuser.ref? %>
<%= form_for @match do |f| %> <%= f.hidden_field :referee_id, value: cuser.id %> <%= f.submit "Signup as referee", class: 'button' %> <% end %>
<% end %>
<%= add_comments @match %>