Simplify calls to content_block helper

All calls were using `I18n.locale` as the second parameter, so we might
as well make it optional.
This commit is contained in:
Javi Martín
2021-05-07 00:04:45 +02:00
parent dae4aae328
commit bf10cf0c18
4 changed files with 5 additions and 5 deletions

View File

@@ -26,6 +26,6 @@ class Layout::SocialComponent < ApplicationComponent
end end
def footer_content_block def footer_content_block
content_block("footer", I18n.locale) content_block("footer")
end end
end end

View File

@@ -8,6 +8,6 @@ class Layout::TopLinksComponent < ApplicationComponent
private private
def top_links_content_block def top_links_content_block
content_block("top_links", I18n.locale) content_block("top_links")
end end
end end

View File

@@ -48,7 +48,7 @@ module ApplicationHelper
SiteCustomization::Image.image_path_for(filename) || filename SiteCustomization::Image.image_path_for(filename) || filename
end end
def content_block(name, locale) def content_block(name, locale = I18n.locale)
SiteCustomization::ContentBlock.block_for(name, locale) SiteCustomization::ContentBlock.block_for(name, locale)
end end

View File

@@ -1,6 +1,6 @@
<div class="small-12 medium-9 column"> <div class="small-12 medium-9 column">
<ul> <ul>
<%= raw content_block("subnavigation_left", I18n.locale) %> <%= raw content_block("subnavigation_left") %>
<% if feature?(:debates) %> <% if feature?(:debates) %>
<li> <li>
@@ -59,6 +59,6 @@
</li> </li>
<% end %> <% end %>
<%= raw content_block("subnavigation_right", I18n.locale) %> <%= raw content_block("subnavigation_right") %>
</ul> </ul>
</div> </div>