<%
var currentSection = sections.filter(function(section) { return section.id === activeSectionId; })[0] || null;
var siblingSections;
if (!currentSection) {
siblingSections = sections.filter(function(section) {
if (activeCategoryId) return section['parent_section_id'] === null && section['category_id'] === activeCategoryId;
return section['parent_section_id'] === null;
})
} else {
siblingSections = sections.filter(function(section) {
if (currentSection['parent_section_id']) return section['parent_section_id'] === currentSection['parent_section_id'];
return section['category_id'] === currentSection['category_id'];
})
}
%>
<% siblingSections.forEach(function(section, index) { %>
-
<% if (section.articles.length) { %>
<% } %>
<% }); %>