Class: Decidim::Blogs::PostPresenter
Overview
Instance Method Summary
collapse
#decidim_escape_translated, #decidim_html_escape, #decidim_rich_text, #decidim_sanitize, #decidim_sanitize_admin, #decidim_sanitize_editor, #decidim_sanitize_editor_admin, #decidim_sanitize_newsletter, #decidim_sanitize_translated, #decidim_url_escape, included
#linked_classes_filter_values_for, #linked_classes_for, #resource_locator
#editor_locales, #handle_locales
#attachment?, #default_locale?
Instance Method Details
#author ⇒ Object
13
14
15
16
17
18
19
|
# File 'decidim-blogs/app/presenters/decidim/blogs/post_presenter.rb', line 13
def author
@author ||= if official?
Decidim::Blogs::OfficialAuthorPresenter.new
else
Decidim::UserPresenter.new(super)
end
end
|
#body(links: false, strip_tags: false, all_locales: false) ⇒ Object
35
36
37
38
39
|
# File 'decidim-blogs/app/presenters/decidim/blogs/post_presenter.rb', line 35
def body(links: false, strip_tags: false, all_locales: false)
return unless post
content_handle_locale(post.body, all_locales, links, strip_tags)
end
|
#post ⇒ Object
21
22
23
|
# File 'decidim-blogs/app/presenters/decidim/blogs/post_presenter.rb', line 21
def post
__getobj__
end
|
#post_path ⇒ Object
25
26
27
|
# File 'decidim-blogs/app/presenters/decidim/blogs/post_presenter.rb', line 25
def post_path
Decidim::ResourceLocatorPresenter.new(post).path
end
|
#taxonomy_names(html_escape: false, all_locales: false) ⇒ Object
41
42
43
44
45
|
# File 'decidim-blogs/app/presenters/decidim/blogs/post_presenter.rb', line 41
def taxonomy_names(html_escape: false, all_locales: false)
post.taxonomies.map do |taxonomy|
taxonomy.presenter.title(html_escape:, all_locales:)
end
end
|
#title(html_escape: false, all_locales: false) ⇒ Object
29
30
31
32
33
|
# File 'decidim-blogs/app/presenters/decidim/blogs/post_presenter.rb', line 29
def title(html_escape: false, all_locales: false)
return unless post
super(post.title, html_escape, all_locales)
end
|