aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www
diff options
context:
space:
mode:
Diffstat (limited to 'juick-spring-www')
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java6
-rw-r--r--juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html3
2 files changed, 6 insertions, 3 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java
index bc524507..69688513 100644
--- a/juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java
+++ b/juick-spring-www/src/main/java/com/juick/www/controllers/TagController.java
@@ -90,6 +90,9 @@ public class TagController {
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())
);
@@ -97,7 +100,8 @@ public class TagController {
String nextpage = "/tag/" + URLEncoder.encode(paramTag.getName(), "UTF-8") + "?before=" + mids.get(mids.size() - 1);
model.addAttribute("nextpage", nextpage);
}
- return "blog/index";
+ model.addAttribute("tags", tagService.getPopularTags());
+ return "views/index";
}
@RequestMapping("/tag")
diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html
index d57d6791..e67dcd7f 100644
--- a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html
+++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html
@@ -3,8 +3,7 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/mainLayout}">
<head>
- <title th:if="${#authorization.expression('isAuthenticated()')}" th:text="#{title.index.user}">Popular</title>
- <title th:if="${#authorization.expression('isAnonymous()')}" th:text="#{title.index.anonym}">Popular posts</title>
+ <title th:if="${#authorization.expression('isAuthenticated()')}" th:text="${title}">Page title</title>
</head>
<body>