From 7c9a7590f30873df16941057c59abdb4b8672836 Mon Sep 17 00:00:00 2001 From: Ugnich Anton Date: Wed, 9 Jul 2014 14:57:58 +0700 Subject: Change message privacy --- src/java/com/juick/http/www/PageTemplates.java | 16 +++++++++++++--- web/scripts3.js | 8 ++++++++ web/style3.css | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java index cefd3cdd..dabbea99 100644 --- a/src/java/com/juick/http/www/PageTemplates.java +++ b/src/java/com/juick/http/www/PageTemplates.java @@ -53,7 +53,7 @@ public class PageTemplates { out.print(""); out.print(""); out.print(""); - out.print(""); + out.print(""); if (headers != null) { out.print(headers); } @@ -219,12 +219,19 @@ public class PageTemplates { out.print("Facebook"); out.println(""); out.print("
juick.com © 2008-2014"); - if (sapeon && sape != null && (visitor == null || visitor.UID == 1) && request.getQueryString() == null) { - String links = sape.getPageLinks(request.getRequestURI(), request.getCookies()).render(); + + String queryString = request.getQueryString(); + String requestURI = request.getRequestURI(); + if (sapeon && sape != null && (visitor == null || visitor.UID == 1) && queryString == null) { + String links = sape.getPageLinks(requestURI, request.getCookies()).render(); if (links != null && !links.isEmpty()) { out.print("
Спонсоры: " + links); } } + if ((visitor == null || visitor.UID == 1) && queryString != null && requestURI != null && requestURI.equals("/")) { + out.print("
сиам"); + } + out.println("
"); out.println(""); @@ -529,6 +536,9 @@ public class PageTemplates { out.print("Комментировать "); } out.print("Мне нравится"); + if (visitor != null && msg.Privacy < 0 && msg.User.UID == visitor.UID) { + out.print(" Открыть доступ"); + } if (visitor != null && visitor.UID == 1) { out.print(" +"); out.print(" -"); diff --git a/web/scripts3.js b/web/scripts3.js index e0a39fa4..9cb72a98 100644 --- a/web/scripts3.js +++ b/web/scripts3.js @@ -266,6 +266,14 @@ function setPopular(e,mid,popular) { return false; } +function setPrivacy(e,mid) { + $.ajax('http://api.juick.com/messages/set_privacy?mid='+mid+'&hash='+hash).done(function() { + var a=$(e).closest("article"); + a.append("

OK!

"); + }); + return false; +} + /******************************************************************************/ jQuery.fn.selectText = function(){ diff --git a/web/style3.css b/web/style3.css index b2369d03..0f23d6b4 100644 --- a/web/style3.css +++ b/web/style3.css @@ -175,7 +175,7 @@ blockquote { border-left: 1px dashed #CCC; margin: 10px 0 10px 10px; padding-lef .dialogtxt { background: #EEEEE5; padding: 20px; } /********/ -#footer { clear: both; font-size: 10pt; padding: 10px 0; color: #999; width: 1004px; margin: 0 auto; } +#footer { clear: both; font-size: 10pt; padding: 10px 0; color: #999; width: 1004px; margin: 0 auto 20px 0; } #footer-social { float: left; } #footer-social a { display: inline-block; width: 32px; height: 32px; text-indent: 100%; white-space: nowrap; overflow: hidden; border: 0; margin: 0 15px 0 0; } #footer-left { margin-left: 286px; margin-right: 350px; } -- cgit v1.2.3