Sha256: 05047dcd09d8c4396c2580f3e372bb1cd1567a3ec6df8cdb15e1dcefebad1e89

Contents?: true

Size: 1.03 KB

Versions: 16

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

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

        def diff_fields_mapping
          {
            description: :i18n,
            title: :i18n
          }
        end

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

        def i18n_labels_scope
          "activemodel.attributes.participatory_process_step"
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
decidim-participatory_processes-0.14.4 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.14.3 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.14.2 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.14.1 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.13.1 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.12.2 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.13.0 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.12.1 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.13.0.pre1 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.12.0 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.11.2 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.12.0.pre app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.11.1 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.11.0.pre1 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.10.1 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb
decidim-participatory_processes-0.10.0 app/presenters/decidim/participatory_processes/admin_log/step_presenter.rb