Sha256: 576c692a9fe1ce00189d90f70e5f959756479bee7bac1b5a4466f76257d5cc25

Contents?: true

Size: 934 Bytes

Versions: 20

Compression:

Stored size: 934 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    module AdminLog
      # This class holds the logic to present a `Decidim::Meetings::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
      #    InvitePresenter.new(action_log, view_helpers).present
      class InvitePresenter < Decidim::Log::BasePresenter
        private

        def action_string
          case action
          when "create", "delete", "update"
            "decidim.meetings.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

20 entries across 20 versions & 1 rubygems

Version Path
decidim-meetings-0.22.0 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.21.0 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.20.1 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.20.0 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.19.1 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.18.1 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.19.0 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.17.2 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.18.0 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.17.1 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.16.1 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.17.0 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.16.0 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.15.2 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.15.1 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.15.0 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.14.4 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.14.3 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.14.2 app/presenters/decidim/meetings/admin_log/invite_presenter.rb
decidim-meetings-0.14.1 app/presenters/decidim/meetings/admin_log/invite_presenter.rb