From 0be27f05fde1ed0ccb77f6abde1ee0b223debeba Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Wed, 23 Jan 2019 16:05:34 +0000 Subject: [PATCH] Removed sidebars, added tournament navbar, and removed chitika ads --- app/controllers/tournaments_controller.rb | 4 - app/views/layouts/_analytics.html.erb | 9 +++ app/views/layouts/_lsidebar.html.erb | 77 ------------------- app/views/layouts/_tournament-navbar.html.erb | 49 ++++++++++++ ...sidebar.html.erb => _underheader.html.erb} | 23 +----- app/views/layouts/application.html.erb | 26 ++----- app/views/mats/edit.html.erb | 4 +- app/views/mats/new.html.erb | 2 - app/views/schools/edit.html.erb | 2 - app/views/schools/new.html.erb | 2 - app/views/schools/show.html.erb | 6 +- .../_fourPoolQuarterBracket.html.erb | 2 +- app/views/tournaments/all_brackets.html.erb | 8 +- app/views/tournaments/bracket.html.erb | 10 +-- app/views/tournaments/brackets.html.erb | 10 --- app/views/weights/edit.html.erb | 2 - app/views/weights/new.html.erb | 2 - app/views/weights/re_gen.html.erb | 2 - app/views/weights/show.html.erb | 10 +-- config/routes.rb | 1 - 20 files changed, 81 insertions(+), 170 deletions(-) create mode 100644 app/views/layouts/_analytics.html.erb delete mode 100644 app/views/layouts/_lsidebar.html.erb create mode 100644 app/views/layouts/_tournament-navbar.html.erb rename app/views/layouts/{_rsidebar.html.erb => _underheader.html.erb} (62%) delete mode 100644 app/views/tournaments/brackets.html.erb diff --git a/app/controllers/tournaments_controller.rb b/app/controllers/tournaments_controller.rb index 8d18bac..39d31b8 100644 --- a/app/controllers/tournaments_controller.rb +++ b/app/controllers/tournaments_controller.rb @@ -166,10 +166,6 @@ class TournamentsController < ApplicationController GenerateTournamentMatches.new(@tournament).generate end - def brackets - @weights = @tournament.weights.sort_by{|w| w.max} - end - def team_scores @schools = @tournament.schools @schools = @schools.sort_by{|s| s.page_score_string}.reverse! diff --git a/app/views/layouts/_analytics.html.erb b/app/views/layouts/_analytics.html.erb new file mode 100644 index 0000000..c7ebc79 --- /dev/null +++ b/app/views/layouts/_analytics.html.erb @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/app/views/layouts/_lsidebar.html.erb b/app/views/layouts/_lsidebar.html.erb deleted file mode 100644 index ad124b3..0000000 --- a/app/views/layouts/_lsidebar.html.erb +++ /dev/null @@ -1,77 +0,0 @@ - - - - - <% if @tournament %> -
-

Tournament Links

- -
- <% if can? :manage, @tournament %> -

-
-

Tournament Director Links

- -
Pages
-
<%= link_to "Weigh In Page" , "/tournaments/#{@tournament.id}/weigh_in" %> -
<%= link_to "All Matches" , "/tournaments/#{@tournament.id}/matches" %> -
<%= link_to "Full Screen Bout Board" , "/tournaments/#{@tournament.id}/up_matches?print=true" , target: :_blank %> -
Bout Sheets: -
<%= link_to "Deduct Team Points" , "/tournaments/#{@tournament.id}/teampointadjust" %> - <% if can? :destroy, @tournament %> -
<%= link_to "Tournament Delegation" , "/tournaments/#{@tournament.id}/delegate" %> - <% end %> -
<%= link_to "School Delegation" , "/tournaments/#{@tournament.id}/school_delegate"%> - -

Time Savers
-
<%= link_to "Create High School Weights" , "/tournaments/#{@tournament.id}/create_custom_weights?customValue=hs",data: { confirm: 'Are you sure? This will delete all current weights.' } %> - -

