Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b042e4a090
Fetching contributors…

Cannot retrieve contributors at this time

file 118 lines (110 sloc) 2.737 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
%p#notice
  = notice

%p
  %h1
    - if @match.first_bot_id
      = Sumobot.find(@match.first_bot_id).botname
    - else
      = "TBD"
    - if @match.second_bot_from_match == -1
      Bye Round
    - else
      Versus
      - if @match.second_bot_id
        = Sumobot.find(@match.second_bot_id).botname
      - else
        = "TBD"


- if @match.tournament_id then
  %b
    = link_to "Tournament Match", tournament_path(@match.tournament_id)
    %br

- if @match.second_bot_from_match == -1
  %p
    This is a bye match and is just a place holder
  %p
    =link_to "Process Bye", :action => "process_bye"

- if @match.winning_bot then
  %b
    = Sumobot.find(@match.winning_bot).botname
    Wins!!
- elsif not @match.second_bot_from_match == -1
  %table
    %tr
      %td
        = "Round #{@match.round}"
      %td
        Time Remaining
        %br
        -if @match.start then
  
        -else
          Match not started

%table
  %tr
    %th
    %th
      - if @match.first_bot_id
        = Sumobot.find(@match.first_bot_id).botname
      - else
        = "TBD"
    %th
      - if @match.second_bot_id
        = Sumobot.find(@match.second_bot_id).botname
      - else
        = "TBD"
  %tr
    %td
      Round 1
    %td
      = @match.first_bot_round1_score
    %td
      = @match.second_bot_round1_score
  - if @match.round > 1 then
    %tr
      %td
        Round 2
      %td
        = @match.first_bot_round2_score
      %td
        = @match.second_bot_round2_score
    - if @match.round > 2 then
      %tr
        %td
          Round 3
        %td
          = @match.first_bot_round3_score
        %td
          = @match.second_bot_round3_score
      - if @match.winning_bot then
        %tr
          %td
            %b
              Final
          %td
            = @match.bot1_final_score
          %td
            = @match.bot2_final_score
    -elsif @match.winning_bot then
      %tr
        %td
          %b
            Final
        %td
          = @match.bot1_final_score
        %td
          = @match.bot2_final_score

%br
- if can? :manage, @match then
  - if not @match.winning_bot then
    - if @match.first_bot_id and @match.second_bot_id
      = link_to 'Start Round', :action => "start_round"
      |
      = link_to "Grant #{Sumobot.find(@match.first_bot_id).botname} a point", :action => "grant_point", :bot_id => @match.first_bot_id
      |
      = link_to "Grant #{Sumobot.find(@match.second_bot_id).botname} a point", :action => "grant_point", :bot_id => @match.second_bot_id
      |
  = link_to 'Delete Match Info', @match, :confirm => 'Are you sure?', :method => :delete
  |
- if @match.tournament_id
  = link_to 'Back', tournament_path(@match.tournament_id)
- else
  = link_to 'Back', matches_path
Something went wrong with that request. Please try again.