File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed
views/layouts/better_together/mailers Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,14 @@ def platform_footer_nav_area
7575 @platform_footer_nav_area ||= ::BetterTogether ::NavigationArea . find_by ( identifier : 'platform-footer' )
7676 end
7777
78+ # Retrieves navigation items for the mailer footer.
79+ def mailer_footer_nav_items
80+ # Preload navigation items and their translations in a single query
81+ Mobility . with_locale ( current_locale ) do
82+ @mailer_footer_nav_items ||= platform_footer_nav_area &.top_level_nav_items_includes_children . excluding_hashed || [ ]
83+ end
84+ end
85+
7886 # Retrieves navigation items for the platform footer.
7987 def platform_footer_nav_items
8088 # Preload navigation items and their translations in a single query
@@ -101,6 +109,14 @@ def platform_header_nav_items
101109 end
102110 end
103111
112+ # Retrieves navigation items for the mailer header.
113+ def mailer_header_nav_items
114+ # Preload navigation items and their translations in a single query
115+ Mobility . with_locale ( current_locale ) do
116+ @mailer_header_nav_items ||= platform_header_nav_area . top_level_nav_items_includes_children . excluding_hashed || [ ]
117+ end
118+ end
119+
104120 def render_platform_header_nav_items
105121 Rails . cache . fetch ( cache_key_for_nav_area ( platform_header_nav_area ) ) do
106122 render 'better_together/navigation_items/navigation_items' , navigation_items : platform_header_nav_items
Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ def self.route_name_urls
100100 joins ( join ) . where ( combined_conditions )
101101 }
102102
103+ scope :excluding_hashed , -> { where . not ( 'url ILIKE ?' , '#%' ) }
104+
103105 def build_children ( pages , navigation_area ) # rubocop:todo Metrics/MethodLength
104106 pages . each_with_index do |page , index |
105107 children . build (
Original file line number Diff line number Diff line change 66 < table id ="footer-pages-nav " class ="navbar " width ="600 " cellpadding ="0 " cellspacing ="0 " border ="0 " style ="margin: 0 auto; ">
77 < tr >
88 < td class ="container-fluid text-center " align ="center ">
9- <% platform_footer_nav_items . each_with_index do |nav_item , index | %>
10- <%= link_to nav_item , nav_item . url , class : 'text-decoration-none' %> <% if index < ( platform_footer_nav_items . size - 1 ) %> | <% end %>
9+ <% mailer_footer_nav_items . each_with_index do |nav_item , index | %>
10+ <%= link_to nav_item , nav_item . url , class : 'text-decoration-none' %> <% if index < ( mailer_footer_nav_items . size - 1 ) %> | <% end %>
1111 <% end %>
1212 </ td >
1313 </ tr >
Original file line number Diff line number Diff line change 1010 </ tr >
1111 < tr >
1212 < td class ="" style ="margin-bottom: 24px; " align ="center ">
13- <% platform_header_nav_items . each_with_index do |nav_item , index | %>
14- <%= link_to nav_item , nav_item . url , class : 'text-decoration-none' %> <% if index < ( platform_header_nav_items . size - 1 ) %> | <% end %>
13+ <% mailer_header_nav_items . each_with_index do |nav_item , index | %>
14+ <%= link_to nav_item , nav_item . url , class : 'text-decoration-none' %> <% if index < ( mailer_header_nav_items . size - 1 ) %> | <% end %>
1515 <% end %>
1616 </ td >
1717 </ tr >
You can’t perform that action at this time.
0 commit comments