Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Fix header layout for spree 4.0 #272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%= render partial: 'spree/static_content/static_content_list', collection: Spree::Page.by_store(current_store).visible.header_links, as: :page %>
<%= render partial: 'spree/static_content/static_content_list', collection: Spree::Page.by_store(current_store).visible.header_links, as: :page, locals: { li_class: 'nav-item', a_class: 'nav-link'} %>
4 changes: 3 additions & 1 deletion app/views/spree/static_content/_static_content_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
<li><%= link_to page.title, page.foreign_link, target: '_blank', rel: 'nofollow' %></li>
<% else %>
<% page_uri = Rails.application.routes.named_routes[:spree].path.spec.to_s == '/' ? page.slug : Rails.application.routes.named_routes[:spree].path.spec.to_s + page.slug %>
<li class="<%= 'current' if (request.fullpath.gsub('//','/') == page_uri) %>"><%= link_to page.title, page_uri %></li>
<% li_class ||= 'current' if (request.fullpath.gsub('//','/') == page_uri) %>
<% a_class ||= '' %>
<li class="<%= li_class if li_class.present? %>"><%= link_to page.title&.capitalize, page_uri, :class => a_class %></li>
<% end %>