aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/decorators/models/sidebar_post_decorator.rb9
-rw-r--r--app/views/common/_sidebar_module.html.erb6
2 files changed, 4 insertions, 11 deletions
diff --git a/app/decorators/models/sidebar_post_decorator.rb b/app/decorators/models/sidebar_post_decorator.rb
index c6f10d5..93353bb 100644
--- a/app/decorators/models/sidebar_post_decorator.rb
+++ b/app/decorators/models/sidebar_post_decorator.rb
@@ -1,18 +1,11 @@
require 'delegate'
class SidebarPostDecorator < SimpleDelegator
- include ActionView::Helpers::TagHelper
- include ActionView::Helpers::TextHelper
-
def initialize(post)
super(post)
end
- def title
- content_tag(:h2, link_to(super, __getobj__.friendly_id))
- end
-
def body
- content_tag(:div, sanitize(truncate(super, :length => 32, :separator => ' ')))
+ super.truncate(64)
end
end
diff --git a/app/views/common/_sidebar_module.html.erb b/app/views/common/_sidebar_module.html.erb
index 41f51e7..73554b7 100644
--- a/app/views/common/_sidebar_module.html.erb
+++ b/app/views/common/_sidebar_module.html.erb
@@ -1,9 +1,9 @@
<% modules.keys.each do |c| -%>
<div class="sidebar_content">
<h1><%= c %></h1>
- <%- modules[c].each do |entry| %>
- <%= entry.title %>
- <%= entry.body %>
+ <%- modules[c].each do |item| %>
+ <h2><%= link_to(item.title, item.friendly_id) %></h2>
+ <div><%= item.body %></div>
<% end %>
</div>
<% end -%>