Sha256: 82092e001e5ece2ce36dae2f12f5fcf412a96589bfd15293b4ba67201c1b436d

Contents?: true

Size: 963 Bytes

Versions: 60

Compression:

Stored size: 963 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Conferences
    module AdminLog
      # This class holds the logic to present a `Decidim::Conferences::Invite`
      # for the `AdminLog` log.
      #
      # Usage should be automatic and you shouldn't need to call this class
      # directly, but here's an example:
      #
      #    action_log = Decidim::ActionLog.last
      #    view_helpers # => this comes from the views
      #    ConferenceInvitePresenter.new(action_log, view_helpers).present
      class ConferenceInvitePresenter < Decidim::Log::BasePresenter
        private

        def action_string
          case action
          when "create", "delete", "update"
            "decidim.conferences.admin_log.invite.#{action}"
          else
            super
          end
        end

        def i18n_params
          super.merge(
            attendee_name: action_log.resource.user.name
          )
        end
      end
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

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