From 1ddf8ead17a94bb085309def3c268ba5adc80923 Mon Sep 17 00:00:00 2001 From: goulven Date: Fri, 6 Dec 2024 09:29:48 +0100 Subject: [PATCH] Fixing missing non-leaf verticals in view --- .../commons/model/ProductCategory.java | 20 +++++++++++++++++++ .../resources/templates/default/category.html | 14 ++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/commons/src/main/java/org/open4goods/commons/model/ProductCategory.java b/commons/src/main/java/org/open4goods/commons/model/ProductCategory.java index 84e3313f..4f6197a2 100644 --- a/commons/src/main/java/org/open4goods/commons/model/ProductCategory.java +++ b/commons/src/main/java/org/open4goods/commons/model/ProductCategory.java @@ -201,9 +201,29 @@ public List leafs(boolean havingVertical) { return ret; + } + + + /** + * Return all verticals defined from this google node + */ + public List verticals() { + List ret = new ArrayList(); + + for (ProductCategory c : children) { + ret.addAll(c.verticals()); + } + + if (vertical != null) { + ret.add(this); + } + + return ret; } + + /** * Return the hierarchy for this category * diff --git a/ui/src/main/resources/templates/default/category.html b/ui/src/main/resources/templates/default/category.html index 28d5f8c9..6d85aebc 100644 --- a/ui/src/main/resources/templates/default/category.html +++ b/ui/src/main/resources/templates/default/category.html @@ -41,7 +41,7 @@ - +
@@ -76,18 +76,12 @@

- - - - - -

- +
@@ -141,11 +135,11 @@

- +
-
+