Module: Peoplefinder::ApplicationHelper
- Defined in:
- app/helpers/peoplefinder/application_helper.rb
Constant Summary collapse
- FLASH_NOTICE_KEYS =
%w[ error notice warning ]
Instance Method Summary collapse
- #breadcrumbs(items) ⇒ Object
- #flash_messages ⇒ Object
- #govspeak(source) ⇒ Object
- #info_text(key) ⇒ Object
- #last_update ⇒ Object
Instance Method Details
#breadcrumbs(items) ⇒ Object
18 19 20 21 |
# File 'app/helpers/peoplefinder/application_helper.rb', line 18 def (items) render partial: 'peoplefinder/shared/breadcrumbs', locals: { items: items } end |
#flash_messages ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/helpers/peoplefinder/application_helper.rb', line 25 def = flash.keys.map(&:to_s) & FLASH_NOTICE_KEYS return if .empty? content_tag(:div, class: 'inner-block') { content_tag(:div, id: 'flash-messages') { .map { |type| (type) }.join.html_safe } } end |
#govspeak(source) ⇒ Object
12 13 14 15 16 |
# File 'app/helpers/peoplefinder/application_helper.rb', line 12 def govspeak(source) = { header_offset: 2 } doc = Govspeak::Document.new(source, ) doc.to_html.html_safe end |
#info_text(key) ⇒ Object
35 36 37 |
# File 'app/helpers/peoplefinder/application_helper.rb', line 35 def info_text(key) t(key, scope: %w[peoplefinder views info_text].join('.')).html_safe end |
#last_update ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/helpers/peoplefinder/application_helper.rb', line 3 def last_update current_object = @person || @group if current_object && current_object.updated_at.present? "Last updated: #{ current_object.updated_at.strftime('%d %b %Y %H:%M') }." end end |