app/views/leagues/index.html.haml
- content_for(:title) { 'Leagues' }
- if user_can_edit_leagues?
= link_to new_league_path, class: 'btn btn-secondary pull-right' do
= inline_svg_tag 'open_iconic/plus.svg', class: 'icon mr-2'
Start League
%h1 Leagues
.mb-3
= render 'search'
- unless @games.empty?
%ul.nav.nav-tabs.mb-2
- @games.each_with_index do |game, index|
- klass = index.zero? ? 'active' : ''
%li.nav-item
%a.nav-link{ class: klass, data: { toggle: 'tab' }, href: "##{game.name.parameterize}" }
= game.name
.games.tab-content
- @games.each_with_index do |game, index|
- klass = "tab-pane fade #{index.zero? ? 'show active' : ''} "
- leagues = @leagues[game]
.game{ id: game.name.parameterize, class: klass }
- if leagues.empty?
.container.text-muted.p-3
No leagues found
- else
= render 'league_list', leagues: leagues, game: game