aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/table_builder_helper.rb
diff options
context:
space:
mode:
authorZog2018-01-15 16:35:08 +0100
committerZog2018-01-25 17:17:58 +0100
commitaefa3a507239b57ebdfe9110f3c8c789da6bce26 (patch)
tree393522417aec5dc006680e8e5a2f14386adf45ae /app/helpers/table_builder_helper.rb
parentfef78d49bbc89aa41fe043b4035585605e14d389 (diff)
downloadchouette-core-aefa3a507239b57ebdfe9110f3c8c789da6bce26.tar.bz2
Refs #5586 @2h; Better implementation of groups
Used it in Lines#index and Lines#show, probably broke everything else
Diffstat (limited to 'app/helpers/table_builder_helper.rb')
-rw-r--r--app/helpers/table_builder_helper.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb
index e66e9c942..bece3bb2a 100644
--- a/app/helpers/table_builder_helper.rb
+++ b/app/helpers/table_builder_helper.rb
@@ -306,12 +306,13 @@ module TableBuilderHelper
content_tag :span, '', class: 'fa fa-cog'
end
- menu = content_tag :ul, class: 'dropdown-menu' do
- (
- CustomLinks.new(item, pundit_user, links, referential).links +
- item.action_links
- ).map do |link|
- gear_menu_link(link)
+ menu = content_tag :div, class: 'dropdown-menu' do
+ item.action_links(params[:action]).grouped_by(:primary, :secondary, :footer).map do |group, _links|
+ if _links.any?
+ content_tag :ul, class: group do
+ _links.map{|link| gear_menu_link(link)}.join.html_safe
+ end
+ end
end.join.html_safe
end