Sha256: d1a17269b25ed8aecd9c01bb47191faaf592ab44f00fdb9efd82b3163d930b01

Contents?: true

Size: 906 Bytes

Versions: 75

Compression:

Stored size: 906 Bytes

Contents

# frozen_string_literal: true

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

      def diff_fields_mapping
        {
          name: :i18n,
          area_type_id: :area_type
        }
      end

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

      def i18n_labels_scope
        "activemodel.attributes.area"
      end
    end
  end
end

Version data entries

75 entries across 75 versions & 1 rubygems

Version Path
decidim-core-0.15.0 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.14.4 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.14.3 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.14.2 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.14.1 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.13.1 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.12.2 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.13.0 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.12.1 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.13.0.pre1 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.12.0 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.11.2 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.12.0.pre app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.11.1 app/presenters/decidim/admin_log/area_presenter.rb
decidim-core-0.11.0.pre1 app/presenters/decidim/admin_log/area_presenter.rb