Skip to content

Commit

Permalink
DRY view checks for homepage fallback content
Browse files Browse the repository at this point in the history
  • Loading branch information
camillevilla committed Sep 4, 2024
1 parent 1a81cb8 commit d4c66e7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@
</form>
</section>
<div class="grid-container">
<% fallback_content? = @homepage.blank? && (controller.action_name != 'preview') %>
<section id="homepage-section-1" class="homepage-section">
<% if @homepage.blank? && (controller.action_name != 'preview') %>
<% if fallback_content? %>
<h2 class="section-title">Featured Innovations</h2>
<div class="grid-row grid-gap">
<div id="section-1-feature-1" class="homepage-feature three-column-layout">
Expand Down Expand Up @@ -136,7 +137,7 @@
<% end %>
</section>
<section id="homepage-section-2" class="homepage-section">
<% if @homepage.blank? %>
<% if fallback_content? %>
<h2 class="section-title">Trending Tags</h2>
<div class="grid-row grid-gap">
<div id="section-2-feature-1" class="homepage-feature three-column-layout">
Expand Down Expand Up @@ -180,7 +181,7 @@
<% end %>
</section>
<section id="homepage-section-3" class="homepage-section">
<% if @homepage.blank? %>
<% if fallback_content? %>
<h2 class="section-title">Innovation Communities</h2>
<div class="grid-row grid-gap">
<div id="section-3-feature-1" class="homepage-feature two-column-layout">
Expand Down

0 comments on commit d4c66e7

Please sign in to comment.