Sha256: f0756ad05d0cb219c028bdb098c55864893520f579ddea799445abb723821212

Contents?: true

Size: 783 Bytes

Versions: 13

Compression:

Stored size: 783 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ContentBlocks
    # This block uses a cell to list elements and generates a content block
    # that passes the highlighted elements configured in the content block
    class HighlightedElementsWithCellForListCell < HighlightedElementsCell
      def show
        render unless list_cell.try(:items_blank?)
      end

      private

      def list_cell_path
        raise "#{self.class.name} is expected to implement #list_cell_path"
      end

      def list_cell
        @list_cell ||= cell(
          list_cell_path,
          published_components.one? ? published_components.first : published_components,
          **model.settings.to_h.merge(see_all_path:)
        )
      end

      def see_all_path; end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.28.4 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.29.0 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.28.3 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.29.0.rc4 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.29.0.rc3 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.29.0.rc2 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.29.0.rc1 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.28.2 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.28.1 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.28.0 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.28.0.rc5 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb
decidim-core-0.28.0.rc4 app/cells/decidim/content_blocks/highlighted_elements_with_cell_for_list_cell.rb