Module: Decidim::Initiatives::InitiativesHelper

Included in:
ApplicationHelper, InitiativeDropdownMetadataCell
Defined in:
app/helpers/decidim/initiatives/initiatives_helper.rb

Overview

Helper functions for initiatives views

Instance Method Summary collapse

Instance Method Details

#initiative_nav_items(participatory_space) ⇒ Object

Items to display in the navigation of an initiative



8
9
10
11
12
13
14
15
16
17
18
# File 'app/helpers/decidim/initiatives/initiatives_helper.rb', line 8

def initiative_nav_items(participatory_space)
  components = participatory_space.components.published.or(Decidim::Component.where(id: try(:current_component)))

  components.map do |component|
    {
      name: decidim_escape_translated(component.name),
      url: main_component_path(component),
      active: is_active_link?(main_component_path(component), :inclusive)
    }
  end
end