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

Moved the tournament navbar to the bottom of the page and made site responsive. Fixed puma solid queue in development. Added a note about clobbering assets in the README. Fixed the ad blocker check due to turbolinks it had to be idempotent. Added migrations for all dbs in the rails-dev-db-create.sh script.

This commit is contained in:
2025-04-16 16:19:29 -04:00
parent 6e61a7245a
commit ed7186e5ce
14 changed files with 91 additions and 11011 deletions

View File

@@ -77,6 +77,7 @@ Whether you have a shell from docker or are using rvm you can now run normal rai
* ` rails s -b 0.0.0.0` port 3000 is exposed. You can open [http://localhost:3000](http://localhost:3000) after running that command * ` rails s -b 0.0.0.0` port 3000 is exposed. You can open [http://localhost:3000](http://localhost:3000) after running that command
* etc. * etc.
* `rake finish_seed_tournaments` will complete all matches from the seed data. This command takes about 5 minutes to execute * `rake finish_seed_tournaments` will complete all matches from the seed data. This command takes about 5 minutes to execute
* `rake assets:clobber` - removes previously compiled assets stored in `public/assets` forcing Rails to recompile them from scratch the next time they are requested.
## Testing Job Status ## Testing Job Status

View File

@@ -10,11 +10,13 @@
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives. // about supported directives.
// //
//= require_tree .
//= require jquery //= require jquery
//= require jquery_ujs //= require jquery_ujs
// Bootstrap 3.3.6 in vendor/assets/javascripts // Bootstrap 3.3.6 in vendor/assets/javascripts
//= require bootstrap.min.js //= require bootstrap.min.js
// Data Tables 1.10.6 in vendor/assets/javascripts // Data Tables 1.10.6 in vendor/assets/javascripts
//= require jquery.dataTables.min.js //= require jquery.dataTables.min.js
//= require turbolinks
//
//= require_tree .

View File

@@ -10,10 +10,13 @@
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope. * file per style scope.
* *
*= require_tree . * For some reason this needs to be above bootstrap for the zindex of the main navbar to work.
*= require_self * With it lower, bootstraps css overrides it.
*= require custom
* Bootstrap 3.3.6 in vendor/assets/stylesheets * Bootstrap 3.3.6 in vendor/assets/stylesheets
*= require bootstrap.min.css *= require bootstrap.min.css
*= require bootstrap-theme.min.css *= require bootstrap-theme.min.css
*= require_tree .
*= require_self
*/ */

View File

@@ -0,0 +1,17 @@
.navbar-inverse.navbar-fixed-top {
z-index: 1040; /* Ensure main navbar is above tournament navbar */
}
#tournament-navbar {
top: 50px; /* Position below the first fixed navbar */
z-index: 1030; /* Explicitly set standard fixed navbar z-index */
}
/* Make desktop navbar dropdowns scrollable if they overflow */
@media (min-width: 768px) {
/* Target dropdowns in main nav and tournament nav specifically */
.navbar-fixed-top .dropdown-menu {
max-height: 70vh; /* Adjust as needed - 70% of viewport height */
overflow-y: auto;
}
}

View File

@@ -10,7 +10,7 @@
<a class="navbar-brand" href="/">WrestlingDev</a> <a class="navbar-brand" href="/">WrestlingDev</a>
</div> </div>
<div id="navbar" class="collapse navbar-collapse"> <div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav navbar-right">
<li><%= link_to "Browse Tournaments", "/tournaments/" %></li> <li><%= link_to "Browse Tournaments", "/tournaments/" %></li>
<li><%= link_to "About", "/static_pages/about" %></li> <li><%= link_to "About", "/static_pages/about" %></li>
<li><%= link_to "Tutorials", "/static_pages/tutorials" %></li> <li><%= link_to "Tutorials", "/static_pages/tutorials" %></li>

View File

