diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-27 13:53:26 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-27 13:53:26 -0400 |
commit | abf98c279674c172fc9064e5013087c72101fad9 (patch) | |
tree | 5e1e5f3989b8c8172443ed493564bbb827d03fb2 /app/views | |
parent | 1e2db1933382a6cbba210c6d69f9497717da03ae (diff) | |
parent | 8c1d3841142f06752cca7b521f420d2838928223 (diff) |
merge
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/games/_form.html.erb | 8 | ||||
-rw-r--r-- | app/views/games/index.html.erb | 4 | ||||
-rw-r--r-- | app/views/games/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/games/show.html.erb | 10 | ||||
-rw-r--r-- | app/views/games/show.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/tournaments/_form.html.erb | 14 | ||||
-rw-r--r-- | app/views/tournaments/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/tournaments/show.html.erb | 6 | ||||
-rw-r--r-- | app/views/tournaments/show.json.jbuilder | 2 |
9 files changed, 10 insertions, 40 deletions
diff --git a/app/views/games/_form.html.erb b/app/views/games/_form.html.erb index b1db0b3..e7def85 100644 --- a/app/views/games/_form.html.erb +++ b/app/views/games/_form.html.erb @@ -36,14 +36,6 @@ <%= f.number_field :max_teams_per_match %> </div> <div class="field"> - <%= f.label :set_rounds %><br> - <%= f.number_field :set_rounds %> - </div> - <div class="field"> - <%= f.label :randomized_teams %><br> - <%= f.check_box :randomized_teams %> - </div> - <div class="field"> <%= f.label :sampling_method %><br> <%= f.text_field :sampling_method %> </div> diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb index 3045325..565320c 100644 --- a/app/views/games/index.html.erb +++ b/app/views/games/index.html.erb @@ -9,8 +9,6 @@ <th>Max players per team</th> <th>Min teams per match</th> <th>Max teams per match</th> - <th>Set rounds</th> - <th>Randomized teams</th> <th>Sampling method</th> <th>Scoring method</th> <th></th> @@ -28,8 +26,6 @@ <td><%= game.max_players_per_team %></td> <td><%= game.min_teams_per_match %></td> <td><%= game.max_teams_per_match %></td> - <td><%= game.set_rounds %></td> - <td><%= game.randomized_teams %></td> <td><%= game.sampling_method %></td> <td><%= game.scoring_method %></td> <td><%= link_to 'Show', game %></td> diff --git a/app/views/games/index.json.jbuilder b/app/views/games/index.json.jbuilder index 7964f2c..0e9769b 100644 --- a/app/views/games/index.json.jbuilder +++ b/app/views/games/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@games) do |game| - json.extract! game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method, :scoring_method + json.extract! game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method json.url game_url(game, format: :json) end diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index 1a18356..4c67493 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -29,16 +29,6 @@ </p> <p> - <strong>Set rounds:</strong> - <%= @game.set_rounds %> -</p> - -<p> - <strong>Randomized teams:</strong> - <%= @game.randomized_teams %> -</p> - -<p> <strong>Sampling method:</strong> <%= @game.sampling_method %> </p> diff --git a/app/views/games/show.json.jbuilder b/app/views/games/show.json.jbuilder index c5fb4ed..981c31e 100644 --- a/app/views/games/show.json.jbuilder +++ b/app/views/games/show.json.jbuilder @@ -1 +1 @@ -json.extract! @game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method, :scoring_method, :created_at, :updated_at +json.extract! @game, :id, :parent_id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method, :created_at, :updated_at diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb index 33ce746..28d9c27 100644 --- a/app/views/tournaments/_form.html.erb +++ b/app/views/tournaments/_form.html.erb @@ -49,7 +49,7 @@ </fieldset> <fieldset><legend>Settings</legend> - <%= fields_for "tournament[settings]", @tournament.settings do |setting_fields| %> + <%= f.fields_for :settings do |setting_fields| %> <% (@tournament.settings.empty? ? @tournament.game.settings : @tournament.settings).each do |setting| %><p> <% name = setting.name.parameterize.underscore %> <%= setting_fields.label name %> @@ -81,22 +81,20 @@ <% end %> </fieldset> - <fieldset><legend>Stages</legend> + <%= f.fields_for :stages do |stages_fields| %><fieldset><legend>Stages</legend> <label for="num_stages">Number of tournament stages</label> <input type="number" name="num_stages" min="1" value="<%= params[:num_stages] ? params[:num_stages].to_i : 1 %>"> <%= submit_tag("Set Stages", :class => "btn") %> - <% for i in 1..(params[:num_stages].to_i) do %> - <%= fields_for "tournament[stages][#{i}]", @tournament.stages[i] do |stage_fields| %> - <fieldset><legend>Stage <%= i %></legend> + <%= stages_fields.fields_for i.to_s do |stage_fields| %><fieldset><legend>Stage <%= i %></legend> <%= stage_fields.label :scheduling_method %> <%= stage_fields.select(:scheduling_method, @tournament.scheduling_methods.map{|method| [method.humanize, method]}) %> <%= stage_fields.label :seeding_method %> <%= stage_fields.select(:seeding_method, @tournament.seeding_methods.map{|method| [method.humanize, method]}) %> - </fieldset> - <% end %> + </fieldset><% end %> <% end %> - </fieldset> + </fieldset><% end %> + <%= f.submit %> <%# render 'stages' %> diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder index bd86e04..c6b9e68 100644 --- a/app/views/tournaments/index.json.jbuilder +++ b/app/views/tournaments/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@tournaments) do |tournament| - json.extract! tournament, :id, :game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method, :scoring_method + json.extract! tournament, :id, :game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method json.url tournament_url(tournament, format: :json) end diff --git a/app/views/tournaments/show.html.erb b/app/views/tournaments/show.html.erb index f79b975..53389bb 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -45,12 +45,6 @@ <%= @tournament.max_teams_per_match %> </p> - -<p> - <strong>Randomized teams:</strong> - <%= @tournament.randomized_teams %> -</p> - <p> <strong>Sampling method:</strong> <!-- TODO --> diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder index ff82412..afc5814 100644 --- a/app/views/tournaments/show.json.jbuilder +++ b/app/views/tournaments/show.json.jbuilder @@ -1 +1 @@ -json.extract! @tournament, :id, :game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :sampling_method, :scoring_method, :created_at, :updated_at +json.extract! @tournament, :id, :game_id, :status, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :sampling_method, :scoring_method, :created_at, :updated_at |