From 29a503b1762bf201c5e1f4b48a447871dfc1dbb6 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 13 Dec 2016 23:21:00 +0300 Subject: juick-spring-www: fix templates logic --- .../main/java/com/juick/www/controllers/IndexController.java | 4 +++- .../WEB-INF/templates/views/partial/blog_messages.html | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'juick-spring-www/src/main') diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java index 4576e9d3..ffc64221 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java @@ -96,6 +96,9 @@ public class IndexController { model.addAttribute("msgs", msgs.stream().map(msg -> { msg.ReadOnly |= blUIDs.contains(msg.getUser().getUid()); + if (msg.ReadOnly) { + msg.ReadOnly = visitor.getUid() != msg.getUser().getUid(); + } return msg; }).collect(Collectors.toList()) ); @@ -109,7 +112,6 @@ public class IndexController { } model.addAttribute("nextpage", nextpage); } - //model.addAttribute("isModerator", userService.getModerators().contains(visitor.getUid())); return "views/index"; } diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_messages.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_messages.html index b444acc2..2bf0e627 100644 --- a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_messages.html +++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_messages.html @@ -25,15 +25,15 @@
Lorem ipsum