Sha256: d1797d0945d6efa858e999fcdd5c982e453ffcc9c225a74c06d459ac5a806833

Contents?: true

Size: 942 Bytes

Versions: 13

Compression:

Stored size: 942 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Initiatives
    module ContentBlocks
      class HighlightedInitiativesCell < Decidim::ContentBlocks::HighlightedParticipatorySpacesCell
        BLOCK_ID = "highlighted-initiatives"

        delegate :current_organization, to: :controller

        def highlighted_spaces
          @highlighted_spaces ||= OrganizationPrioritizedInitiatives
                                  .new(current_organization, order)
                                  .query
        end

        def i18n_scope
          "decidim.initiatives.pages.home.highlighted_initiatives"
        end

        def all_path
          Decidim::Initiatives::Engine.routes.url_helpers.initiatives_path
        end

        private

        def max_results
          model.settings.max_results
        end

        def order
          model.settings.order
        end

        def block_id = BLOCK_ID
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

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