Skip to content

Commit

Permalink
Merge pull request #97 from mooreniemi/75-TuneAds1
Browse files Browse the repository at this point in the history
75-TuneAds1 - centralize ad unit code and ensure it is only on conten…
  • Loading branch information
mooreniemi authored Feb 23, 2021
2 parents 85cbcab + 81993b9 commit 4f680f1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 15 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/styles.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ $medium: 900px;
width: 100%;
}

.mockad {
outline: 5px dotted green;
}

p {
padding: 5px;
}
Expand Down
21 changes: 21 additions & 0 deletions app/views/ads/_test1.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<% if Rails.env.production? %>
<div class="row padded_nicely">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- test1 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-3154444439610781"
data-ad-slot="3311943876"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<% else %>
<div class="row padded_nicely mockad">
<center>
<h1>on production ad unit "test1"</h1>
</center>
</div>
<% end %>
15 changes: 0 additions & 15 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
<% if Rails.env.production? && !user_signed_in? %>
<div class="row padded_nicely">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- test1 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-3154444439610781"
data-ad-slot="3311943876"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<% end %>
<div class="footer navbar-fixed-bottom submission_well">
<% cache(Date.today.year) do %>
<small> &nbsp;
Expand Down
1 change: 1 addition & 0 deletions app/views/pages/newsfeed.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%= render partial: 'ads/test1' %>
<h2><% title 'Newsfeed' %></h2>
<div class="center">
<% for e in @rss do %>
Expand Down
1 change: 1 addition & 0 deletions app/views/procedures/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%= render partial: 'ads/test1' %>
<% title "Procedures" %>
<div id="procedures" style="background-color:#ffffff">
<table class="table table-hover table-bordered" bgcolor="#ffffcc">
Expand Down
1 change: 1 addition & 0 deletions app/views/surgeons/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%= render partial: 'ads/test1' %>
<% title "Surgeons" %>
<div id="surgeons" style="background-color:#ffffff">
<table class="table table-hover table-bordered" bgcolor="#ffffcc">
Expand Down

0 comments on commit 4f680f1

Please sign in to comment.