Skip to content

Commit

Permalink
Fixing missing non-leaf verticals in view
Browse files Browse the repository at this point in the history
  • Loading branch information
goulven authored and goulven committed Dec 6, 2024
1 parent 7b05c30 commit 1ddf8ea
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,29 @@ public List<ProductCategory> leafs(boolean havingVertical) {

return ret;

}


/**
* Return all verticals defined from this google node
*/
public List<ProductCategory> verticals() {
List<ProductCategory> ret = new ArrayList<ProductCategory>();

for (ProductCategory c : children) {
ret.addAll(c.verticals());
}

if (vertical != null) {
ret.add(this);
}

return ret;

}



/**
* Return the hierarchy for this category
*
Expand Down
14 changes: 4 additions & 10 deletions ui/src/main/resources/templates/default/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@



<!-- Hero for Core Team -->
<!-- Hero section -->
<section class="bg-green-transparent ">
<div class="container">
<div class="row justify-content-center">
Expand Down Expand Up @@ -76,18 +76,12 @@ <h1 class="display-2 mb-3" th:text="${category.googleNames.i18n(siteLanguage)}"
</ol>
</nav>
</th:block>






</div>
</div>
</div>
</section>

<!-- Core team Members -->
<!-- Categories tree links -->
<section class="pt-0">
<div class="container ">
<div class="row mt-4">
Expand Down Expand Up @@ -141,11 +135,11 @@ <h1 class="display-2 mb-3" th:text="${category.googleNames.i18n(siteLanguage)}"
</section>


<!-- Quick access -->
<!-- All leaf categories -->
<section class="section bg-green-transparent section-lg pt-0">
<div class="container ">
<div class="row mt-4">
<div th:each="child, stat : ${category.leafs(true)}" th:classappend="${stat.first ? 'col-md-3 col-lg-3' : 'col-md-3 col-lg-3'} " class="col-12 mb-lg-0">
<div th:each="child, stat : ${category.verticals()}" th:classappend="${stat.first ? 'col-md-3 col-lg-3' : 'col-md-3 col-lg-3'} " class="col-12 mb-lg-0">
<div th:unless="${category.children.contains(child)}" class="card shadow border-gray-300 mt-2">

<div class="card-body text-center">
Expand Down

0 comments on commit 1ddf8ea

Please sign in to comment.