diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/layouts/application.html.erb | 5 | ||||
-rw-r--r-- | app/views/matches/show.html.erb | 38 |
2 files changed, 18 insertions, 25 deletions
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6d1d7f4..de9f3b8 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -8,6 +8,11 @@ <%= yield :head %> </head> <body> +<script> + window.onload = function() { + BetterDragSort.makeListSortable(document.getElementById("boxes")); + }; +</script> <header><nav> <div class="navbar-brand"><%= link_to('Leaguer', root_path) %></div> <div> diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 20860e2..ffa7682 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -2,7 +2,6 @@ <strong>Status:</strong> <%= @match.status %> </p> - <p> <strong>Tournament:</strong> <%= @match.tournament.id %> @@ -27,49 +26,38 @@ Note:- The change of status from 1 to 2 is coming from League Data Pull (RIOT API) --> -<!-- - This is what the HOST will see when the Match Status is NOT 3 ---> -<% if (@tournament.hosts.include?(current_user) and @match.winner.nil?) %> - <%= form_for([@tournament, @match], method: "put") do |f| %> - <ul> - <% @match.teams.each do |team| %> - <li><label><%= f.radio_button(:winner, team.id) %> - <%= team.users.collect{|u| u.user_name}.join(", ") %></label></li> - <% end %> - </ul> - <%= f.submit("Select Winner") %> - <% end %> -<% end %> <!-- This is what the Players and the Hosts of the tournament will view when the Match Status is 0 --> -<% if (@match.status==0) %> +<% if (@match.status==1) %> <% if (@tournament.players.include?(current_user) || @tournament.hosts.include?(current_user)) %> <% @match.teams.each do |team| %> - <ul> + <ol> <% team.users.collect{|u| u.user_name}.each do |k| %> - <li><label><%= k %></label></li> + <li><%= k %></li> <% end %> - </ul> + </ol> <% end %> <% end %> <% end %> <!-- + When Match Status is 2 Players see the Peer Review Page Host see the Game Status --> -<% if @match.status == 0 %> - <% if @tournament.players.include?(current_user) %> +<% if (@match.status==0) %> + <% if (@tournament.players.include?(current_user)) %> <% @match.teams.each do |team| %> - <ul> + <ol id="boxes" class="sortable"> <% team.users.collect{|u| u.user_name}.each do |k| %> - <li><label><%= k %></label></li> + <li><%= k %></li> <% end %> - </ul> - <% end %> + </ol> + <% end %> + <% elsif (@tournament.hosts.include?(current_user)) %> + <label>Game Status Page Goes here! Because you are a Host that is not a player!</label> <% end %> <% end %> |