ozfortress/citadel

View on GitHub
app/views/leagues/matches/_matches_table.html.haml

Summary

Maintainability
Test Coverage

- if matches.empty?
  .py-2.text-muted
    No matches scheduled

- else
  .table-responsive
    %table.table.matches-table
      %thead
        %th Round
        %th.home-team Home Team
        %th.vs vs
        %th.away-team Away Team
        %th

      %tbody
        - matches.each do |match|
          - match_p = present(match)
          %tr
            %td.name
              = match_p.short_round_s

            %td.home-team
              = match_p.home_team.link

            - if match.bye?
              %td.vs BYE
              %td.away-team
            - else
              %td.vs
                - if match.confirmed?
                  - if match.no_forfeit?
                    - present_collection(match.rounds).each do |round_p|
                      = round_p.result(roster)
                  - else
                    = match_p.forfeit_s

              %td.away-team
                = match_p.away_team.link

            %td.match-page
              = match_p.link('Match Page')