Sha256: 05d57a0f5be1256607ce9ce3fe42c227d13cfaab3d382b5faa0dcd606fd5bdee

Contents?: true

Size: 808 Bytes

Versions: 13

Compression:

Stored size: 808 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ContentBlocks
    class HighlightedParticipatorySpacesCell < BaseCell
      include Decidim::CardHelper

      def show
        render if highlighted_spaces.any?
      end

      def limited_highlighted_spaces
        return highlighted_spaces if max_results.blank?

        highlighted_spaces.limit(max_results)
      end

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

      def i18n_scope; end

      def all_path; end

      def max_results; end

      private

      def cache_hash
        [I18n.locale, highlighted_spaces.map(&:cache_key_with_version)].join(Decidim.cache_key_separator)
      end

      def section_class
        "home__section"
      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_participatory_spaces_cell.rb
decidim-core-0.28.4 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.29.0 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.28.3 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.29.0.rc4 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.29.0.rc3 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.29.0.rc2 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.29.0.rc1 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.28.2 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.28.1 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.28.0 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.28.0.rc5 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb
decidim-core-0.28.0.rc4 app/cells/decidim/content_blocks/highlighted_participatory_spaces_cell.rb