Module: Decidim::Initiatives::Admin::InitiativesHelper

Defined in:
decidim-initiatives/app/helpers/decidim/initiatives/admin/initiatives_helper.rb

Instance Method Summary collapse

Instance Method Details



17
18
19
20
21
# File 'decidim-initiatives/app/helpers/decidim/initiatives/admin/initiatives_helper.rb', line 17

def dropdown_id(collection_ids)
  return "export-dropdown" if collection_ids.blank?

  "export-selection-dropdown"
end

#export_dropdown(collection_ids = nil) ⇒ Object



7
8
9
# File 'decidim-initiatives/app/helpers/decidim/initiatives/admin/initiatives_helper.rb', line 7

def export_dropdown(collection_ids = nil)
  render partial: "decidim/initiatives/admin/exports/dropdown", locals: { collection_ids: }
end

#export_dropdowns(query) ⇒ Object



11
12
13
14
15
# File 'decidim-initiatives/app/helpers/decidim/initiatives/admin/initiatives_helper.rb', line 11

def export_dropdowns(query)
  return export_dropdown if query.conditions.empty?

  export_dropdown.concat(export_dropdown(query.result.map(&:id)))
end