Sha256: 2afe3e068b36383b219d3a7d407f335903227f82084af81b14c84ce0f0c9c4ca

Contents?: true

Size: 695 Bytes

Versions: 7

Compression:

Stored size: 695 Bytes

Contents

# frozen_string_literal: true

require "cell/partial"

module Decidim
  module Meetings
    # This cell renders the list of public participants of a meeting.
    #
    # Example:
    #
    #    cell("decidim/public_participants_list", meeting)
    class PublicParticipantsListCell < Decidim::ViewModel
      include ApplicationHelper

      def show
        return if public_participants.blank?

        render
      end

      private

      # Finds the public participants (as users) of meeting
      #
      # Returns an Array of presented Users
      def public_participants
        @public_participants ||= model.public_participants.map { |user| present(user) }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-meetings-0.25.2 app/cells/decidim/meetings/public_participants_list_cell.rb
decidim-meetings-0.25.1 app/cells/decidim/meetings/public_participants_list_cell.rb
decidim-meetings-0.25.0 app/cells/decidim/meetings/public_participants_list_cell.rb
decidim-meetings-0.25.0.rc4 app/cells/decidim/meetings/public_participants_list_cell.rb
decidim-meetings-0.25.0.rc3 app/cells/decidim/meetings/public_participants_list_cell.rb
decidim-meetings-0.25.0.rc2 app/cells/decidim/meetings/public_participants_list_cell.rb
decidim-meetings-0.25.0.rc1 app/cells/decidim/meetings/public_participants_list_cell.rb