Module: Notee::Helpers::ViewHelper

Defined in:
lib/notee/helpers/view_helper.rb

Instance Method Summary collapse

Instance Method Details

#notee_comment_box(post_id) ⇒ Object



23
24
25
# File 'lib/notee/helpers/view_helper.rb', line 23

def notee_comment_box(post_id)
  return render :partial => "notee/partials/comment_box.html.erb", :locals => { :post_id => post_id, :recaptcha => Notee.recaptcha_key }
end

#notee_content(post) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/notee/helpers/view_helper.rb', line 6

def notee_content(post)

  return if post.nil?

  unless @markdown
    renderer = Redcarpet::Render::HTML.new(filter_html: true, hard_wrap: true)
    @markdown = Redcarpet::Markdown.new(renderer, :fenced_code_blocks => true, :highlight => true)
  end

  # TODO: secret_mode
  # if notee.status == Notee::STATUS[:secret_published]
  #   return render :partial => "notee/partials/secret_published.html.erb", :locals => { :item => notee, :markdown => @markdown.render(notee.content).html_safe, :display => false }
  # end

  @markdown.render(post.content).html_safe
end

#notee_descriptionObject



35
36
37
# File 'lib/notee/helpers/view_helper.rb', line 35

def notee_description
  return Notee.blog_meta[:description]
end

#notee_meta(meta = Notee.blog_meta) ⇒ Object



27
28
29
# File 'lib/notee/helpers/view_helper.rb', line 27

def notee_meta(meta = Notee.blog_meta)
  return render :partial => "notee/partials/meta.html.erb", :locals => { :meta => meta, :ga => Notee.google_analytics }
end

#notee_titleObject



31
32
33
# File 'lib/notee/helpers/view_helper.rb', line 31

def notee_title
  return Notee.blog_meta[:title]
end