Sha256: 2805bfd0c07f26133a26776d16cd33f453c7d7a0076db5b76b5dfc60d51504c2

Contents?: true

Size: 774 Bytes

Versions: 8

Compression:

Stored size: 774 Bytes

Contents

# frozen-string_literal: true

module Decidim
  class RoleAssignedToAssemblyEvent < Decidim::Events::SimpleEvent
    include Decidim::Events::NotificationEvent
    include Decidim::Events::AuthorEvent

    def notification_title
      I18n.t("notification_title", **i18n_options).html_safe
    end

    def i18n_role
      I18n.t(extra["role"], scope: "decidim.admin.models.assembly_user_role.roles", default: extra["role"])
    end

    def i18n_options
      {
        resource_path: resource_path,
        resource_title: resource_title,
        resource_url: resource_url,
        scope: event_name,
        participatory_space_title: participatory_space_title,
        participatory_space_url: participatory_space_url,
        role: i18n_role
      }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-assemblies-0.27.5 app/events/decidim/role_assigned_to_assembly_event.rb
decidim-assemblies-0.27.4 app/events/decidim/role_assigned_to_assembly_event.rb
decidim-assemblies-0.27.3 app/events/decidim/role_assigned_to_assembly_event.rb
decidim-assemblies-0.27.2 app/events/decidim/role_assigned_to_assembly_event.rb
decidim-assemblies-0.27.1 app/events/decidim/role_assigned_to_assembly_event.rb
decidim-assemblies-0.27.0 app/events/decidim/role_assigned_to_assembly_event.rb
decidim-assemblies-0.27.0.rc2 app/events/decidim/role_assigned_to_assembly_event.rb
decidim-assemblies-0.27.0.rc1 app/events/decidim/role_assigned_to_assembly_event.rb