aboutsummaryrefslogtreecommitdiff
path: root/juick-spring-www/src
diff options
context:
space:
mode:
Diffstat (limited to 'juick-spring-www/src')
-rw-r--r--juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java2
-rw-r--r--juick-spring-www/src/main/resources/messages_en.properties4
-rw-r--r--juick-spring-www/src/main/webapp/WEB-INF/templates/index.html14
-rw-r--r--juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html19
-rw-r--r--juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_messages.html49
-rw-r--r--juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_paginator.html3
-rw-r--r--juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_postform.html12
7 files changed, 86 insertions, 17 deletions
diff --git a/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java b/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java
index c56763b1..6f25844f 100644
--- a/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java
+++ b/juick-spring-www/src/main/java/com/juick/www/controllers/IndexController.java
@@ -116,7 +116,7 @@ public class IndexController {
model.addAttribute("nextpage", nextpage);
}
//model.addAttribute("isModerator", userService.getModerators().contains(visitor.getUid()));
- return "index";
+ return "views/index";
}
@RequestMapping(value = "/login", method = RequestMethod.GET)
diff --git a/juick-spring-www/src/main/resources/messages_en.properties b/juick-spring-www/src/main/resources/messages_en.properties
index 8b1384cb..cbd3b5f9 100644
--- a/juick-spring-www/src/main/resources/messages_en.properties
+++ b/juick-spring-www/src/main/resources/messages_en.properties
@@ -9,8 +9,8 @@ link.adv=Advertisement
link.popular=Popular
link.allMessages=All messages
link.withPhotos=Photos
-link.my=My messages
-link.privateMessages=My private messages
+link.my=My feed
+link.privateMessages=PM
link.discuss=Discuss
link.recommended=Recommended
link.postMessage=Post
diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/index.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/index.html
deleted file mode 100644
index 1695cd02..00000000
--- a/juick-spring-www/src/main/webapp/WEB-INF/templates/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{layout/mainLayout}">
-<head>
- <title>Главная страница</title>
-</head>
-
-<body>
-<section layout:fragment="content">
- <p>Главная страница !</p>
-</section>
-</body>
-</html> \ No newline at end of file
diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html
new file mode 100644
index 00000000..8f667135
--- /dev/null
+++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/index.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org"
+ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
+ layout:decorate="~{layout/mainLayout}">
+<head>
+ <title th:text="${title}">Main title</title>
+</head>
+
+<body>
+<section layout:fragment="content">
+ <div th:if="${visitor.getUid() > 0}" th:replace="views/partial/blog_postform" />
+ <div th:replace="views/partial/blog_messages"></div>
+ <div th:replace="views/partial/blog_paginator"></div>
+</section>
+<aside id="column">
+ <p layout:fragment="column" th:replace="views/partial/homecolumn">Main side column</p>
+</aside>
+</body>
+</html> \ No newline at end of file
diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_messages.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_messages.html
new file mode 100644
index 00000000..b444acc2
--- /dev/null
+++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_messages.html
@@ -0,0 +1,49 @@
+<th:block th:each="msg:${msgs}">
+ <article th:data-mid="${msg.getMid()}">
+ <header class="u">
+ @<a th:href="|/${msg.getUser().getName()}/|" th:text="${msg.getUser().getName()}">ugnich</a>:
+ <div class="msg-avatar">
+ <a th:href="|/${msg.getUser().getName()}/|">
+ <img th:src="|//i.juick.com/a/${msg.getUser().getUid()}.png|"
+ th:alt="${msg.getUser().getName()}"/>
+ </a>
+ </div>
+ <div class="msg-ts">
+ <a th:href="|/${msg.getUser().getName()}/${msg.getMid()}|">
+ <time th:datetime="|${msg.getDate()}Z|"
+ th:title="|${msg.getDate()} GMT|"
+ th:text="${msg.getDate()}">01.01.1970</time>
+ </a>
+ </div>
+ <div class="msg-tags" th:text="${msg.getTagsString()}"></div>
+ </header>
+ <p class="ir" th:if="${msg.getAttachmentType() != null}">
+ <a href="|//i.juick.com/photos-512/${msg.getMid()}.${msg.getAttachmentType()}|">
+ <img src="|//i.juick.com/photos-512/${msg.getMid()}.${msg.getAttachmentType()}|"
+ th:data-fname="|${msg.getMid()}.${msg.getAttachmentType()}|" alt=""/></a>
+ </p>
+ <p th:utext="${msg.getText()}">Lorem ipsum</p>
+ <div class="irbr" th:if="${msg.getAttachmentType() != null}"></div>
+ <nav class="l">
+ <th:block th:switch="${visitor.getUid()}">
+ <a th:case="0" class="a-login" th:href="|/${msg.getMid()}/|">Рекомендовать</a>
+ <a th:case="*" class="a-like" th:href="|/post?body=!+%23${msg.getMid()}/|">Рекомендовать</a>
+ </th:block>
+ <a th:if="${visitor.getUid() == 0 && !msg.ReadOnly}" class="a-login" th:href="|/${msg.getMid()}/|">Комментировать</a>
+ <a th:if="${visitor.getUid() > 0 && (!msg.ReadOnly || visitor.getUid() == msg.getUser().getUid())}"
+ class="a-comment" th:href="|/${msg.getMid()}/|">Комментировать</a>
+
+ <th:block th:if="${visitor.getUid() == 3694}">
+ <a href="#" class="a-popular-plus">+</a>
+ <a href="#" class="a-popular-minus">-</a>
+ <a href="#" class="a-popular-delete">x</a>
+ </th:block>
+ </nav>
+ <nav class="s">
+ <a th:if="${msg.getLikes() > 0}" th:href="|/${msg.getUser().getName()}/${msg.getMid()}|"
+ class="likes" th:text="${msg.getLikes()}">10</a>
+ <a th:if="${msg.getReplies() > 0}" th:href="|/${msg.getUser().getName()}/${msg.getMid()}|"
+ class="replies" th:text="${msg.getReplies()}">42</a>
+ </nav>
+ </article>
+</th:block> \ No newline at end of file
diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_paginator.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_paginator.html
new file mode 100644
index 00000000..626f955c
--- /dev/null
+++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_paginator.html
@@ -0,0 +1,3 @@
+<p class="page" th:if="${nextpage != null}">
+ <a th:href="${nextpage}" rel="prev">Читать дальше →</a>
+</p> \ No newline at end of file
diff --git a/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_postform.html b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_postform.html
new file mode 100644
index 00000000..804605dd
--- /dev/null
+++ b/juick-spring-www/src/main/webapp/WEB-INF/templates/views/partial/blog_postform.html
@@ -0,0 +1,12 @@
+<form action="/post" method="post" enctype="multipart/form-data">
+ <section id="newmessage">
+ <textarea name="body" placeholder="Новое сообщение..."></textarea>
+ <div>
+ <input type="text" class="img" name="img" placeholder="Ссылка на изображение (JPG/PNG, до 10Мб)" style="margin-bottom: 8pt"/> или <a
+ href="#">загрузить</a><br/>
+
+ <input type="text" class="tags" name="tags" placeholder="Теги (через пробел)"/><br/>
+ <input type="submit" class="subm" value="Отправить"/>
+ </div>
+ </section>
+</form> \ No newline at end of file