diff options
author | 2012-02-20 21:38:29 +0700 | |
---|---|---|
committer | 2012-02-20 21:38:29 +0700 | |
commit | 34da94d887ae7be134d17c4bc9e101a8c198b300 (patch) | |
tree | 2e3d3444fdb4c4508072a39b9962965556111fe2 /src/java/com/juick/http/www/PageTemplates.java | |
parent | 2acfbc4184eec216c2a394029962aa2905c6b0a2 (diff) |
Bugfixes
Diffstat (limited to 'src/java/com/juick/http/www/PageTemplates.java')
-rw-r--r-- | src/java/com/juick/http/www/PageTemplates.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/java/com/juick/http/www/PageTemplates.java b/src/java/com/juick/http/www/PageTemplates.java index 4997f778..b7b2f536 100644 --- a/src/java/com/juick/http/www/PageTemplates.java +++ b/src/java/com/juick/http/www/PageTemplates.java @@ -62,7 +62,7 @@ public class PageTemplates { public static void pageNavigation(PrintWriter out, Locale loc, com.juick.User user) { ResourceBundle rb = ResourceBundle.getBundle("Global", loc); out.println("<div id=\"header\">"); - out.println("<div id=\"logo\"><a href=\"/?show=my\"><img src=\"http://static.juick.com/logo3.png\" width=\"120\" height=\"40\" alt=\"Juick\"/></a></div>"); + out.println("<div id=\"logo\"><a href=\"" + (user != null ? "/?show=my" : "/") + "\"><img src=\"http://static.juick.com/logo3.png\" width=\"120\" height=\"40\" alt=\"Juick\"/></a></div>"); out.println(" <ul id=\"nav\">"); out.println(" <li><a href=\"/\">" + rb.getString("Blogs") + "</a></li>"); // out.println(" <li><a href=\"/chats\">" + rb.getString("Chats") + "</a></li>"); @@ -324,9 +324,12 @@ public class PageTemplates { // lat // lon + boolean cancomment = true; + tags = (tags != null) ? formatTags(tags) : ""; if (rs.getInt(5) == 1) { tags += " *readonly"; + cancomment = false; } switch (rs.getInt(6)) { case 2: @@ -361,7 +364,9 @@ public class PageTemplates { out.println(" <div class=\"msg-avatar\"><a href=\"/" + uname + "/\"><img src=\"http://i.juick.com/a/" + uid + ".png\" alt=\"" + uname + "\"/></a></div>"); out.println(" <div class=\"msg-ts\"><a href=\"/" + uname + "/" + mid + "\">" + formatDate(rs.getInt(8), rs.getString(9), locale) + "</a><div class=\"msg-menu\"><a href=\"#\" onclick=\"$('#msg-menu-" + mid + "').toggle('blind'); return false\"><img src=\"http://static.juick.com/message-menu-icon.png\"></a><ul id=\"msg-menu-" + mid + "\">"); - out.println(" <li><a href=\"#\" onclick=\"return false\">Under construction</a></li>"); + out.println(" <li><a href=\"/post?body=%21%20%23" + mid + "\">" + rb.getString("Recommend message") + "</a></li>"); + out.println(" <li><a href=\"/post?body=%40" + uname + "%20\">" + rb.getString("Send private message") + "</a></li>"); + out.println(" <li><a href=\"/post?body=BL%20%40" + uname + "\">" + rb.getString("Block user") + "</a></li>"); out.println(" </ul></div></div>"); out.println(" <div class=\"msg-header\"><a href=\"/" + uname + "/\">@" + uname + "</a>:" + tags + "</div>"); out.println(" <div class=\"msg-txt\">" + txt + "</div>"); @@ -372,9 +377,9 @@ public class PageTemplates { repliesby = "..."; } out.println(" <div class=\"msg-comments\"><a href=\"/" + uname + "/" + mid + "\">" + formatReplies(rs.getInt(10), locale) + "</a> " + rb.getString("(replies) by") + " " + repliesby + "</div>"); - } else { + } else if (cancomment) { out.println(" <form action=\"/post\" method=\"POST\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"mid\" value=\"" + mid + "\"/>"); - out.println(" <div class=\"msg-comment\"><textarea name=\"body\" rows=\"1\" class=\"reply\" placeholder=\"Add a comment...\" onkeypress=\"postformListener(this.form,event)\"></textarea></div>"); + out.println(" <div class=\"msg-comment\"><textarea name=\"body\" rows=\"1\" class=\"reply\" placeholder=\"Add a comment...\" onkeypress=\"postformListener(this.form,event)\"></textarea><input type=\"submit\" value=\"OK\"/></div>"); out.println(" </form>"); } out.println(" </li>"); |