diff options
author | Johan Bruning <johan.h.bruning@gmail.com> | 2011-07-04 16:22:48 +0200 |
---|---|---|
committer | Johan Bruning <johan.h.bruning@gmail.com> | 2011-07-04 16:22:48 +0200 |
commit | 8d031ed0c717a32f6a5ad28ccd37e748026dc21c (patch) | |
tree | eee0f8d60909f9000dfb2649909dd1edbb23dc95 /app/helpers | |
parent | 0e4dbb28e923ca2a9065f23ba433ce74f9f0d42d (diff) | |
download | refinerycms-blog-8d031ed0c717a32f6a5ad28ccd37e748026dc21c.tar.gz refinerycms-blog-8d031ed0c717a32f6a5ad28ccd37e748026dc21c.tar.bz2 refinerycms-blog-8d031ed0c717a32f6a5ad28ccd37e748026dc21c.zip |
Added ability to disable teaser independent of teaser length
I prefer full length articles at all times on blogs and don't like teasers. I added the ability for people to disable teasers so full articles will be shown by default. The teasers can e enabled just like comments from the admin page or trough the normal settings.
However not sure if the post partial now is conform standards. Maybe the helper method "blog_post_teaser" could encapsulate the check which is now done in the view and return the full length article instead of a teaser if the teasers are disabled.
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/blog_posts_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/helpers/blog_posts_helper.rb b/app/helpers/blog_posts_helper.rb index a15de1d..0848632 100644 --- a/app/helpers/blog_posts_helper.rb +++ b/app/helpers/blog_posts_helper.rb @@ -42,6 +42,10 @@ module BlogPostsHelper post.next.present? or post.prev.present? end + def blog_post_teaser_enabled? + BlogPost.teasers_enabled? + end + def blog_post_teaser(post) if post.respond_to?(:custom_teaser) && post.custom_teaser.present? post.custom_teaser.html_safe |