Tournament Actions
-
<%= link_to "Generate Brackets" , "/tournaments/#{@tournament.id}/generate_matches", data: { confirm: 'Are you sure? This will delete all current matches.' } %> - -
- <% end %> - <% end %> -
- <% if Rails.env.production? %> -
- - -
- <% end %> - - - - \ No newline at end of file diff --git a/app/views/layouts/_tournament-navbar.html.erb b/app/views/layouts/_tournament-navbar.html.erb new file mode 100644 index 0000000..72c9454 --- /dev/null +++ b/app/views/layouts/_tournament-navbar.html.erb @@ -0,0 +1,49 @@ +<% if @tournament %> + +<% end %> \ No newline at end of file diff --git a/app/views/layouts/_rsidebar.html.erb b/app/views/layouts/_underheader.html.erb similarity index 62% rename from app/views/layouts/_rsidebar.html.erb rename to app/views/layouts/_underheader.html.erb index 1cd9989..9c6b634 100644 --- a/app/views/layouts/_rsidebar.html.erb +++ b/app/views/layouts/_underheader.html.erb @@ -1,27 +1,6 @@ <% if Rails.env.production? %>
- - +
<% end %>
 
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index a0300ea..3f7c1a8 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,16 +14,7 @@ WrestlingDev <% if Rails.env.production? %> - + <%= render layouts/analytics %> <% end %> <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> @@ -38,23 +29,22 @@ <%= render 'layouts/header' %>
+
+ <%= render 'layouts/tournament-navbar' %> +
+
+
<%= render 'layouts/underheader' %>
+
-
- <%= render 'layouts/lsidebar' %> -
-
+

<%= notice %>

<%= yield %>
-
- <%= render 'layouts/rsidebar' %> -
<%= render 'layouts/footer' %>
- <% end %> diff --git a/app/views/mats/edit.html.erb b/app/views/mats/edit.html.erb index a0b6679..5c12cd7 100644 --- a/app/views/mats/edit.html.erb +++ b/app/views/mats/edit.html.erb @@ -1,5 +1,3 @@

Editing mat

-<%= render 'form' %> - -<%= link_to 'Back', "/tournaments/#{@tournament.id}" %> +<%= render 'form' %> \ No newline at end of file diff --git a/app/views/mats/new.html.erb b/app/views/mats/new.html.erb index 3dfef6e..bedd14c 100644 --- a/app/views/mats/new.html.erb +++ b/app/views/mats/new.html.erb @@ -1,5 +1,3 @@ -<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %> -

New mat

<%= render 'form' %> diff --git a/app/views/schools/edit.html.erb b/app/views/schools/edit.html.erb index 99aadcf..5355706 100644 --- a/app/views/schools/edit.html.erb +++ b/app/views/schools/edit.html.erb @@ -1,5 +1,3 @@ -<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %> -

Editing school



diff --git a/app/views/schools/new.html.erb b/app/views/schools/new.html.erb index 991775f..e284368 100644 --- a/app/views/schools/new.html.erb +++ b/app/views/schools/new.html.erb @@ -1,5 +1,3 @@ -<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %> -

New school



diff --git a/app/views/schools/show.html.erb b/app/views/schools/show.html.erb index aeebd19..1966497 100644 --- a/app/views/schools/show.html.erb +++ b/app/views/schools/show.html.erb @@ -1,9 +1,7 @@ - - <%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}",:class=>"btn btn-default" %> <% if can? :manage, @school %> - | <%= link_to "Edit #{@school.name}", edit_school_path(@school),:class=>"btn btn-primary" %> + <%= link_to "Edit #{@school.name}", edit_school_path(@school),:class=>"btn btn-primary" %> | <% end %> - | <%= link_to "#{@school.name} Stat Summary", "/schools/#{@school.id}/stats",:class=>"btn btn-primary" %> + <%= link_to "#{@school.name} Stat Summary", "/schools/#{@school.id}/stats",:class=>"btn btn-primary" %>

