ensl.org/app/views/matches/_form.html.erb

38 lines
1.3 KiB
Text

<div class="wide box">
<%= form_for @match do |f| %>
<%= f.error_messages %>
<%= f.hidden_field :contest_id %>
<p>
<%= f.label :contester1_id, "Team #1" %><br />
<%= f.select :contester1_id, @match.contest.contesters.active.collect{|c| ["#{c.team.name}", c.id]} %>
</p>
<p>
<%= f.label :contester2_id, "Team #2" %><br />
<%= f.select :contester2_id, @match.contest.contesters.active.collect{|c| ["#{c.team.name}", c.id]} %>
</p>
<p>
<%= f.label :map1_id, "Team 1's map" %><br />
<%= f.select :map1_id, @match.contest.maps.basic.collect{|m| [m.name, m.id]} %>
</p>
<p>
<%= f.label :map2_id, "Team 2's map" %><br />
<%= f.select :map2_id, @match.contest.maps.basic.collect{|m| [m.name, m.id]} %>
</p>
<p>
<%= f.label :match_time %><br />
<%= f.datetime_select :match_time %>
</p>
<p>
<%= f.label :referee_id %><br />
<%= f.select :referee_id, Group.find(Group::REFEREES).users.collect{|u| [u, u.id]}, {:include_blank => true} %>
</p>
<p>
<%= f.label :week_id %><br />
<%= f.select :week_id, @match.contest.weeks.ordered.collect{|w| [w, w.id]}, {:include_blank => true} %>
</p>
<p>
<%= f.submit 'Save' %>
</p>
<% end %>
</div>