From 3b460c49a7cbca72f367bc44ca111b2a508d0cac Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Tue, 28 Feb 2017 14:29:05 +0300
Subject: readonly mode
---
.../java/com/juick/service/MessagesService.java | 2 +
.../com/juick/service/MessagesServiceImpl.java | 6 +
.../main/java/com/juick/www/controllers/Home.java | 22 +-
.../java/com/juick/www/controllers/NewMessage.java | 38 ++--
.../main/java/com/juick/www/controllers/PM.java | 5 +
.../com/juick/www/controllers/PageTemplates.java | 50 +++--
.../java/com/juick/www/controllers/UserThread.java | 10 +-
juick-www/src/main/static/scripts.js | 235 +++++++++++----------
.../webapp/WEB-INF/views/partial/navigation.html | 2 +
.../src/main/webapp/WEB-INF/views/pm_inbox.html | 4 +-
.../src/main/webapp/WEB-INF/views/pm_sent.html | 2 +
.../java/com/juick/components/s2s/JuickBot.java | 32 ++-
12 files changed, 235 insertions(+), 173 deletions(-)
diff --git a/juick-server/src/main/java/com/juick/service/MessagesService.java b/juick-server/src/main/java/com/juick/service/MessagesService.java
index 284b2018..cad0f860 100644
--- a/juick-server/src/main/java/com/juick/service/MessagesService.java
+++ b/juick-server/src/main/java/com/juick/service/MessagesService.java
@@ -81,4 +81,6 @@ public interface MessagesService {
List Теги:
Теги:
"); + printUserTags(out, visitor); + } out.println(""); templates.pageFooter(request, out, visitor, false); diff --git a/juick-www/src/main/java/com/juick/www/controllers/PM.java b/juick-www/src/main/java/com/juick/www/controllers/PM.java index 56b688cf..028feabc 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/PM.java +++ b/juick-www/src/main/java/com/juick/www/controllers/PM.java @@ -17,6 +17,7 @@ */ package com.juick.www.controllers; +import com.juick.service.MessagesService; import com.juick.service.PMQueriesService; import com.juick.service.TagService; import com.juick.service.UserService; @@ -55,6 +56,8 @@ public class PM { @Inject UserService userService; @Inject + MessagesService messagesService; + @Inject WebApp webApp; @RequestMapping(value = "/pm/inbox", method = RequestMethod.GET) @@ -70,6 +73,7 @@ public class PM { model.addAttribute("visitor", visitor); model.addAttribute("msgs", msgs); model.addAttribute("tags", tagService.getPopularTags()); + model.addAttribute("readonly", messagesService.isReadonly()); return "views/pm_inbox"; } @@ -92,6 +96,7 @@ public class PM { model.addAttribute("msgs", msgs); model.addAttribute("tags", tagService.getPopularTags()); model.addAttribute("uname", uname); + model.addAttribute("readonly", messagesService.isReadonly()); return "views/pm_sent"; } diff --git a/juick-www/src/main/java/com/juick/www/controllers/PageTemplates.java b/juick-www/src/main/java/com/juick/www/controllers/PageTemplates.java index eb241f7d..6ee18732 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/PageTemplates.java +++ b/juick-www/src/main/java/com/juick/www/controllers/PageTemplates.java @@ -81,9 +81,9 @@ public class PageTemplates { out.println(""); out.flush(); if (visitor.getUid() > 0) { - out.println(""); + out.println(""); } else { - out.println(""); + out.println(""); } } @@ -109,7 +109,9 @@ public class PageTemplates { out.print("