Class: AmaLayout::NotificationDecorator
- Inherits:
-
Object
- Object
- AmaLayout::NotificationDecorator
- Includes:
- DraperReplacement
- Defined in:
- lib/ama_layout/decorators/notification_decorator.rb
Constant Summary collapse
- ICONS =
{ notice: { icon_class: 'fa-info', colour_class: 'right-sidebar__content-icon--blue' # currently not in use }, warning: { icon_class: 'fa-exclamation', colour_class: 'right-sidebar__content-icon--orange' }, alert: { icon_class: 'fa-exclamation-triangle', colour_class: 'right-sidebar__content-icon--red' } }.freeze
Instance Method Summary collapse
Instance Method Details
#active_class ⇒ Object
31 32 33 |
# File 'lib/ama_layout/decorators/notification_decorator.rb', line 31 def active_class active? ? 'right-sidebar__content--active' : 'right-sidebar__content--inactive' end |
#created_at ⇒ Object
20 21 22 |
# File 'lib/ama_layout/decorators/notification_decorator.rb', line 20 def created_at "#{time_elapsed} ago".humanize end |
#icon ⇒ Object
24 25 26 27 28 29 |
# File 'lib/ama_layout/decorators/notification_decorator.rb', line 24 def icon h.content_tag :div, class: icon_data.fetch(:colour_class) do klass = icon_data.fetch(:icon_class) h.content_tag :i, nil, class: "fa #{klass} right-sidebar__notice-icon" end end |