diff options
| author | Zog | 2018-01-15 16:35:08 +0100 | 
|---|---|---|
| committer | Zog | 2018-01-25 17:17:58 +0100 | 
| commit | aefa3a507239b57ebdfe9110f3c8c789da6bce26 (patch) | |
| tree | 393522417aec5dc006680e8e5a2f14386adf45ae /app/helpers/table_builder_helper.rb | |
| parent | fef78d49bbc89aa41fe043b4035585605e14d389 (diff) | |
| download | chouette-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.rb | 13 | 
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 | 
