Sha256: a6c0d689b26c2f0f55dbd83654161a876b9e6ef8256a64e542ef3fb644db0dba

Contents?: true

Size: 908 Bytes

Versions: 46

Compression:

Stored size: 908 Bytes

Contents

# frozen-string_literal: true

module Decidim
  # To be used by UserGroup related events that trigger a notification to the administrators.
  class UserGroupAdminEvent < Decidim::Events::SimpleEvent
    delegate :url_helpers, to: "Decidim::Core::Engine.routes"

    i18n_attributes :user_group_name, :groups_admin_url, :groups_admin_path

    def resource_path
      url_helpers.profile_path(user_group_nickname)
    end

    def resource_url
      url_helpers.profile_url(
        user_group_nickname,
        host: user.organization.host
      )
    end

    def groups_admin_path
      Decidim::Admin::Engine.routes.url_helpers.user_groups_path
    end

    def groups_admin_url
      Decidim::Admin::Engine.routes.url_helpers.user_groups_url(host: user.organization.host)
    end

    def user_group_name
      resource.name
    end

    def user_group_nickname
      resource.nickname
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
decidim-core-0.27.9 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.8 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.7 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.6 app/events/decidim/user_group_admin_event.rb
decidim-core-0.26.10 app/events/decidim/user_group_admin_event.rb
decidim-core-0.26.9 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.5 app/events/decidim/user_group_admin_event.rb
decidim-core-0.26.8 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.4 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.3 app/events/decidim/user_group_admin_event.rb
decidim-core-0.26.7 app/events/decidim/user_group_admin_event.rb
decidim-core-0.26.5 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.2 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.1 app/events/decidim/user_group_admin_event.rb
decidim-core-0.26.4 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.0 app/events/decidim/user_group_admin_event.rb
decidim-core-0.26.3 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.0.rc2 app/events/decidim/user_group_admin_event.rb
decidim-core-0.27.0.rc1 app/events/decidim/user_group_admin_event.rb
decidim-core-0.26.2 app/events/decidim/user_group_admin_event.rb