Sha256: b1e5ce4166e2f1283cbcfcfc56e0d52c68fff76a19c0d3d66ecb78ad7d5b891d
Contents?: true
Size: 1.12 KB
Versions: 1
Compression:
Stored size: 1.12 KB
Contents
# frozen_string_literal: true module Decidim module ReportingProposals module PublishProposalEventOverride extend ActiveSupport::Concern included do def i18n_options return super if author.blank? author_path = link_to("@#{author.nickname}", profile_path(author.nickname)) author_string = "#{author.name} #{author_path}" super.merge({ author: author_string }) resource_admin_url ||= Decidim::ResourceLocatorPresenter.new(resource).admin_url resource_admin_path = link_to(I18n.t(".admin_panel", scope: i18n_scope), resource_admin_url) super.merge({ author: author_string, admin_url: resource_admin_path }) end private def i18n_scope return super unless participatory_space_event? @i18n_scope ||= if extra[:type].to_s == "admin" "decidim.events.proposals.proposal_published_for_admin" else "decidim.events.proposals.proposal_published_for_space" end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
decidim-reporting_proposals-0.6.0 | app/events/concerns/decidim/reporting_proposals/publish_proposal_event_override.rb |