aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/helpers/sidebar_helper.rb7
-rw-r--r--app/views/common/_left_sidebar.html.erb2
-rw-r--r--app/views/common/_right_sidebar.html.erb2
-rw-r--r--app/views/refinery/sidebar_modules/_sidebar_blog_category.html.erb8
-rw-r--r--app/views/sidebar_modules/_sidebar_blog_category.html.erb8
-rw-r--r--app/views/sidebar_modules/_sidebar_module.html.erb (renamed from app/views/common/_sidebar_module.html.erb)0
6 files changed, 17 insertions, 10 deletions
diff --git a/app/helpers/sidebar_helper.rb b/app/helpers/sidebar_helper.rb
new file mode 100644
index 0000000..2ae3e95
--- /dev/null
+++ b/app/helpers/sidebar_helper.rb
@@ -0,0 +1,7 @@
+module SidebarHelper
+ def render_sidebar_modules(mods)
+ mods.map { |m|
+ render m.to_partial_path, :sidebar_module => m
+ }.join().html_safe
+ end
+end
diff --git a/app/views/common/_left_sidebar.html.erb b/app/views/common/_left_sidebar.html.erb
index 1a55f7e..3cdbe0c 100644
--- a/app/views/common/_left_sidebar.html.erb
+++ b/app/views/common/_left_sidebar.html.erb
@@ -1,3 +1,3 @@
<div id="left_sidebar">
- <%= render @sidebar_modules.select {|m| m.position == 1} %>
+ <%= render_sidebar_modules @sidebar_modules.select {|m| m.position == 1} %>
</div>
diff --git a/app/views/common/_right_sidebar.html.erb b/app/views/common/_right_sidebar.html.erb
index 9a40a11..082e4f1 100644
--- a/app/views/common/_right_sidebar.html.erb
+++ b/app/views/common/_right_sidebar.html.erb
@@ -1,3 +1,3 @@
<div id="right_sidebar">
- <%= render @sidebar_modules.select {|m| m.position == 2} %>
+ <%= render_sidebar_modules @sidebar_modules.select {|m| m.position == 2} %>
</div>
diff --git a/app/views/refinery/sidebar_modules/_sidebar_blog_category.html.erb b/app/views/refinery/sidebar_modules/_sidebar_blog_category.html.erb
deleted file mode 100644
index c1d80f1..0000000
--- a/app/views/refinery/sidebar_modules/_sidebar_blog_category.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<% content_for "sidebar_module_#{sidebar_blog_category.title}_body" do %>
- <% sidebar_blog_category.body.each do |post| %>
- <%= content_tag :div, :class => :sidebar_blog_headline do %>
- <%= link_to post.title, blog_post_path(post) %>
- <% end %>
- <% end %>
-<% end %>
-<%= render 'common/sidebar_module', :sidebar_module => sidebar_blog_category %>
diff --git a/app/views/sidebar_modules/_sidebar_blog_category.html.erb b/app/views/sidebar_modules/_sidebar_blog_category.html.erb
new file mode 100644
index 0000000..53556e7
--- /dev/null
+++ b/app/views/sidebar_modules/_sidebar_blog_category.html.erb
@@ -0,0 +1,8 @@
+<% content_for "sidebar_module_#{sidebar_module.title}_body" do %>
+ <% sidebar_module.body.each do |post| %>
+ <%= content_tag :div, :class => :sidebar_blog_headline do %>
+ <%= link_to post.title, refinery.blog_post_path(post) %>
+ <% end %>
+ <% end %>
+<% end %>
+<%= render 'sidebar_modules/sidebar_module', :sidebar_module => sidebar_module %>
diff --git a/app/views/common/_sidebar_module.html.erb b/app/views/sidebar_modules/_sidebar_module.html.erb
index c7a24e9..c7a24e9 100644
--- a/app/views/common/_sidebar_module.html.erb
+++ b/app/views/sidebar_modules/_sidebar_module.html.erb