Skip to content

Commit

Permalink
menu size by 6 elements
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed May 14, 2024
1 parent 36322c7 commit d738441
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/helpers/concerns/layout_helper_override.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

module LayoutHelperOverride
def extended_navigation_bar(items, max_items: 6)
return unless items.any?

extra_items = items.slice((max_items + 1)..-1) || []
active_item = items.find { |item| item[:active] }

controller.view_context.render partial: "decidim/shared/extended_navigation_bar", locals: {
items: items,
extra_items: extra_items,
active_item: active_item,
max_items: max_items
}
end
end
1 change: 1 addition & 0 deletions config/initializers/getxo_customizations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@

# User select2 to enable multiple zones selector in resource permissions
Decidim::Admin::ResourcePermissionsController.include(Decidim::Admin::NeedsMultiselectSnippets)
Decidim::LayoutHelper.prepend(LayoutHelperOverride)
end

0 comments on commit d738441

Please sign in to comment.