Module: Decidim::Assemblies::AssembliesHelper

Includes:
FilterAssembliesHelper, Decidim::AttachmentsHelper, FiltersHelper, IconHelper, ResourceHelper, ResourceReferenceHelper, SanitizeHelper
Included in:
AssemblyDropdownMetadataCell, ContentBlocks::MainDataCell
Defined in:
app/helpers/decidim/assemblies/assemblies_helper.rb

Overview

Helpers related to the Assemblies layout.

Instance Method Summary collapse

Methods included from FilterAssembliesHelper

#assembly_types, #filter_sections, #filter_types_values

Instance Method Details

#assembly_nav_items(participatory_space) ⇒ Object

Items to display in the navigation of an assembly



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app/helpers/decidim/assemblies/assemblies_helper.rb', line 16

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

  [
    *(if participatory_space.members.not_ceased.any?
        [{
          name: t("assembly_member_menu_item", scope: "layouts.decidim.assembly_navigation"),
          url: decidim_assemblies.assembly_assembly_members_path(participatory_space),
          active: is_active_link?(decidim_assemblies.assembly_assembly_members_path(participatory_space), :inclusive)
        }]
      end
     )
  ] + 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