Sha256: 30497718a80b615a67df26c186fc0baa78128b796d3f744ffd3c906b62dd0fc5

Contents?: true

Size: 1.03 KB

Versions: 13

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module Decidim
  module Assemblies
    # Concern to provide a specific breadcrumb item to controllers using it
    module AssemblyBreadcrumb
      extend ActiveSupport::Concern

      private

      def current_participatory_space_breadcrumb_item
        return {} if current_participatory_space.blank?

        dropdown_cell = current_participatory_space_manifest.breadcrumb_cell

        items = current_participatory_space.ancestors.map do |participatory_space|
          {
            label: participatory_space.title,
            url: Decidim::ResourceLocatorPresenter.new(participatory_space).path,
            active: false,
            dropdown_cell:,
            resource: participatory_space
          }
        end

        items << {
          label: current_participatory_space.title,
          url: Decidim::ResourceLocatorPresenter.new(current_participatory_space).path,
          active: true,
          dropdown_cell:,
          resource: current_participatory_space
        }
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-assemblies-0.29.1 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.28.4 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.29.0 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.28.3 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.29.0.rc4 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.29.0.rc3 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.29.0.rc2 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.29.0.rc1 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.28.2 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.28.1 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.28.0 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.28.0.rc5 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb
decidim-assemblies-0.28.0.rc4 app/controllers/concerns/decidim/assemblies/assembly_breadcrumb.rb