aboutsummaryrefslogtreecommitdiff
path: root/juick-www
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www')
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/User.java10
-rw-r--r--juick-www/src/main/webapp/WEB-INF/views/blog_tags.html2
2 files changed, 6 insertions, 6 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/User.java b/juick-www/src/main/java/com/juick/www/controllers/User.java
index 8e22c654..5435e23d 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/User.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/User.java
@@ -159,8 +159,6 @@ public class User {
msgs.forEach(m -> m.ReadOnly |= blUIDs.contains(m.getUser().getUid()));
}
model.addAttribute("msgs", msgs);
- model.addAttribute("tags", tagService.getUserTagStats(user.getUid()).stream()
- .sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())).limit(20).collect(Collectors.toList()));
model.addAttribute("headers", head);
model.addAttribute("showAdv",
paramShow == null && before == 0 && paramSearch == null && visitor.getUid() == 0);
@@ -209,7 +207,9 @@ public class User {
model.addAttribute("statsReplies", userService.getStatsReplies(user.getUid()));
model.addAttribute("iread", userService.getUserReadLeastPopular(user.getUid(), 8));
model.addAttribute("tagStats", tagService.getUserTagStats(user.getUid())
- .stream().map(t -> t.getTag().getName()).collect(Collectors.toList()));
+ .stream().sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())).limit(20).map(t -> t.getTag().getName()).collect(Collectors.toList()));
+ model.addAttribute("tags", tagService.getUserTagStats(user.getUid()).stream()
+ .sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())).collect(Collectors.toList()));
return "views/blog_tags";
}
@@ -235,7 +235,7 @@ public class User {
model.addAttribute("statsReplies", userService.getStatsReplies(user.getUid()));
model.addAttribute("iread", userService.getUserReadLeastPopular(user.getUid(), 8));
model.addAttribute("tagStats", tagService.getUserTagStats(user.getUid())
- .stream().map(t -> t.getTag().getName()).collect(Collectors.toList()));
+ .stream().sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())).limit(20).map(t -> t.getTag().getName()).collect(Collectors.toList()));
model.addAttribute("users", userService.getUserFriends(user.getUid()));
return "views/users";
@@ -262,7 +262,7 @@ public class User {
model.addAttribute("statsReplies", userService.getStatsReplies(user.getUid()));
model.addAttribute("iread", userService.getUserReadLeastPopular(user.getUid(), 8));
model.addAttribute("tagStats", tagService.getUserTagStats(user.getUid())
- .stream().map(t -> t.getTag().getName()).collect(Collectors.toList()));
+ .stream().sorted((e1, e2) -> Integer.compare(e2.getUsageCount(), e1.getUsageCount())).limit(20).map(t -> t.getTag().getName()).collect(Collectors.toList()));
model.addAttribute("users", userService.getUserReaders(user.getUid()));
return "views/users";
diff --git a/juick-www/src/main/webapp/WEB-INF/views/blog_tags.html b/juick-www/src/main/webapp/WEB-INF/views/blog_tags.html
index 07f44f8d..51c91e30 100644
--- a/juick-www/src/main/webapp/WEB-INF/views/blog_tags.html
+++ b/juick-www/src/main/webapp/WEB-INF/views/blog_tags.html
@@ -2,7 +2,7 @@
{% import "views/macros/tags" %}
{% block content %}
<p>
- {{ tags(user.name, tagStats) }}
+ {{ tags(user.name, tags) }}
</p>
{% endblock %}
{% block "column" %}