Module: Zencms::PostsHelper
- Defined in:
- app/helpers/zencms/posts_helper.rb
Instance Method Summary collapse
- #post_audios(post) ⇒ Object
- #post_categories(post) ⇒ Object
- #post_grid_images(post) ⇒ Object
- #post_tags(post) ⇒ Object
- #post_teaser(post, length) ⇒ Object
Instance Method Details
#post_audios(post) ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/helpers/zencms/posts_helper.rb', line 16 def post_audios(post) content_tag :ul, class: 'flat' do content_tag_for :li, post.audios do |audio| concat link_to audio.title, audio.url, class: 'sm2_link' end end end |
#post_categories(post) ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/helpers/zencms/posts_helper.rb', line 24 def post_categories(post) content_tag :ul, class: 'list-inline' do content_tag_for :li, post.categories do |category| concat link_to category, category_posts_path(category), class: 'label label-info' end end end |
#post_grid_images(post) ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/helpers/zencms/posts_helper.rb', line 8 def post_grid_images(post) content_tag :div, class: 'row', :'data-clearing' => true do content_tag_for :div, post.images, class: 'col-md-3' do |image| concat link_to(image_tag(image.url(:small), :'data-caption' => image.title), image.url(:original), class: 'thumbnail') end end end |
#post_tags(post) ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/helpers/zencms/posts_helper.rb', line 32 def (post) content_tag :ul, class: 'list-inline' do content_tag_for :li, post. do |tag| concat link_to tag, tag_posts_path(tag), class: 'label label-default' end end end |
#post_teaser(post, length) ⇒ Object
4 5 6 |
# File 'app/helpers/zencms/posts_helper.rb', line 4 def (post, length) truncate_html(post.body, :length => length, :omission => link_to(' [...]', post, :title => "read more")) end |