1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-24 17:04:43 +00:00

Hide ads for coaches when submitting lineups

This commit is contained in:
2026-02-08 18:59:42 -05:00
parent d8b6cfa8ac
commit 07d43e7720
2 changed files with 16 additions and 3 deletions

View File

@@ -1,4 +1,14 @@
module ApplicationHelper
def hide_ads?
return false unless controller_name == "schools"
return false unless %w[show edit new].include?(action_name)
user_signed_in? || school_permission_key_present?
end
def school_permission_key_present?
@school_permission_key.present? ||
params[:school_permission_key].present? ||
params.dig(:school, :school_permission_key).present?
end
end

View File

@@ -36,7 +36,11 @@
<div id="page-content">
<div class="row">
<div class="col-md-12"><%= render 'layouts/underheader' %></div>
<div class="col-md-12">
<% unless hide_ads? %>
<%= render 'layouts/underheader' %>
<% end %>
</div>
</div>
<div class="row no-margin">
<div class="col-md-12" style="padding-left: 2%;">
@@ -58,4 +62,3 @@
</body>
<% end %>
</html>