Sha256: 8da5bcdc8015c475e18b9514cb55036f9045702d918a8c3be7d1bf352e9953e1

Contents?: true

Size: 648 Bytes

Versions: 10

Compression:

Stored size: 648 Bytes

Contents

# frozen-string_literal: true

module Decidim
  module Plans
    class PublishPlanEvent < Decidim::Events::SimpleEvent
      include Decidim::Events::CoauthorEvent

      def resource_text
        # TODO
      end

      private

      def i18n_scope
        return "decidim.events.plans.plan_published_for_space" if participatory_space_event?
        return "decidim.events.plans.plan_published_for_proposals" if proposal_author_event?

        super
      end

      def participatory_space_event?
        extra.dig(:participatory_space)
      end

      def proposal_author_event?
        extra.dig(:proposal_author)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
decidim-plans-0.18.2 app/events/decidim/plans/publish_plan_event.rb
decidim-plans-0.18.1 app/events/decidim/plans/publish_plan_event.rb
decidim-plans-0.18.0 app/events/decidim/plans/publish_plan_event.rb
decidim-plans-0.17.0 app/events/decidim/plans/publish_plan_event.rb
decidim-plans-0.16.9 app/events/decidim/plans/publish_plan_event.rb
decidim-plans-0.16.8 app/events/decidim/plans/publish_plan_event.rb
decidim-plans-0.16.7 app/events/decidim/plans/publish_plan_event.rb
decidim-plans-0.16.6 app/events/decidim/plans/publish_plan_event.rb
decidim-plans-0.16.5 app/events/decidim/plans/publish_plan_event.rb
decidim-plans-0.16.4 app/events/decidim/plans/publish_plan_event.rb