From f5d36fc67d1994b7cc1ce02e7be2767ffcb47857 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Thu, 6 Mar 2014 17:25:40 -0500 Subject: new generate --- app/views/games/_form.html.erb | 18 +++++++++++----- app/views/games/index.html.erb | 12 +++++++---- app/views/games/index.json.jbuilder | 2 +- app/views/games/show.html.erb | 18 ++++++++++++---- app/views/games/show.json.jbuilder | 2 +- app/views/teams/_form.html.erb | 4 ++++ app/views/teams/index.html.erb | 2 ++ app/views/teams/index.json.jbuilder | 2 +- app/views/teams/show.html.erb | 5 +++++ app/views/teams/show.json.jbuilder | 2 +- app/views/tournaments/_form.html.erb | 28 +++++++++++++++++++++++++ app/views/tournaments/index.html.erb | 14 +++++++++++++ app/views/tournaments/index.json.jbuilder | 2 +- app/views/tournaments/show.html.erb | 35 +++++++++++++++++++++++++++++++ app/views/tournaments/show.json.jbuilder | 2 +- 15 files changed, 129 insertions(+), 19 deletions(-) (limited to 'app/views') 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 %>
- <%= f.label :players_per_team %>
- <%= f.number_field :players_per_team %> + <%= f.label :min_players_per_team %>
+ <%= f.number_field :min_players_per_team %>
- <%= f.label :teams_per_match %>
- <%= f.number_field :teams_per_match %> + <%= f.label :max_players_per_team %>
+ <%= f.number_field :max_players_per_team %> +
+
+ <%= f.label :min_teams_per_match %>
+ <%= f.number_field :min_teams_per_match %> +
+
+ <%= f.label :max_teams_per_match %>
+ <%= f.number_field :max_teams_per_match %>
<%= f.label :set_rounds %>
@@ -29,7 +37,7 @@
<%= f.label :randomized_teams %>
- <%= f.number_field :randomized_teams %> + <%= f.check_box :randomized_teams %>
<%= 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 @@ Name - Players per team - Teams per match + Min players per team + Max players per team + Min teams per match + Max teams per match Set rounds Randomized teams @@ -18,8 +20,10 @@ <% @games.each do |game| %> <%= game.name %> - <%= game.players_per_team %> - <%= game.teams_per_match %> + <%= game.min_players_per_team %> + <%= game.max_players_per_team %> + <%= game.min_teams_per_match %> + <%= game.max_teams_per_match %> <%= game.set_rounds %> <%= game.randomized_teams %> <%= link_to 'Show', game %> 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 @@

- Players per team: - <%= @game.players_per_team %> + Min players per team: + <%= @game.min_players_per_team %>

- Teams per match: - <%= @game.teams_per_match %> + Max players per team: + <%= @game.max_players_per_team %> +

+ +

+ Min teams per match: + <%= @game.min_teams_per_match %> +

+ +

+ Max teams per match: + <%= @game.max_teams_per_match %>

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 diff --git a/app/views/teams/_form.html.erb b/app/views/teams/_form.html.erb index fd10129..cdd4299 100644 --- a/app/views/teams/_form.html.erb +++ b/app/views/teams/_form.html.erb @@ -11,6 +11,10 @@

<% end %> +
+ <%= f.label :match_id %>
+ <%= f.text_field :match_id %> +
<%= f.submit %>
diff --git a/app/views/teams/index.html.erb b/app/views/teams/index.html.erb index b077e10..6a3188d 100644 --- a/app/views/teams/index.html.erb +++ b/app/views/teams/index.html.erb @@ -3,6 +3,7 @@ + @@ -12,6 +13,7 @@ <% @teams.each do |team| %> + diff --git a/app/views/teams/index.json.jbuilder b/app/views/teams/index.json.jbuilder index b29428b..ca0ec8b 100644 --- a/app/views/teams/index.json.jbuilder +++ b/app/views/teams/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@teams) do |team| - json.extract! team, :id + json.extract! team, :id, :match_id json.url team_url(team, format: :json) end diff --git a/app/views/teams/show.html.erb b/app/views/teams/show.html.erb index 5b18d33..e41692a 100644 --- a/app/views/teams/show.html.erb +++ b/app/views/teams/show.html.erb @@ -1,4 +1,9 @@

<%= notice %>

+

+ Match: + <%= @team.match %> +

+ <%= link_to 'Edit', edit_team_path(@team) %> | <%= link_to 'Back', teams_path %> diff --git a/app/views/teams/show.json.jbuilder b/app/views/teams/show.json.jbuilder index 1538019..8a85dcc 100644 --- a/app/views/teams/show.json.jbuilder +++ b/app/views/teams/show.json.jbuilder @@ -1 +1 @@ -json.extract! @team, :id, :created_at, :updated_at +json.extract! @team, :id, :match_id, :created_at, :updated_at diff --git a/app/views/tournaments/_form.html.erb b/app/views/tournaments/_form.html.erb index 1fd63e9..c2c0ba7 100644 --- a/app/views/tournaments/_form.html.erb +++ b/app/views/tournaments/_form.html.erb @@ -15,6 +15,34 @@ <%= f.label :game_id %>
<%= f.text_field :game_id %> +
+ <%= f.label :min_players_per_team %>
+ <%= f.number_field :min_players_per_team %> +
+
+ <%= f.label :max_players_per_team %>
+ <%= f.number_field :max_players_per_team %> +
+
+ <%= f.label :min_teams_per_match %>
+ <%= f.number_field :min_teams_per_match %> +
+
+ <%= f.label :max_teams_per_match %>
+ <%= f.number_field :max_teams_per_match %> +
+
+ <%= f.label :set_rounds %>
+ <%= f.number_field :set_rounds %> +
+
+ <%= f.label :randomized_teams %>
+ <%= f.check_box :randomized_teams %> +
+
+ <%= f.label :status %>
+ <%= f.number_field :status %> +
<%= f.submit %>
diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index ad2b7cf..dec16d1 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -4,6 +4,13 @@ + + + + + + + @@ -14,6 +21,13 @@ <% @tournaments.each do |tournament| %> + + + + + + + diff --git a/app/views/tournaments/index.json.jbuilder b/app/views/tournaments/index.json.jbuilder index e6f3b49..df8eee4 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 + json.extract! tournament, :id, :game_id, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :status 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 30df788..355bc90 100644 --- a/app/views/tournaments/show.html.erb +++ b/app/views/tournaments/show.html.erb @@ -5,5 +5,40 @@ <%= @tournament.game %>

+

+ Min players per team: + <%= @tournament.min_players_per_team %> +

+ +

+ Max players per team: + <%= @tournament.max_players_per_team %> +

+ +

+ Min teams per match: + <%= @tournament.min_teams_per_match %> +

+ +

+ Max teams per match: + <%= @tournament.max_teams_per_match %> +

+ +

+ Set rounds: + <%= @tournament.set_rounds %> +

+ +

+ Randomized teams: + <%= @tournament.randomized_teams %> +

+ +

+ Status: + <%= @tournament.status %> +

+ <%= link_to 'Edit', edit_tournament_path(@tournament) %> | <%= link_to 'Back', tournaments_path %> diff --git a/app/views/tournaments/show.json.jbuilder b/app/views/tournaments/show.json.jbuilder index 0fe65a6..7bedd4b 100644 --- a/app/views/tournaments/show.json.jbuilder +++ b/app/views/tournaments/show.json.jbuilder @@ -1 +1 @@ -json.extract! @tournament, :id, :game_id, :created_at, :updated_at +json.extract! @tournament, :id, :game_id, :min_players_per_team, :max_players_per_team, :min_teams_per_match, :max_teams_per_match, :set_rounds, :randomized_teams, :status, :created_at, :updated_at -- cgit v1.2.3
Match
<%= team.match %> <%= link_to 'Show', team %> <%= link_to 'Edit', edit_team_path(team) %> <%= link_to 'Destroy', team, method: :delete, data: { confirm: 'Are you sure?' } %>
GameMin players per teamMax players per teamMin teams per matchMax teams per matchSet roundsRandomized teamsStatus
<%= tournament.game %><%= tournament.min_players_per_team %><%= tournament.max_players_per_team %><%= tournament.min_teams_per_match %><%= tournament.max_teams_per_match %><%= tournament.set_rounds %><%= tournament.randomized_teams %><%= tournament.status %> <%= link_to 'Show', tournament %> <%= link_to 'Edit', edit_tournament_path(tournament) %> <%= link_to 'Destroy', tournament, method: :delete, data: { confirm: 'Are you sure?' } %>