Sha256: 2de95ad87a9b02f7243d3d7020d5ce505a5c94197e10e00b370a4979e70ad06a

Contents?: true

Size: 605 Bytes

Versions: 22

Compression:

Stored size: 605 Bytes

Contents

# frozen_string_literal: true

require "cell/partial"

module Decidim
  # This cell renders the list of endorsers.
  #
  # Example:
  #
  #    cell("decidim/endorsers_list", my_component)
  class EndorsersListCell < Decidim::ViewModel
    include ApplicationHelper

    def show
      return unless endorsers.any?

      render
    end

    private

    # Finds the correct author for each endorsement.
    #
    # Returns an Array of presented Users/UserGroups
    def endorsers
      @endorsers ||= model.endorsements.for_listing.map { |identity| present(identity.normalized_author) }
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
decidim-core-0.25.2 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.25.1 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.25.0 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.25.0.rc4 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.25.0.rc3 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.25.0.rc2 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.25.0.rc1 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.24.3 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.23.6 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.24.2 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.23.5 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.24.1 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.24.0 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.24.0.rc2 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.23.4 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.24.0.rc1 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.23.3 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.23.2 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.23.1 app/cells/decidim/endorsers_list_cell.rb
decidim-core-0.23.1.rc1 app/cells/decidim/endorsers_list_cell.rb