aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2014-02-07 16:51:00 +0100
committerHarald Eilertsen <haraldei@anduin.net>2014-02-07 16:55:25 +0100
commit9d423633597c5c2401170cde33f51a24de9c7af6 (patch)
tree07831074a83df94ccd85ab038bb5fd0154a7453c /app
parentcd29f12cf546d3afa883ce8e67eb9d5347875714 (diff)
downloadhmnoweb-9d423633597c5c2401170cde33f51a24de9c7af6.tar.gz
hmnoweb-9d423633597c5c2401170cde33f51a24de9c7af6.tar.bz2
hmnoweb-9d423633597c5c2401170cde33f51a24de9c7af6.zip
Fix side body part on pages where there is no side body.
Diffstat (limited to 'app')
-rw-r--r--app/helpers/sidebar_helper.rb5
-rw-r--r--app/views/common/_right_sidebar.html.erb2
2 files changed, 6 insertions, 1 deletions
diff --git a/app/helpers/sidebar_helper.rb b/app/helpers/sidebar_helper.rb
index f9d4834..e8e076a 100644
--- a/app/helpers/sidebar_helper.rb
+++ b/app/helpers/sidebar_helper.rb
@@ -12,4 +12,9 @@ module SidebarHelper
render m.to_partial_path, :sidebar_module => m
}.join().html_safe
end
+
+ def page_has_side_body?(page)
+ part = page.part_with_title("Side Body")
+ return part.present? && !part.body.empty?
+ end
end
diff --git a/app/views/common/_right_sidebar.html.erb b/app/views/common/_right_sidebar.html.erb
index 3b17356..15dfb83 100644
--- a/app/views/common/_right_sidebar.html.erb
+++ b/app/views/common/_right_sidebar.html.erb
@@ -1,5 +1,5 @@
<div id="right_sidebar">
- <% unless @page.part_with_title("Side Body").body.empty? %>
+ <% if page_has_side_body?(@page) %>
<div class="sidebar_module">
<h1>Sjefen melder</h1>
<div class="inner"><%= raw @page.content_for(:side_body) %></div>