Sha256: 0838d6a34c16073341235cb6ff2b0bb9fc5325b1daf118a0eab4e00c2f2f0df9
Contents?: true
Size: 783 Bytes
Versions: 39
Compression:
Stored size: 783 Bytes
Contents
# frozen_string_literal: true module Decidim # This cell renders the reuslts of the global search page. class SearchResultsCell < Decidim::ViewModel include Decidim::SearchesHelper include Decidim::CardHelper def show render :show end def sections model end def non_empty_sections sections.select { |_name, results| results[:count].positive? } end def sections_to_render return non_empty_sections.slice(selected_resource_type) if has_selected_resource_type? non_empty_sections end def params options[:params] end def selected_resource_type params.dig(:filter, :resource_type) end def has_selected_resource_type? selected_resource_type.present? end end end
Version data entries
39 entries across 39 versions & 1 rubygems