From 2048543036133fd2a563664fd6d6346e4e49ebe5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 Apr 2018 11:07:24 +0300 Subject: www: unread discussions badge --- juick-www/src/main/assets/style.css | 1 + juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java | 1 + juick-www/src/main/resources/templates/views/partial/navigation.html | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'juick-www') diff --git a/juick-www/src/main/assets/style.css b/juick-www/src/main/assets/style.css index d2cb984f..077465ab 100644 --- a/juick-www/src/main/assets/style.css +++ b/juick-www/src/main/assets/style.css @@ -349,6 +349,7 @@ article .tags { min-height: 1px; } article .tags > a, +.badge, .msg-tags > a { background: #eee; border: 1px solid #eee; diff --git a/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java b/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java index 5bbea56b..e840b767 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java +++ b/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java @@ -79,6 +79,7 @@ public class MessagesWWW { model.addAttribute("iread", userService.getUserReadLeastPopular(user.getUid(), 8)); model.addAttribute("tagStats", tagService.getUserTagStats(user.getUid()) .stream().sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())).limit(20).map(t -> t.getTag().getName()).collect(Collectors.toList())); + model.addAttribute("unread", messagesService.getUnread(visitor)); } @GetMapping("/") diff --git a/juick-www/src/main/resources/templates/views/partial/navigation.html b/juick-www/src/main/resources/templates/views/partial/navigation.html index 5affcdd8..4e3a6ae3 100644 --- a/juick-www/src/main/resources/templates/views/partial/navigation.html +++ b/juick-www/src/main/resources/templates/views/partial/navigation.html @@ -18,7 +18,7 @@