module BlogPostsHelper def blog_archive_list posts = BlogPost.select('published_at').all_previous return nil if posts.blank? html = '

' html << t('archives', :scope => 'blog.shared') html << '

' html.html_safe end def next_or_previous?(post) post.next.present? or post.prev.present? end def blog_post_teaser(post) if post.respond_to?(:custom_teaser) && post.custom_teaser.present? post.custom_teaser.html_safe else truncate(post.body, { :length => RefinerySetting.find_or_set(:blog_post_teaser_length, 250), :preserve_html_tags => true }).html_safe end end end