Sha256: 44cf528dff5b4612b6428a24d643c40912aaba16f6ab181a8deeaa0635ab262a
Contents?: true
Size: 869 Bytes
Versions: 10
Compression:
Stored size: 869 Bytes
Contents
# frozen_string_literal: true module Decidim module ContentBlocks class ParticipatorySpaceMetadataCell < BaseCell def show return if metadata_valued_items.blank? render end def metadata_valued_items metadata_items.filter_map do |item| next if (value = decidim_escape_translated(presented_space.send(item))).blank? { title: t(item, scope: translations_scope), value: } end end private def metadata_items = [] def presented_space space_presenter.new(resource) end def space_presenter raise "#{self.class.name} is expected to implement #space_presenter" end def translations_scope raise "#{self.class.name} is expected to implement #translations_scope" end end end end
Version data entries
10 entries across 10 versions & 1 rubygems