Class: Decidim::NotificationCell

Inherits:
ViewModel
  • Object
show all
Includes:
IconHelper, SanitizeHelper
Defined in:
decidim-core/app/cells/decidim/notification_cell.rb

Overview

This cell renders a notification from a notifications collection

Constant Summary

Constants included from IconHelper

IconHelper::DEFAULT_RESOURCE_TYPE_ICONS

Instance Method Summary collapse

Methods included from IconHelper

#component_icon, #manifest_icon, #resource_icon, #resource_type_icon, #resource_type_icon_key

Instance Method Details

#notification_titleObject



15
16
17
18
19
# File 'decidim-core/app/cells/decidim/notification_cell.rb', line 15

def notification_title
  notification.event_class_instance.notification_title
rescue StandardError
  I18n.t("decidim.notifications.show.missing_event")
end


21
22
23
24
25
26
27
28
29
# File 'decidim-core/app/cells/decidim/notification_cell.rb', line 21

def participatory_space_link
  return unless notification.resource.respond_to?(:participatory_space)

  participatory_space = notification.resource.participatory_space
  link_to(
    decidim_html_escape(translated_attribute(participatory_space.title)),
    resource_locator(participatory_space).path
  )
end

#showObject



11
12
13
# File 'decidim-core/app/cells/decidim/notification_cell.rb', line 11

def show
  render :show
end