Module: SimplePages::PagesHelper
- Defined in:
- app/helpers/simple_pages/pages_helper.rb
Instance Method Summary collapse
- #author_vcard(author) ⇒ Object
- #local_published_at(object) ⇒ Object
- #page_author_options ⇒ Object
- #page_cluster_options ⇒ Object
- #page_layout_at_options ⇒ Object
- #publish_time(published_at, updated_at) ⇒ Object
- #selected_page_author(object) ⇒ Object
Instance Method Details
#author_vcard(author) ⇒ Object
14 15 16 17 18 |
# File 'app/helpers/simple_pages/pages_helper.rb', line 14 def () content_tag :span, class: 'author vcard' do t('helpers.posted_by', name: content_tag(:span, )).html_safe end end |
#local_published_at(object) ⇒ Object
24 25 26 |
# File 'app/helpers/simple_pages/pages_helper.rb', line 24 def local_published_at(object) object.published_at? ? object.published_at.localtime : nil end |
#page_author_options ⇒ Object
28 29 30 31 32 |
# File 'app/helpers/simple_pages/pages_helper.rb', line 28 def ::User.unscoped.map do || [.name, .simple_page_owner_option] end end |
#page_cluster_options ⇒ Object
34 35 36 37 38 |
# File 'app/helpers/simple_pages/pages_helper.rb', line 34 def ::Role.enabled.map do |role| [t(role.name, scope: 'roles.names'), role.name] end end |
#page_layout_at_options ⇒ Object
40 41 42 43 44 |
# File 'app/helpers/simple_pages/pages_helper.rb', line 40 def page_layout_at.map do |key| [t(key, scope: 'simple_pages.layout_at'), key] end end |
#publish_time(published_at, updated_at) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'app/helpers/simple_pages/pages_helper.rb', line 3 def publish_time(published_at, updated_at) return unless published_at = { datetime: published_at, pubdate: true, :'data-updated' => (updated_at != published_at ? 'true' : nil ), class: 'published_at' } content_tag :time, ::I18n.l(published_at, format: :long), end |
#selected_page_author(object) ⇒ Object
20 21 22 |
# File 'app/helpers/simple_pages/pages_helper.rb', line 20 def (object) object..try :simple_page_owner_option end |