diff options
author | guntasgrewal <guntasgrewal@gmail.com> | 2014-03-06 17:25:40 -0500 |
---|---|---|
committer | guntasgrewal <guntasgrewal@gmail.com> | 2014-03-06 17:25:40 -0500 |
commit | f5d36fc67d1994b7cc1ce02e7be2767ffcb47857 (patch) | |
tree | 03afe3bea27d2963525d7509690ec6b39e5648f9 /app/views/games | |
parent | d0545c2820d101a98b3c895cf6e3691145a62f3c (diff) |
new generate
Diffstat (limited to 'app/views/games')
-rw-r--r-- | app/views/games/_form.html.erb | 18 | ||||
-rw-r--r-- | app/views/games/index.html.erb | 12 | ||||
-rw-r--r-- | app/views/games/index.json.jbuilder | 2 | ||||
-rw-r--r-- | app/views/games/show.html.erb | 18 | ||||
-rw-r--r-- | app/views/games/show.json.jbuilder | 2 |
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 |