ensl.org/app/views/matches/admin.html.haml

58 lines
2.1 KiB
Text
Raw Permalink Normal View History

2014-05-10 08:44:48 +00:00
- @matches.each do |week, matches|
%h2=week
%table.striped#matches
%tr
%th.opponent Teams
%th.date Date
%th.maps Maps
%th Score
%th Caster
%th Referee
%th.actions Actions
- matches.each do |match|
%tr
%td
= namelink match.contester1.team
vs
= namelink match.contester2.team
%td
= shorttime match.match_time
%td
= match.map1.to_s + " " + match.map2.to_s
%td
= link_to match, :class => "bold #{match.score_color}" do
= h match.score1
\- #{h match.score2}
%td
- if match.caster
= form_for match do |f|
2014-05-10 10:02:57 +00:00
= f.hidden_field :caster_id, {:value => nil}
= namelink match.caster
- if match.can_update?(cuser, {:caster_id => nil})
= link_to "#form_submit" do
%i.fa.fa-times
- elsif match.can_update?(cuser, {:caster_id => cuser.id})
= form_for match do |f|
- if cuser.admin?
2015-11-05 07:59:52 +00:00
= f.collection_select :caster_id, User.casters, :id, :username, {:include_blank => true}, {:class => "autosubmit"}
2014-05-10 10:02:57 +00:00
- else
= f.hidden_field :caster_id, {:value => cuser.id}
= link_to "Take!", "#form_submit"
2014-05-10 08:44:48 +00:00
%td
- if match.referee
= form_for match do |f|
2014-05-10 10:02:57 +00:00
= f.hidden_field :referee_id, {:value => nil}
= namelink match.referee
- if match.can_update?(cuser, {:referee_id => nil})
= link_to "#form_submit" do
%i.fa.fa-times
- elsif match.can_update?(cuser, {:referee_id => cuser.id})
= form_for match do |f|
- if cuser.admin?
= f.collection_select :referee_id, User.refadmins, :id, :username, {:include_blank => true}, {:class => "autosubmit"}
- else
= f.hidden_field :referee_id, {:value => cuser.id}
= link_to "Take!", "#form_submit"
2014-05-10 08:44:48 +00:00
%td.actions
- if cuser.ref? || cuser.admin?
2014-05-10 10:02:57 +00:00
= link_to "Admin", "/matches/ref/#{match.id}"