@@ -1,13 +1,21 @@
<% if @tournament and @tournament.id %> <% if @tournament and @tournament.id %>
<h2><%= @tournament.name %> Links</h2> <nav class="navbar navbar-default navbar-fixed-top" role="navigation" id="tournament-navbar">
<nav class="navbar navbar-default navbar-static-top" role="navigation" id="tournament-navbar">
<div class="container"> <div class="container">
<div class="collapse navbar-collapse"> <div class="navbar-header">
<ul class="nav navbar-nav"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#tournament-navbar-collapse" aria-expanded="false" aria-controls="navbar">
<li><%= link_to " Tournament Home" , "/tournaments/#{@tournament.id}", class: "fas fa-home" %></li> <span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<%= link_to "Tournament Menu", "/tournaments/#{@tournament.id}", class: "navbar-brand" %>
</div>
<div id="tournament-navbar-collapse" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li><%= link_to " Home" , "/tournaments/#{@tournament.id}", class: "fas fa-home" %></li>
<% if can? :read, @tournament %> <% if can? :read, @tournament %>
<li class="dropdown"> <li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fas fa-poll-h"> Tournament Results/Brackets</i> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="fas fa-poll-h"> Results/Brackets</i>
<span class="caret"></span></a> <span class="caret"></span></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><strong>Results</strong></li> <li><strong>Results</strong></li>
@@ -24,7 +32,7 @@
<% end %> <% end %>
<% if can? :manage, @tournament %> <% if can? :manage, @tournament %>
<li class="dropdown"> <li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#director"><i class="fas fa-tools"> Tournament Director Links</i> <a class="dropdown-toggle" data-toggle="dropdown" href="#director"><i class="fas fa-tools"> Director Links</i>
<span class="caret"></span></a> <span class="caret"></span></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><strong>Pages</strong></li> <li><strong>Pages</strong></li>

View File

@@ -14,21 +14,37 @@
<p>We've detected that you have an ad blocker enabled! Please consider disabling it for <strong>wrestlingdev.com</strong>. This site is free for users and supported by ads. Ad blockers also block performance monitoring that help us with user experience.</p> <p>We've detected that you have an ad blocker enabled! Please consider disabling it for <strong>wrestlingdev.com</strong>. This site is free for users and supported by ads. Ad blockers also block performance monitoring that help us with user experience.</p>
</div> </div>
<script> <script>
let fakeAd = document.createElement("div"); // Only run ad blocker check if fakeAd hasn't been checked yet in this context
if (typeof window.adBlockerCheckExecuted === 'undefined') {
let fakeAd = document.createElement("div");
fakeAd.className = "textads banner-ads banner_ads ad-unit ad-zone ad-space adsbox" fakeAd.className = "textads banner-ads banner_ads ad-unit ad-zone ad-space adsbox"
fakeAd.style.height = "1px" fakeAd.style.height = "1px"
fakeAd.style.position = "absolute"; // Prevent potential layout shift
fakeAd.style.top = "-10px";
fakeAd.style.left = "-10px";
document.body.appendChild(fakeAd) document.body.appendChild(fakeAd)
// Use requestAnimationFrame to ensure the element is rendered before checking offsetHeight
requestAnimationFrame(() => {
let x_width = fakeAd.offsetHeight; let x_width = fakeAd.offsetHeight;
let msg = document.getElementById("msg") // let msg = document.getElementById("msg") // msg variable wasn't used
if(x_width){ if(x_width){
console.log("No AdBlocker Detected") console.log("No AdBlocker Detected")
}else{ }else{
console.log("AdBlocker detected") console.log("AdBlocker detected")
document.getElementById("blocked_message").style.display = 'block'; const blockedMessage = document.getElementById("blocked_message");
if (blockedMessage) {
blockedMessage.style.display = 'block';
}
}
// Clean up the fake element
document.body.removeChild(fakeAd);
});
// Mark check as executed
window.adBlockerCheckExecuted = true;
} }
</script> </script>

View File

