Sha256: 22baad21c8d7a64566105027db7a126c02e4f5a8b85245bb37328f275651b7f1
Contents?: true
Size: 1.02 KB
Versions: 5
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true module Decidim # Renders a collection of activities using a different cell for # each one. class ActivitiesCell < Decidim::ViewModel include Decidim::CardHelper include Decidim::IconHelper include Decidim::Core::Engine.routes.url_helpers # Since we're rendering each activity separatedly we need to trigger # BatchLoader in order to accumulate all the ids to be found later. def show return if activities.blank? activities.map do |activity| activity.organization_lazy activity.resource_lazy activity.participatory_space_lazy activity.component_lazy end render end def activity_cell_for(activity) options = { show_author: (context[:user] != activity.user) } cell "#{activity.resource_type.constantize.name.underscore}_activity", activity, context: options rescue NameError cell "decidim/activity", activity, context: options end def activities model end end end
Version data entries
5 entries across 5 versions & 1 rubygems