From c0831038bd7bde32df5af8fb851d210daeccc853 Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Mon, 12 Dec 2016 22:41:10 +0700 Subject: i18n for pages --- .../main/java/com/juick/www/controllers/IndexController.java | 12 +++--------- .../main/java/com/juick/www/controllers/PMController.java | 1 - .../java/com/juick/www/controllers/SettingsController.java | 1 - .../com/juick/www/controllers/ShowMessageController.java | 8 ++++---- 4 files changed, 7 insertions(+), 15 deletions(-) (limited to 'juick-spring-www/src/main/java/com/juick/www/controllers') 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 7821a916..4576e9d3 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 @@ -55,12 +55,7 @@ public class IndexController { User visitor = UserUtils.getCurrentUser(); - String title; - if (!visitor.isAnonym()) { - title = "Популярные"; - } else { - title = "Микроблоги Juick: популярные записи"; - } + String title = ""; int before = paramBefore.orElse(0); @@ -95,7 +90,6 @@ public class IndexController { } model.addAttribute("title", title); model.addAttribute("tags", tagService.getPopularTags()); - model.addAttribute("showAdv", true); List msgs = messagesService.getMessages(mids); List blUIDs = userService.checkBL(visitor.getUid(), msgs.stream().map(m -> m.getUser().getUid()).collect(Collectors.toList())); @@ -121,12 +115,12 @@ public class IndexController { @RequestMapping(value = "/login", method = RequestMethod.GET) public String getLoginForm() { - return "layout/login"; + return "views/login"; } @RequestMapping(value = "/login-error", method = RequestMethod.GET) public String getLoginErrorForm(Model model) { model.addAttribute("loginError", true); - return "layout/login"; + return "views/login"; } } \ No newline at end of file diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java index fc5937dd..3228b4c0 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/PMController.java @@ -67,7 +67,6 @@ public class PMController { uname = ""; } context.put("title", title); - context.put("visitor", visitor); context.put("msgs", msgs); context.put("tags", tagService.getPopularTags()); context.put("uname", uname); diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java index e7319fb9..65309e4e 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/SettingsController.java @@ -269,7 +269,6 @@ public class SettingsController { throw new HttpBadRequestException(); } context.put("title", "Настройки"); - context.put("visitor", visitor); context.put("result", result); return "views/settings_result"; } diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java index df204c5f..62e7293b 100644 --- a/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java +++ b/juick-spring-www/src/main/java/com/juick/www/controllers/ShowMessageController.java @@ -92,7 +92,7 @@ public class ShowMessageController { throw new HttpNotFoundException(); } - return "index"; + return "views/index"; } @RequestMapping("/{userName}/friends") @@ -111,7 +111,7 @@ public class ShowMessageController { throw new HttpNotFoundException(); } - return "index"; + return "views/index"; } @RequestMapping("/{userName}/readers") @@ -130,7 +130,7 @@ public class ShowMessageController { throw new HttpNotFoundException(); } - return "index"; + return "views/index"; } @RequestMapping("/{userName}/tags") @@ -149,7 +149,7 @@ public class ShowMessageController { throw new HttpNotFoundException(); } - return "index"; + return "views/index"; } @RequestMapping("/{userName}/{postNumber}") -- cgit v1.2.3