Module: Notee::Helpers::ViewHelper

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

Instance Method Summary collapse

Instance Method Details

#notee_comment_box(id) ⇒ Object



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

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

#notee_content(notee) ⇒ 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(notee)

  return if notee.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(notee.content).html_safe
end

#notee_meta(meta) ⇒ Object



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

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