Skip to content

Commit

Permalink
Merge views subtree
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 17, 2023
2 parents e748dc8 + 7ccf9a4 commit 1d18e23
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions template/pages/@/layout/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const hasMegamenu = header.desktop_megamenu
const isAlphabeticalOrderSubmenu = header.alphabetical_order_submenu
const fullWidthSubmenu = header.full_width_submenu
const isCentralizedLogo = header.centralized_logo
const hasAllDepartments = header.menu_all_departments
%>

<div id="overlay" class="fade"></div>
Expand Down Expand Up @@ -268,6 +269,50 @@ const isCentralizedLogo = header.centralized_logo
<% if (categories && categories.length) { %>
<div class="d-none d-lg-block <%= isCategoriesNavFull ? 'col-12 order-lg-last' : 'col' %> header__nav-block">
<nav class="header__nav<%= isCategoriesNavFull ? ' header__nav--full' : '' %>">
<% if (hasAllDepartments) { %>
<div class="d-inline-block">
<a
href="javascript:;"
class="header__category"
id="cd-all"
onmouseover="toggleSubmenu('all', this)"
onclick="toggleSubmenu('all', this)"
>
<%= header.name_all_departments || _.dictionary('all') %>
</a>
<nav class="header__submenu header__submenu--full" id="s-all">
<div class="row">
<% _.categories.forEach(({ name, slug, parent, _id }) => { %>
<% if (!parent) {
%>
<div class="col-12 col-lg-<%- isCategoriesNavFull ? '2' : '4' %>">
<a
id="sd-all-<%= _id %>"
href="/<%= slug %>"
>
<%= name %>
</a>
<% const subcategories = _.categories.filter(({ parent }) => parent && parent.slug === slug) %>
<% if (subcategories.length) { %>
<div id="header__submenu-<%= slug %>">
<ul class="header__links">
<% subcategories.forEach(subcategory => { %>
<li>
<a id="td-all-<%= subcategory._id %>" class="header__submenu-subcategory" href="/<%= subcategory.slug %>">
<%= subcategory.name %>
</a>
</li>
<% }) %>
</ul>
</div>
<% } %>
</div>
<% } %>
<% }) %>
</div>
</nav>
</div>
<% } %>
<% categories.forEach(({ slug, name, _id}) => { %>
<% let $categoryLink %>
<div class="d-inline-block">
Expand Down

0 comments on commit 1d18e23

Please sign in to comment.