diff options
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>(); |