summaryrefslogtreecommitdiff
path: root/app/views/games
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 19:41:29 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-06 19:41:29 -0500
commitd72452a5965c0df32a13053ae86bcd529fc0fc9e (patch)
treefb03041e6cf5d8b56d308481492821af8e663028 /app/views/games
parent50371ba04b52f74bfc2ceb05a429e072ad4848bb (diff)
parentf5d36fc67d1994b7cc1ce02e7be2767ffcb47857 (diff)
Merge branch 'master' of github.com:LukeShu/leaguer
Conflicts: app/controllers/tournaments_controller.rb app/models/tournament.rb app/views/tournaments/_selected.html.erb app/views/tournaments/new.html.erb db/migrate/20140306024707_create_servers.rb db/migrate/20140306024711_create_matches.rb db/migrate/20140306024713_create_teams.rb db/migrate/20140306024715_create_alerts.rb db/migrate/20140306024718_create_pms.rb db/migrate/20140306024722_create_users.rb db/migrate/20140306024724_create_sessions.rb db/migrate/20140306024729_create_server_settings.rb db/migrate/20140306024731_create_user_team_pairs.rb db/migrate/20140306024733_create_team_match_pairs.rb db/migrate/20140306024735_create_tournament_options.rb db/migrate/20140306024744_add_hidden_attrs_to_user.rb db/migrate/20140306202154_create_servers.rb db/migrate/20140306202156_create_tournaments.rb db/migrate/20140306202158_create_matches.rb db/migrate/20140306202200_create_teams.rb db/migrate/20140306202202_create_alerts.rb db/migrate/20140306202204_create_pms.rb db/migrate/20140306202207_create_games.rb db/migrate/20140306202209_create_users.rb db/migrate/20140306202211_create_sessions.rb db/migrate/20140306202213_create_game_attributes.rb db/migrate/20140306202215_create_server_settings.rb db/migrate/20140306202217_create_tournament_options.rb db/migrate/20140306202219_create_user_team_pairs.rb db/migrate/20140306202224_create_team_match_pairs.rb db/migrate/20140306202232_add_hidden_attrs_to_user.rb db/migrate/20140306222309_create_servers.rb db/migrate/20140306222320_create_matches.rb db/migrate/20140306222325_create_teams.rb db/migrate/20140306222330_create_alerts.rb db/migrate/20140306222336_create_pms.rb db/migrate/20140306222347_create_users.rb db/migrate/20140306222352_create_sessions.rb db/migrate/20140306222357_create_server_settings.rb db/migrate/20140306222402_create_tournament_options.rb db/migrate/20140306222422_create_user_team_pairs.rb db/migrate/20140306222427_create_team_match_pairs.rb db/migrate/20140306222447_add_hidden_attrs_to_user.rb db/schema.rb generate.sh
Diffstat (limited to 'app/views/games')
-rw-r--r--app/views/games/_form.html.erb18
-rw-r--r--app/views/games/index.html.erb12
-rw-r--r--app/views/games/index.json.jbuilder2
-rw-r--r--app/views/games/show.html.erb18
-rw-r--r--app/views/games/show.json.jbuilder2
5 files changed, 37 insertions, 15 deletions
diff --git a/app/views/games/_form.html.erb b/app/views/games/_form.html.erb
index 8941c59..f68e28f 100644
--- a/app/views/games/_form.html.erb
+++ b/app/views/games/_form.html.erb
@@ -16,12 +16,20 @@
<%= f.text_area :name %>
</div>
<div class="field">
- <%= f.label :players_per_team %><br>
- <%= f.number_field :players_per_team %>
+ <%= f.label :min_players_per_team %><br>
+ <%= f.number_field :min_players_per_team %>
</div>
<div class="field">
- <%= f.label :teams_per_match %><br>
- <%= f.number_field :teams_per_match %>
+ <%= f.label :max_players_per_team %><br>
+ <%= f.number_field :max_players_per_team %>
+ </div>
+ <div class="field">
+ <%= f.label :min_teams_per_match %><br>
+ <%= f.number_field :min_teams_per_match %>
+ </div>
+ <div class="field">
+ <%= f.label :max_teams_per_match %><br>
+ <%= f.number_field :max_teams_per_match %>
</div>
<div class="field">
<%= f.label :set_rounds %><br>
@@ -29,7 +37,7 @@
</div>
<div class="field">
<%= f.label :randomized_teams %><br>
- <%= f.number_field :randomized_teams %>
+ <%= f.check_box :randomized_teams %>
</div>
<div class="actions">
<%= f.submit %>
diff --git a/app/views/games/index.html.erb b/app/views/games/index.html.erb
index ccd0f63..27c5860 100644
--- a/app/views/games/index.html.erb
+++ b/app/views/games/index.html.erb
@@ -4,8 +4,10 @@
<thead>
<tr>
<th>Name</th>
- <th>Players per team</th>
- <th>Teams per match</th>
+ <th>Min players per team</th>
+ <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></th>
@@ -18,8 +20,10 @@
<% @games.each do |game| %>
<tr>
<td><%= game.name %></td>
- <td><%= game.players_per_team %></td>
- <td><%= game.teams_per_match %></td>
+ <td><%= game.min_players_per_team %></td>
+ <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><%= link_to 'Show', game %></td>
diff --git a/app/views/games/index.json.jbuilder b/app/views/games/index.json.jbuilder
index 7e5c1a1..f8b3e96 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, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams
+ json.extract! game, :id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams
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 7986016..1f1a154 100644
--- a/app/views/games/show.html.erb
+++ b/app/views/games/show.html.erb
@@ -6,13 +6,23 @@
</p>
<p>
- <strong>Players per team:</strong>
- <%= @game.players_per_team %>
+ <strong>Min players per team:</strong>
+ <%= @game.min_players_per_team %>
</p>
<p>
- <strong>Teams per match:</strong>
- <%= @game.teams_per_match %>
+ <strong>Max players per team:</strong>
+ <%= @game.max_players_per_team %>
+</p>
+
+<p>
+ <strong>Min teams per match:</strong>
+ <%= @game.min_teams_per_match %>
+</p>
+
+<p>
+ <strong>Max teams per match:</strong>
+ <%= @game.max_teams_per_match %>
</p>
<p>
diff --git a/app/views/games/show.json.jbuilder b/app/views/games/show.json.jbuilder
index 1a2d0c7..e689e7b 100644
--- a/app/views/games/show.json.jbuilder
+++ b/app/views/games/show.json.jbuilder
@@ -1 +1 @@
-json.extract! @game, :id, :name, :players_per_team, :teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at
+json.extract! @game, :id, :name, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :created_at, :updated_at