1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Updating calculating team scores as a put

This commit is contained in:
2021-12-21 02:04:55 +00:00
parent 1c8e3af5f4
commit 194fbca978
5 changed files with 4 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ class TournamentsController < ApplicationController
respond_to do |format| respond_to do |format|
if @tournament.calculate_all_team_scores if @tournament.calculate_all_team_scores
format.html { redirect_to "/tournaments/#{@tournament.id}", notice: 'Team scores are calcuating.' } format.html { redirect_to "/tournaments/#{@tournament.id}", notice: 'Team scores are calcuating.' }
format.json { render action: 'show', status: :created, location: @tournament } format.json { head :no_content }
end end
end end
end end
@@ -27,7 +27,7 @@ class TournamentsController < ApplicationController
respond_to do |format| respond_to do |format|
if WrestlingdevImporter.new(@tournament,import_text).import if WrestlingdevImporter.new(@tournament,import_text).import
format.html { redirect_to "/tournaments/#{@tournament.id}", notice: 'Import is on-going. This will take 1-5 minutes.' } format.html { redirect_to "/tournaments/#{@tournament.id}", notice: 'Import is on-going. This will take 1-5 minutes.' }
format.json { render action: 'show', status: :created, location: @tournament } format.json { head :no_content }
end end
end end
end end

View File

@@ -1 +0,0 @@
<script src="//instant.page/5.1.0" type="module" integrity="sha384-by67kQnR+pyfy8yWP4kPO12fHKRLHZPfEsiSXR8u2IKcTdxD805MGUXBzVPnkLHw"></script>

View File

@@ -45,7 +45,7 @@
<li><%= link_to "Create Boys High School Weights (106-285)" , "/tournaments/#{@tournament.id}/create_custom_weights?customValue=#{Weight::HS_WEIGHT_CLASSES}",data: { confirm: 'Are you sure? This will delete all current weights.' } %></li> <li><%= link_to "Create Boys High School Weights (106-285)" , "/tournaments/#{@tournament.id}/create_custom_weights?customValue=#{Weight::HS_WEIGHT_CLASSES}",data: { confirm: 'Are you sure? This will delete all current weights.' } %></li>
<li><%= link_to "Create Girls High School Weights (101-235)" , "/tournaments/#{@tournament.id}/create_custom_weights?customValue=#{Weight::HS_GIRLS_WEIGHT_CLASSES}",data: { confirm: 'Are you sure? This will delete all current weights.' } %></li> <li><%= link_to "Create Girls High School Weights (101-235)" , "/tournaments/#{@tournament.id}/create_custom_weights?customValue=#{Weight::HS_GIRLS_WEIGHT_CLASSES}",data: { confirm: 'Are you sure? This will delete all current weights.' } %></li>
<li><strong>Tournament Actions</strong></li> <li><strong>Tournament Actions</strong></li>
<li><%= link_to "Calculate Team Scores" , "/tournaments/#{@tournament.id}/calculate_team_scores", method: :post %></li> <li><%= link_to "Calculate Team Scores" , "/tournaments/#{@tournament.id}/calculate_team_scores", :method => :put %></li>
<li><%= link_to "Generate Brackets" , "/tournaments/#{@tournament.id}/generate_matches", data: { confirm: 'Are you sure? This will delete all current matches.' } %></li> <li><%= link_to "Generate Brackets" , "/tournaments/#{@tournament.id}/generate_matches", data: { confirm: 'Are you sure? This will delete all current matches.' } %></li>
<li><%= link_to "Export Data" , "/tournaments/#{@tournament.id}/export?print=true", target: :_blank %></li> <li><%= link_to "Export Data" , "/tournaments/#{@tournament.id}/export?print=true", target: :_blank %></li>
</ul> </ul>

View File

@@ -22,7 +22,6 @@
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<%= render 'layouts/cdn' %> <%= render 'layouts/cdn' %>
<%= render 'layouts/shim' %> <%= render 'layouts/shim' %>
<%= render 'layouts/instantpage' %>
</head> </head>
<body style="padding-top: 70px;"> <body style="padding-top: 70px;">
<div class="container"> <div class="container">

View File

@@ -54,7 +54,7 @@ Wrestling::Application.routes.draw do
get 'tournaments/:id/export' => "tournaments#export" get 'tournaments/:id/export' => "tournaments#export"
post "/tournaments/:id/import" => "tournaments#import", :as => :import post "/tournaments/:id/import" => "tournaments#import", :as => :import
get "/tournaments/:id/brackets" => "tournaments#show" get "/tournaments/:id/brackets" => "tournaments#show"
post "/tournaments/:id/calculate_team_scores" => "tournaments#calculate_team_scores" put "/tournaments/:id/calculate_team_scores", :to => "tournaments#calculate_team_scores"
post 'weights/:id/re_gen' => 'weights#re_gen', :as => :regen_weight post 'weights/:id/re_gen' => 'weights#re_gen', :as => :regen_weight
post "/wrestlers/update_pool" => "wrestlers#update_pool" post "/wrestlers/update_pool" => "wrestlers#update_pool"