Sha256: a19350d684c29040c441d6f947ccb292f4fe077c775788c199ee30a12eb3c74f
Contents?: true
Size: 1.02 KB
Versions: 18
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true module Decidim module AdminLog # This class holds the logic to present a `Decidim::ImpersonationLog` # for the `AdminLog` log. # # Usage should be automatic and you should not need to call this class # directly, but here is an example: # # action_log = Decidim::ActionLog.last # view_helpers # => this comes from the views # ImpersonationLogPresenter.new(action_log, view_helpers).present class ImpersonationLogPresenter < Decidim::Log::BasePresenter alias h view_helpers private def action_string case action when "manage" "decidim.admin_log.impersonation_log.#{action}" else super end end def i18n_params super.merge( reason: action_log.extra["reason"] ) end def resource_presenter @resource_presenter ||= Decidim::Log::UserPresenter.new(action_log.resource.user, h, action_log.extra["resource"]) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems