From 7eff9bd40e71ad8b73dc2dd1818fd668e7b09338 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Sat, 5 Apr 2014 15:53:45 -0400 Subject: Updated Settings, renaming, tournament views and misc. --- app/views/tournaments/_selected.html.erb | 33 +++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'app/views') diff --git a/app/views/tournaments/_selected.html.erb b/app/views/tournaments/_selected.html.erb index 8a704b5..3661077 100644 --- a/app/views/tournaments/_selected.html.erb +++ b/app/views/tournaments/_selected.html.erb @@ -2,18 +2,37 @@ <%= render "common/error_messages", :target => @tournament %> <%= f.hidden_field(:game_id) %> - <% @chosen = Game.find_by(params[:game]) %> + <% @game = Game.find_by(params[:game]) %> <% @tournament.attributes.each do |name, value| %> <% if (name == "id") or (name =~ /.*_at$/) or (name == "game_id") or (name == "status") or (name == "set_rounds") %> <% next %> <% end %>

- <%= f.label name %>
- <% if !@chosen.attributes[name].nil? %> - <%= f.text_field(name, :value => @chosen.attributes[name] ) %> - <% else %> - <%= f.text_field name %> - <% end %> + <%= f.label name %>
+ <% if !@game.attributes[name].nil? %> + <%= f.text_field(name, :value => @game.attributes[name] ) %> + <% else %> + <%= f.text_field name %> + <% end %> +

+ <% end %> + + <% @settings = GameSetting.find_by(params[:game_id]) %> + <% unless @settings %> +
+
+
+
+
+
+
+
+ <% end %> + <% @settings.each do |setting| %> +

+ <%= f.label setting.name %>
+ <% #eventually display by non-generic input method %> + <%= f.select :setting options_from_collection_for_select([setting.description, ""].append setting.type_opt.split(',')) %>

<% end %> -- cgit v1.2.3-2-g168b From 6cbbb7833ea55123389356579ccccbc59dde4db9 Mon Sep 17 00:00:00 2001 From: guntasgrewal Date: Sat, 5 Apr 2014 19:56:18 -0400 Subject: Match status 1 page --- app/views/matches/index.html.erb | 1 + app/views/matches/show.html.erb | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/matches/index.html.erb b/app/views/matches/index.html.erb index d4ddb0e..219507d 100644 --- a/app/views/matches/index.html.erb +++ b/app/views/matches/index.html.erb @@ -18,6 +18,7 @@ <%= match.id%> <%= match.name %> <%= link_to "Show", tournament_match_path(@tournament, match) %> + <%= submit_tag("Start Match") %> <% end %> diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 4973dc3..6fb4042 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -38,11 +38,40 @@ <%= team.users.collect{|u| u.user_name}.join(", ") %> <% end %> - <%= f.submit("Select winner") %> + <%= f.submit("Select Winner") %> <% end %> <% end %> + +<% if (@match.status==0) %> + <% if (@tournament.players.include?(current_user) || @tournament.hosts.include?(current_user)) %> + <% @match.teams.each do |team| %> + + <% end %> + <% end %> +<% end %> + +<% if (@match.status==0) %> + <% if (@tournament.players.include?(current_user) %> + <% @match.teams.each do |team| %> + + <% end %> + <% end %> +<% end %> <% unless @match.winner.nil? %>

-- cgit v1.2.3-2-g168b