diff options
author | Alex Bitney | 2016-02-07 00:00:41 +0200 |
---|---|---|
committer | Alex Bitney | 2016-02-07 00:00:41 +0200 |
commit | c2d316449f85bd2b74ae9ffaa3d08b7a5ee282cf (patch) | |
tree | ce808c6d65e4a61913497f5d397473f75fadc701 /src/main/java/com/juick/http/www/Home.java | |
parent | 1fffebc18bbdbe87b456e2b3bd66e9ce5a6afcb8 (diff) |
added tags when posting new message
added templates engine (rythm engine) and moved something to it.
WARNING: textext plugin does not work when minimized, and also I fixed bug in it.
Diffstat (limited to 'src/main/java/com/juick/http/www/Home.java')
-rw-r--r-- | src/main/java/com/juick/http/www/Home.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/main/java/com/juick/http/www/Home.java b/src/main/java/com/juick/http/www/Home.java index 3688b58e..b8047190 100644 --- a/src/main/java/com/juick/http/www/Home.java +++ b/src/main/java/com/juick/http/www/Home.java @@ -19,6 +19,7 @@ package com.juick.http.www; import com.juick.server.AdsQueries; import com.juick.server.MessagesQueries; +import org.rythmengine.Rythm; import org.springframework.jdbc.core.JdbcTemplate; import java.io.IOException; @@ -119,17 +120,9 @@ public class Home { out.println("<!--noindex-->"); } + if (visitor != null) { - out.println("<form action=\"/post\" method=\"post\" enctype=\"multipart/form-data\" onsubmit=\"return onsubmitNewMessage()\">"); - out.println("<section id=\"newmessage\">"); - out.println(" <textarea name=\"body\" placeholder=\"Новое сообщение...\" onclick=\"$('#newmessage>div').css('display','block');$('#newmessage textarea').css('min-height','70px');\" onkeypress=\"postformListener(this.form,event)\"></textarea>"); - out.println(" <div>"); - out.println(" <input type=\"text\" class=\"img\" name=\"img\" placeholder=\"Ссылка на изображение (JPG/PNG, до 10Мб)\"/> или <a href=\"#\" onclick=\"return attachMessagePhoto(this)\">загрузить</a><br/>"); - out.println(" <input type=\"text\" class=\"tags\" name=\"tags\" placeholder=\"Теги (через пробел)\"/><br/>"); - out.println(" <input type=\"submit\" class=\"subm\" value=\"Отправить\"/>"); - out.println(" </div>"); - out.println("</section>"); - out.println("</form>"); + out.println(Rythm.render("parts/post_form.html")); } if (mids.size() > 0) { |