app/views/leagues/matches/generate.html.haml
- content_for(:title) { "Generate Round | #{@league.name}" }
- league_p = present(@league)
%h1
= league_p.link
Generate Round
.mb-5
= bootstrap_form_for @match, as: :match, url: generate_league_matches_path(@league) do |f|
= f.errors_on :base
.card.mb-3
.card-header Generation Settings
.card-body
.form-group
%label.control-label Division
= select_tag 'division_id', division_select, class: 'form-control'
.form-group
%label.control-label Tournament System
= select_tag 'tournament_system', tournament_system_select, class: 'form-control',
data: { toggle: 'tab' }
.tab-content
- tournament_systems.each do |system|
- klass = system == @tournament_system ? 'active' : ''
.tab-pane{ id: system, class: klass }
- data_name = "#{system}_tournament".to_sym
- value = instance_variable_get("@#{data_name}")
= render "leagues/matches/tournament_systems/#{system}_form", f: f, data_name => value
= render 'match_form', f: f, div: @division, no_team_fields: true
.d-flex.justify-content-end
= link_to 'Cancel', league_matches_path(@league), class: 'btn btn-link mr-2'
= f.primary 'Generate'