diff options
Diffstat (limited to 'app/views/common')
-rw-r--r-- | app/views/common/_left_sidebar.html.erb | 2 | ||||
-rw-r--r-- | app/views/common/_right_sidebar.html.erb | 2 | ||||
-rw-r--r-- | app/views/common/_sidebar_module.html.erb | 17 |
3 files changed, 7 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> + |