Sha256: 7f7a8435f67a5ab7b2d39f4fb58253b170519a5a22d471b687ff14f8f444a123
Contents?: true
Size: 1.53 KB
Versions: 6
Compression:
Stored size: 1.53 KB
Contents
# frozen_string_literal: true module Decidim module EnhancedTextwork module AdminLog # This class holds the logic to present a `Decidim::EnhancedTextwork::ValuationAssignment` # 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 # ValuationAssignmentPresenter.new(action_log, view_helpers).present class ValuationAssignmentPresenter < Decidim::Log::BasePresenter private def resource_presenter @resource_presenter ||= Decidim::EnhancedTextwork::Log::ValuationAssignmentPresenter.new(action_log.resource, h, action_log.extra["resource"]) end def diff_fields_mapping { valuator_role_id: "Decidim::EnhancedTextwork::AdminLog::ValueTypes::ValuatorRoleUserPresenter" } end def action_string case action when "create", "delete" "decidim.enhanced_textwork.admin_log.valuation_assignment.#{action}" else super end end def i18n_labels_scope "activemodel.attributes.valuation_assignment.admin_log" end def diff_actions super + %w(create delete) end def i18n_params super.merge(paragraph_title: h.translated_attribute(action_log.extra["paragraph_title"])) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems