Sha256: 7e3165b0653f90e615e3385ac6cc1f9eb911d2b22f38bf8cb06e62c0ebccebcd
Contents?: true
Size: 1.64 KB
Versions: 2
Compression:
Stored size: 1.64 KB
Contents
# frozen_string_literal: true module Decidim module Assemblies module AdminLog # This class holds the logic to present a `Decidim::Assembly` # 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 # AssemblyPresenter.new(action_log, view_helpers).present class AssemblyPresenter < Decidim::Log::BasePresenter private def diff_fields_mapping { description: :i18n, hashtag: :string, decidim_area_id: :area, decidim_scope_id: :scope, developer_group: :i18n, local_area: :i18n, meta_scope: :i18n, participatory_scope: :i18n, participatory_structure: :i18n, promoted: :boolean, published_at: :date, reference: :string, scopes_enabled: :boolean, short_description: :i18n, show_statistics: :boolean, slug: :default, subtitle: :i18n, target: :i18n, title: :i18n } end def i18n_labels_scope "activemodel.attributes.assembly" end def action_string case action when "create", "publish", "unpublish", "update" "decidim.admin_log.assembly.#{action}" else super end end def has_diff? action == "unpublish" || super end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
decidim-assemblies-0.10.1 | app/presenters/decidim/assemblies/admin_log/assembly_presenter.rb |
decidim-assemblies-0.10.0 | app/presenters/decidim/assemblies/admin_log/assembly_presenter.rb |