From 0eaebadc3d943189bef136bbc2205897c106c507 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Fri, 7 Mar 2014 00:04:38 -0500 Subject: I changed a view --- app/views/matches/show.html.erb | 14 +++++++++++++- app/views/tournaments/_selected.html.erb | 2 +- app/views/tournaments/index.html.erb | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index e95cd07..b31c989 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -1,6 +1,6 @@

Tournament: - <%= @match.tournament %> + <%= @match.tournament.id %>

@@ -8,5 +8,17 @@ <%= @match.name %>

+<% if @tournament.hosts.include?(current_user) %> + <%= form_tag(tournament_match_path(@tournament, @match), method: "put") do %> + + <%= submit_tag("Select winner") %> + <% end %> +<% end %> + <%= link_to 'Edit', edit_tournament_match_path(@tournament, @match) %> | <%= link_to 'Back', tournament_matches_path %> diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index 925e127..9b1b7f8 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -4,7 +4,7 @@ <% @chosen = Game.find_by(params[:game]) %> <% @tournament.attributes.each do |name, value| %> - <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "statuss") %> + <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") %> <% next %> <% end %>

diff --git a/app/views/tournaments/index.html.erb b/app/views/tournaments/index.html.erb index 452d939..d4ef414 100644 --- a/app/views/tournaments/index.html.erb +++ b/app/views/tournaments/index.html.erb @@ -21,7 +21,7 @@ <% @tournaments.each do |tournament| %> - <%= tournament.game %> + <%= tournament.id %> <%= tournament.status %> <%= tournament.min_players_per_team %> <%= tournament.max_players_per_team %> -- cgit v1.2.3-2-g168b From c1f714a479eb7ca9e9125e283361a471dd928278 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Fri, 7 Mar 2014 00:25:38 -0500 Subject: Merge branch 'clean' Conflicts: app/models/match.rb app/views/matches/index.html.erb app/views/matches/show.html.erb db/migrate/20140304043618_create_servers.rb db/migrate/20140304043622_create_matches.rb db/migrate/20140304043624_create_teams.rb db/migrate/20140304043626_create_alerts.rb db/migrate/20140304043629_create_pms.rb db/migrate/20140304043633_create_users.rb db/migrate/20140304043637_create_server_settings.rb db/migrate/20140304043700_create_tournament_options.rb db/migrate/20140307045916_create_servers.rb db/migrate/20140307045922_create_matches.rb db/migrate/20140307045927_create_teams.rb db/migrate/20140307045934_create_alerts.rb db/migrate/20140307045941_create_pms.rb db/migrate/20140307050001_create_users.rb db/migrate/20140307050016_create_server_settings.rb db/migrate/20140307050023_create_tournament_options.rb db/migrate/20140307051752_create_servers.rb db/migrate/20140307051756_create_tournaments.rb db/migrate/20140307051800_create_matches.rb db/migrate/20140307051804_create_teams.rb db/migrate/20140307051808_create_alerts.rb db/migrate/20140307051812_create_pms.rb db/migrate/20140307051816_create_games.rb db/migrate/20140307051820_create_users.rb db/migrate/20140307051824_create_game_attributes.rb db/migrate/20140307051827_create_server_settings.rb db/migrate/20140307051831_create_user_team_pairs.rb db/migrate/20140307051835_create_team_match_pairs.rb db/migrate/20140307051853_add_index_to_users_email.rb db/migrate/20140307051857_add_index_to_users_user_name.rb db/migrate/20140307051901_add_password_digest_to_users.rb db/migrate/20140307051904_add_remember_token_to_users.rb db/migrate/20140307051908_create_tournament_options.rb db/schema.rb generate.sh --- app/views/matches/_form.html.erb | 4 ++++ app/views/matches/index.html.erb | 2 ++ app/views/matches/index.json.jbuilder | 2 +- app/views/matches/show.html.erb | 5 +++++ app/views/matches/show.json.jbuilder | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/matches/_form.html.erb b/app/views/matches/_form.html.erb index c5f1ba8..f1e6047 100644 --- a/app/views/matches/_form.html.erb +++ b/app/views/matches/_form.html.erb @@ -19,6 +19,10 @@ <%= f.label :name %>
<%= f.text_field :name %> +

+ <%= f.label :winner_id %>
+ <%= f.text_field :winner_id %> +
<%= f.submit %>
diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index 0742770..71db08c 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -5,6 +5,7 @@ Tournament Name + Winner @@ -16,6 +17,7 @@ <%= match.tournament %> <%= match.name %> + <%= match.winner %> <%= link_to 'Show', match %> <%= link_to 'Edit', edit_match_path(match) %> <%= link_to 'Destroy', match, method: :delete, data: { confirm: 'Are you sure?' } %> diff --git a/app/views/matches/index.json.jbuilder b/app/views/matches/index.json.jbuilder index 08ae0ef..0b2bfcd 100644 --- a/app/views/matches/index.json.jbuilder +++ b/app/views/matches/index.json.jbuilder @@ -1,4 +1,4 @@ json.array!(@matches) do |match| - json.extract! match, :id, :tournament_id, :name + json.extract! match, :id, :tournament_id, :name, :winner_id json.url match_url(match, format: :json) end diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 0b02ae7..3abb1f7 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -10,5 +10,10 @@ <%= @match.name %>

+

+ Winner: + <%= @match.winner %> +

+ <%= link_to 'Edit', edit_match_path(@match) %> | <%= link_to 'Back', matches_path %> diff --git a/app/views/matches/show.json.jbuilder b/app/views/matches/show.json.jbuilder index 128550f..fe14010 100644 --- a/app/views/matches/show.json.jbuilder +++ b/app/views/matches/show.json.jbuilder @@ -1 +1 @@ -json.extract! @match, :id, :tournament_id, :name, :created_at, :updated_at +json.extract! @match, :id, :tournament_id, :name, :winner_id, :created_at, :updated_at -- cgit v1.2.3-2-g168b From 8fc6b48caccdb8fbfe04e41282444e0b916883b3 Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Fri, 7 Mar 2014 00:38:47 -0500 Subject: luke --- app/views/matches/show.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/views') diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index d8112b7..f5a3686 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -9,14 +9,14 @@

<% if @tournament.hosts.include?(current_user) %> - <%= form_tag(tournament_match_path(@tournament, @match), method: "put") do %> + <%= form_for(@match, method: "put") do |f| %> - <%= submit_tag("Select winner") %> + <%= f.submit("Select winner") %> <% end %> <% end %> -- cgit v1.2.3-2-g168b