Sha256: 8062e1a105d62e407c9295d22ce1cd0711d1352b657f26920f53d4b69e9a2f18

Contents?: true

Size: 902 Bytes

Versions: 28

Compression:

Stored size: 902 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Events
    # This module is used to be included in event classes (those inheriting from
    # `Decidim::Events::BaseEvent`) that need to create system notifications, which
    # will be later listed to the user in their Notifications Dashboard.
    #
    # This modules adds the needed logic to display these notifications.
    #
    # Example:
    #
    #   class MyEvent < Decidim::Events::BaseEvent
    #     include Decidim::Events::NotificationEvent
    #   end
    module NotificationEvent
      extend ActiveSupport::Concern

      included do
        types << :notification

        def notification_title
          I18n.t(
            "decidim.events.notification_event.notification_title",
            resource_title: resource_title,
            resource_path: resource_path
          ).html_safe
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
decidim-core-0.8.4 lib/decidim/events/notification_event.rb
decidim-core-0.8.3 lib/decidim/events/notification_event.rb
decidim-core-0.8.2 lib/decidim/events/notification_event.rb
decidim-core-0.8.1 lib/decidim/events/notification_event.rb
decidim-core-0.8.0 lib/decidim/events/notification_event.rb
decidim-core-0.7.4 lib/decidim/events/notification_event.rb
decidim-core-0.7.3 lib/decidim/events/notification_event.rb
decidim-core-0.7.2 lib/decidim/events/notification_event.rb
decidim-core-0.7.1 lib/decidim/events/notification_event.rb
decidim-core-0.7.0 lib/decidim/events/notification_event.rb
decidim-core-0.6.8 lib/decidim/events/notification_event.rb
decidim-0.6.8 decidim-core/lib/decidim/events/notification_event.rb
decidim-core-0.6.7 lib/decidim/events/notification_event.rb
decidim-0.6.7 decidim-core/lib/decidim/events/notification_event.rb
decidim-core-0.6.6 lib/decidim/events/notification_event.rb
decidim-0.6.6 decidim-core/lib/decidim/events/notification_event.rb
decidim-core-0.6.5 lib/decidim/events/notification_event.rb
decidim-0.6.5 decidim-core/lib/decidim/events/notification_event.rb
decidim-core-0.6.4 lib/decidim/events/notification_event.rb
decidim-0.6.4 decidim-core/lib/decidim/events/notification_event.rb