From 49039945a1c6964b173e9b96b67b5fe610f48000 Mon Sep 17 00:00:00 2001 From: makc Date: Wed, 19 Apr 2017 14:28:05 +0200 Subject: quick fix for 0 replies issue --- .../java/com/juick/www/controllers/UserThread.java | 54 +++++++++++----------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'juick-www/src/main/java/com/juick/www') diff --git a/juick-www/src/main/java/com/juick/www/controllers/UserThread.java b/juick-www/src/main/java/com/juick/www/controllers/UserThread.java index 0aeac4c6..c3a2a24e 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/UserThread.java +++ b/juick-www/src/main/java/com/juick/www/controllers/UserThread.java @@ -244,6 +244,32 @@ public class UserThread { } } + boolean foldable = false; + if (replies.size() > 10) { + for (int i = 0; i < replies.size() - 1; i++) { + if (replies.get(i).getChildsCount() > 1) { + foldable = true; + break; + } + } + } + + out.println("
"); + out.print("
"); + if (listview) { + out.print("Показать деревом"); + } else { + if (foldable) { + out.print("Раскрыть все · "); + } + out.print("Показать списком"); + } + out.print("
"); + out.println("

Ответы (" + replies.size() + ")

"); + out.println("
"); + + out.println(""); } public void printTree(PrintWriter out, List replies, com.juick.User visitor, int ReplyTo, int margin, boolean hidden) { -- cgit v1.2.3