aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-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/common/_sidebar_module.html.erb17
-rw-r--r--app/views/refinery/sidebar_modules/_sidebar_blog_category.html.erb8
4 files changed, 15 insertions, 14 deletions
diff --git a/app/views/common/_left_sidebar.html.erb b/app/views/common/_left_sidebar.html.erb
index 37f8ccf..1a55f7e 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 "common/sidebar_module", :modules => @sidebar_modules[1] %>
+ <%= render @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 c9a3ca6..9a40a11 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 "common/sidebar_module", :modules => @sidebar_modules[2] %>
+ <%= render @sidebar_modules.select {|m| m.position == 2} %>
</div>
diff --git a/app/views/common/_sidebar_module.html.erb b/app/views/common/_sidebar_module.html.erb
index 07eba16..c7a24e9 100644
--- a/app/views/common/_sidebar_module.html.erb
+++ b/app/views/common/_sidebar_module.html.erb
@@ -1,12 +1,5 @@
-<% unless modules.nil? %>
- <% modules.keys.each do |c| -%>
- <div class="sidebar_content">
- <h1><%= c %></h1>
- <%- modules[c].each do |item| %>
- <h2><%= link_to(item.title, item.friendly_id) %></h2>
- <div><%= item.body %></div>
- <div><%= link_to(t('read_more'), item.friendly_id) %></div>
- <% end %>
- </div>
- <% end -%>
-<% end -%>
+<div id="sidebar_module_<%= sidebar_module.title %>" class="sidebar_module">
+ <h1><%= sidebar_module.title %></h1>
+ <div><%= content_for "sidebar_module_#{sidebar_module.title}_body" %></div>
+</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
new file mode 100644
index 0000000..c1d80f1
--- /dev/null
+++ b/app/views/refinery/sidebar_modules/_sidebar_blog_category.html.erb
@@ -0,0 +1,8 @@
+<% 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 %>