Module: Zencms::PostsHelper

Defined in:
app/helpers/zencms/posts_helper.rb

Instance Method Summary collapse

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)
   :ul, class: 'flat' do
     :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)
   :ul, class: 'list-inline' do
     :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)
   :div, class: 'row', :'data-clearing' => true do
     :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)
   :ul, class: 'list-inline' do
     :li, post.tags 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