Sha256: bc1eb70ca5c5abfd59914d9f42a6d12be18d6af90730ba4a5e8bebc9b8d87638

Contents?: true

Size: 828 Bytes

Versions: 3

Compression:

Stored size: 828 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This cell renders a collapsible list of authors. Each element from the
  # array of Users will be rendered with the `:cell` cell.
  #
  # Available sizes:
  #  - `:small` => collapses after 3 elements.
  #  - `:default` => collapses after 7 elements. If not specified, this one is
  #    used.
  #
  # Example:
  #
  #    cell(
  #      "decidim/collapsible_authors",
  #      list_of_authors,
  #      cell_name: "my/cell",
  #      cell_options: { my: :options },
  #      hidden_elements_count_i18n_key: "my.custom.key",
  #      size: :small
  #    )
  class CollapsibleAuthorsCell < CollapsibleListCell
    include CellsHelper

    private

    def actionable?
      return false if options[:has_actions] == false
      true if withdrawable? || flagable?
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-core-0.13.1 app/cells/decidim/collapsible_authors_cell.rb
decidim-core-0.13.0 app/cells/decidim/collapsible_authors_cell.rb
decidim-core-0.13.0.pre1 app/cells/decidim/collapsible_authors_cell.rb