diff --git a/app/views/tournaments/_fourPoolQuarterBracket.html.erb b/app/views/tournaments/_fourPoolQuarterBracket.html.erb index a3dacd0..5d56699 100644 --- a/app/views/tournaments/_fourPoolQuarterBracket.html.erb +++ b/app/views/tournaments/_fourPoolQuarterBracket.html.erb @@ -17,7 +17,7 @@

  •  
  • <%= match.w1_name %>
  • -
  • <%= match.bout_number %> <%= match.bracket_score_string %> 
  • +
  • <%= match.bout_number %> <%= match.bracket_score_string %> 
  • <%= match.w2_name %>
  •  
  • diff --git a/app/views/tournaments/all_brackets.html.erb b/app/views/tournaments/all_brackets.html.erb index 66bdc95..9b54db7 100644 --- a/app/views/tournaments/all_brackets.html.erb +++ b/app/views/tournaments/all_brackets.html.erb @@ -6,11 +6,11 @@ border: none; margin: 0px; padding: 0px; - width: 7in; /* width: 7in; */ + width: 8in; /* width: 7in; */ height: 9.5in; /* or height: 9.5in; */ - font-size: 10px; + font-size: 8px; position: relative; - left: 1in; + left: 0in; height: 1in; } /* @@ -70,7 +70,7 @@ li:first-child,li:last-child {
    <%= @tournament.name %> - <%= w.max %> lbs Bracket
    -
    + <% @weight = w %> <% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %> <% @wrestlers = Wrestler.where(weight_id: @weight.id) %> diff --git a/app/views/tournaments/bracket.html.erb b/app/views/tournaments/bracket.html.erb index 2ec9eb3..4be8258 100644 --- a/app/views/tournaments/bracket.html.erb +++ b/app/views/tournaments/bracket.html.erb @@ -43,6 +43,9 @@ li:first-child,li:last-child { border-right:1px solid #aaa; min-height:30px; } +.bout-number + li { + valign: center; +} .bracket-winner { border-bottom:1px solid #aaa; } @@ -52,13 +55,6 @@ li:first-child,li:last-child { } <% cache ["#{@weight.id}_bracket", @weight] do %> -
    -
    -
    - - <%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %> -
    -
    <%= @tournament.name %> - <%= @weight.max %> lbs Bracket
    diff --git a/app/views/tournaments/brackets.html.erb b/app/views/tournaments/brackets.html.erb deleted file mode 100644 index 03cdbfb..0000000 --- a/app/views/tournaments/brackets.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %> -
    -
    -<% @weights.each do |weight| %> -<%= link_to "#{weight.max}" , "/tournaments/#{@tournament.id}/brackets/#{weight.id}" %> -
    -<% end %> -<% if can? :manage, @tournament %> - <%= link_to "All Brackets (Printable)", "/tournaments/#{@tournament.id}/all_brackets?print=true", target: :_blank %> -<% end %> diff --git a/app/views/weights/edit.html.erb b/app/views/weights/edit.html.erb index 1f79b26..5c5b7f7 100644 --- a/app/views/weights/edit.html.erb +++ b/app/views/weights/edit.html.erb @@ -1,5 +1,3 @@ -<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %> -

    Editing weight

    <%= render 'form' %> diff --git a/app/views/weights/new.html.erb b/app/views/weights/new.html.erb index f3c02ee..aa040ea 100644 --- a/app/views/weights/new.html.erb +++ b/app/views/weights/new.html.erb @@ -1,5 +1,3 @@ -<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %> -

    New weight

    <%= render 'form' %> diff --git a/app/views/weights/re_gen.html.erb b/app/views/weights/re_gen.html.erb index c1aaac8..433ccaf 100644 --- a/app/views/weights/re_gen.html.erb +++ b/app/views/weights/re_gen.html.erb @@ -1,3 +1 @@ -<%= link_to "Back to #{@weight.tournament.name}", "/tournaments/#{@weight.tournament.id}", :class=>"btn btn-default" %> -

    <%= @weight.max %> lbs Matches are being generated. This can take anywhere from 1-5 minutes to finish. It is recommended to delete all delegated school permissions to prevent lineup changes after the tournament has started. \ No newline at end of file diff --git a/app/views/weights/show.html.erb b/app/views/weights/show.html.erb index 6fde417..bf0a016 100644 --- a/app/views/weights/show.html.erb +++ b/app/views/weights/show.html.erb @@ -1,11 +1,7 @@ - - - - <%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}", :class=>"btn btn-default" %> <% if can? :manage, @tournament %> - | <%= link_to "Edit #{@weight.max} Weight Class", edit_weight_path(@weight), :class=>"btn btn-primary" %> - | <%= form_for(@weight, url: regen_weight_path(@weight.id), :method => "post") do |f| %> - <%= submit_tag "Regenerate Weight Class Matches", :class=>"btn"%> + <%= link_to "Edit #{@weight.max} Weight Class", edit_weight_path(@weight), :class=>"btn btn-primary" %> | + <%= form_for(@weight, url: regen_weight_path(@weight.id), :method => "post") do |f| %> + <%= submit_tag "Regenerate Weight Class Matches", :class=>"btn btn-default"%> <% end %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index f95cc1c..4672c08 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,7 +32,6 @@ Wrestling::Application.routes.draw do get 'tournaments/:id/weigh_in' => 'tournaments#weigh_in' get 'tournaments/:id/create_custom_weights' => 'tournaments#create_custom_weights' get 'tournaments/:id/all_brackets' => 'tournaments#all_brackets' - get 'tournaments/:id/brackets' => 'tournaments#brackets' get 'tournaments/:id/brackets/:weight' => 'tournaments#bracket', :as => :weight_bracket get 'tournaments/:id/generate_matches' => 'tournaments#generate_matches' get 'tournaments/:id/team_scores' => 'tournaments#team_scores'