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/models/user.rb | 3 +++ app/views/matches/index.html.erb | 1 + app/views/matches/show.html.erb | 31 ++++++++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/user.rb b/app/models/user.rb index d1698bd..56c78b4 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,8 +16,11 @@ class User < ActiveRecord::Base def can?(action) case action when :create_tournament + return true when :edit_tournament + return true when :join_tournament + return true when :delete_tournament when :create_game 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