diff options
author | Ugnich Anton | 2012-11-02 16:16:30 +0700 |
---|---|---|
committer | Ugnich Anton | 2012-11-02 16:16:30 +0700 |
commit | b895a6e7a29193754a97e33b6af8bd66f1006fc4 (patch) | |
tree | 8a1921555d2fc9c600ac275e048319637f0a1680 /src/java/com/juick/http/www/UserThread.java | |
parent | 4cb2de9cc1c5bf387d5cf81ab12fd9b0e16d9fc4 (diff) |
Message, user toolbars
Diffstat (limited to 'src/java/com/juick/http/www/UserThread.java')
-rw-r--r-- | src/java/com/juick/http/www/UserThread.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/java/com/juick/http/www/UserThread.java b/src/java/com/juick/http/www/UserThread.java index 2935ab2d..d90d7e94 100644 --- a/src/java/com/juick/http/www/UserThread.java +++ b/src/java/com/juick/http/www/UserThread.java @@ -75,9 +75,9 @@ public class UserThread { out.println("<div id=\"wrapper\">"); out.println("<div id=\"content\" style=\"margin-left: 0; width: 100%\">"); - printMessage(out, sql, MID, locale); + printMessage(out, sql, MID, visitor, locale); - printReplies(out, sql, MID, locale, listview); + printReplies(out, sql, MID, visitor, locale, listview); out.println("</div>"); out.println("</div>"); @@ -89,8 +89,9 @@ public class UserThread { } } - public static void printMessage(PrintWriter out, Connection sql, int mid, Locale locale) { + public static void printMessage(PrintWriter out, Connection sql, int mid, com.juick.User visitor, Locale locale) { ResourceBundle rb = ResourceBundle.getBundle("Global", locale); + ResourceBundle rbthread = ResourceBundle.getBundle("UserThread", locale); PreparedStatement stmt = null; ResultSet rs = null; @@ -112,7 +113,7 @@ public class UserThread { // lat // lon - boolean cancomment = true; + boolean cancomment = visitor != null; tags = (tags != null) ? PageTemplates.formatTags(tags) : ""; if (rs.getInt(5) == 1) { @@ -134,7 +135,7 @@ public class UserThread { txt = PageTemplates.formatMessage(txt); out.println("<ul>"); - out.println(" <li id=\"msg-" + mid + "\" class=\"msg\" style=\"border: 0\">"); + out.println(" <li id=\"msg-" + mid + "\" class=\"msg msgthread\">"); out.println(" <div class=\"msg-avatar\"><a href=\"/" + uname + "/\"><img src=\"//i.juick.com/a/" + uid + ".png\" alt=\"" + uname + "\"/></a></div>"); out.println(" <div class=\"msg-ts\"><a href=\"/" + uname + "/" + mid + "\" title=\"" + rs.getString(9) + "\">" + PageTemplates.formatDate(rs.getInt(8), rs.getString(9), locale) + "</a></div>"); @@ -170,6 +171,21 @@ public class UserThread { } out.println(" </li>"); + out.println(" <li class=\"mtoolbar\"><ul>"); + out.println(" <li><a href=\"/" + mid + "\"><div style=\"background-position: -64px 0\"></div>" + mid + "</a></li>"); + if (visitor != null) { + if (visitor.UID != uid) { + if (MessagesQueries.isSubscribed(sql, visitor.UID, mid)) { + out.println(" <li><a href=\"/post?body=U+%23" + mid + "\"><div style=\"background-position: -48px 0\"></div>" + rbthread.getString("(MToolbar) Subcribed") + "</a></li>"); + } else { + out.println(" <li><a href=\"/post?body=S+%23" + mid + "\"><div style=\"background-position: -16px 0\"></div>" + rbthread.getString("(MToolbar) Subcribe") + "</a></li>"); + } + out.println(" <li><a href=\"/post?body=%21+%23" + mid + "\"><div style=\"background-position: -32px 0\"></div>" + rbthread.getString("(MToolbar) Recommend") + "</a></li>"); + } else { + out.println(" <li><a href=\"/post?body=D+%23" + mid + "\"><div style=\"background-position: 0\"></div>" + rbthread.getString("(MToolbar) Delete") + "</a></li>"); + } + } + out.println(" </ul></li>"); out.println("</ul>"); } } catch (SQLException e) { @@ -180,7 +196,7 @@ public class UserThread { } - public static void printReplies(PrintWriter out, Connection sql, int mid, Locale locale, boolean listview) { + public static void printReplies(PrintWriter out, Connection sql, int mid, com.juick.User visitor, Locale locale, boolean listview) { ResourceBundle rbuser = ResourceBundle.getBundle("User", locale); ArrayList<com.juick.Message> replies = new ArrayList<com.juick.Message>(); |