@@ -16,25 +16,24 @@
<% else %> <% else %>
<head> <head>
<title>WrestlingDev</title> <title>WrestlingDev</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<% if Rails.env.production? %> <% if Rails.env.production? %>
<%= render 'layouts/analytics' %> <%= render 'layouts/analytics' %>
<% end %> <% end %>
<%= stylesheet_link_tag "application", media: "all", <%= stylesheet_link_tag "application" %>
"data-turbolinks-track" => true %> <%= javascript_include_tag "application" %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<%= render 'layouts/cdn' %> <%= render 'layouts/cdn' %>
<%= render 'layouts/shim' %> <%= render 'layouts/shim' %>
</head> </head>
<body style="padding-top: 70px;"> <body style="padding-top: 100px;">
<%= render 'layouts/header' %>
<%= render 'layouts/tournament-navbar' %>
<div class="container"> <div class="container">
<div class="navbar-roof"></div> <div class="navbar-roof"></div>
<%= render 'layouts/header' %>
<div id="page-content"> <div id="page-content">
<div class="row">
<%= render 'layouts/tournament-navbar' %>
</div>
<div class="row"> <div class="row">
<div class="col-md-12"><%= render 'layouts/underheader' %></div> <div class="col-md-12"><%= render 'layouts/underheader' %></div>
</div> </div>
@@ -46,7 +45,9 @@
<% if alert %> <% if alert %>
<p id="alert" class="alert alert-danger alert-dismissible"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a><%= alert %></p> <p id="alert" class="alert alert-danger alert-dismissible"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a><%= alert %></p>
<% end %> <% end %>
<div id="view"><%= yield %></div> <div id="view" style="overflow-x: auto; overflow-y: hidden;"> <%# Horizontal scroll only %>
<%= yield %>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -1,5 +1,6 @@
<br><br>
<h3> <h3>
Info <%= @tournament.name %> Info
</h3> </h3>
<% if (can? :manage, @tournament) && @tournament.curently_generating_matches == 1 %> <% if (can? :manage, @tournament) && @tournament.curently_generating_matches == 1 %>

View File

@@ -3,4 +3,7 @@ project_dir="$(dirname $( dirname $(readlink -f ${BASH_SOURCE[0]})))"
cd ${project_dir} cd ${project_dir}
rake db:setup rake db:setup
rake db:migrate RAILS_ENV=test rake db:migrate
rake db:migrate:cache
rake db:migrate:queue
rake db:migrate:cable

View File

@@ -38,6 +38,7 @@ Rails.application.configure do
config.active_job.queue_adapter = :solid_queue config.active_job.queue_adapter = :solid_queue
# Don't use connects_to here since it's configured via queue.yml # Don't use connects_to here since it's configured via queue.yml
# config.solid_queue.connects_to = { database: { writing: :queue } } # config.solid_queue.connects_to = { database: { writing: :queue } }
config.solid_queue.connects_to = { database: { writing: :queue, reading: :queue } }
# Configure ActionCable to use its own database # Configure ActionCable to use its own database
# Don't use connects_to here since it's configured via cable.yml # Don't use connects_to here since it's configured via cable.yml

View File

@@ -1 +0,0 @@
*-*

View File

@@ -1,108 +0,0 @@
// Place all the styles related to the Admin controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the Matches controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the Mats controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
body {
background-color: #fff;
color: #333;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}
pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}
a {
color: #000;
&:visited {
color: #666;
}
&:hover {
color: #fff;
background-color: #000;
}
}
div {
&.field, &.actions {
margin-bottom: 10px;
}
}
#notice {
color: green;
}
.field_with_errors {
padding: 2px;
background-color: red;
display: table;
}
#error_explanation {
width: 450px;
border: 2px solid red;
padding: 7px;
padding-bottom: 0;
margin-bottom: 20px;
background-color: #f0f0f0;
h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px;
margin-bottom: 0px;
background-color: #c00;
color: #fff;
}
ul li {
font-size: 12px;
list-style: square;
}
}
// Place all the styles related to the Schools controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the StaticPages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the tournaments controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the Weights controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
// Place all the styles related to the Wrestlers controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*/