aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/webapp/WEB-INF
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-04-19 14:51:48 +0300
committerGravatar Vitaly Takmazov2017-05-05 12:06:28 +0300
commit045ca0848c8ee7c771541a5829157531c782cf30 (patch)
tree9a60049dae790fd01ace40d3757c0bfda74cd220 /juick-www/src/main/webapp/WEB-INF
parent9345af5e39695d191b221473ce3a51b03dc09db3 (diff)
juick-www: Home controller uses Pebble, drop ads
wip
Diffstat (limited to 'juick-www/src/main/webapp/WEB-INF')
-rw-r--r--juick-www/src/main/webapp/WEB-INF/views/index.html75
-rw-r--r--juick-www/src/main/webapp/WEB-INF/views/macros/tags.html5
-rw-r--r--juick-www/src/main/webapp/WEB-INF/views/partial/footer.html2
-rw-r--r--juick-www/src/main/webapp/WEB-INF/views/partial/newmessage.html14
4 files changed, 95 insertions, 1 deletions
diff --git a/juick-www/src/main/webapp/WEB-INF/views/index.html b/juick-www/src/main/webapp/WEB-INF/views/index.html
new file mode 100644
index 00000000..09297ef9
--- /dev/null
+++ b/juick-www/src/main/webapp/WEB-INF/views/index.html
@@ -0,0 +1,75 @@
+{% extends "layouts/content" %}
+{% import "views/macros/tags" %}
+{% block content %}
+{% if noindex %}
+<!--noindex-->
+{% endif %}
+{% if visitor.getUid() > 0 %}
+{% include "views/partial/newmessage" %}
+{% endif %}
+{% for msg in msgs %}
+<article data-mid="{{ msg.getMid() }}">
+ <header class="h">@<a href="/{{ msg.getUser().getName() }}/">{{ msg.getUser().getName() }}</a>:
+ <div class="msg-avatar"><a href="/{{ msg.getUser().getName() }}/">
+ <img src="//i.juick.com/a/{{ msg.getUser().getUid() }}.png" alt="{{ msg.getUser().getName() }}"/></a></div>
+ <div class="msg-menu"><a href="#"></a></div>
+ <div class="msg-ts">
+ <a href="/{{ msg.getUser().getName() }}/{{ msg.getMid() }}">
+ <time>
+ {{ msg.getDate() }}
+ </time>
+ </a>
+ </div>
+ <div class="msg-tags">
+ {{ tags(msg.getUser().getName(), msg.getTags()) }}
+ </div>
+ </header>
+
+ {%if msg.AttachmentType is not empty %}
+ <p class="ir"><a href="//i.juick.com/photos-512/{{ msg.getMid() }}.{{ msg.AttachmentType }}"
+ onclick="return showPhotoDialog('{{ msg.getMid() }}.{{ msg.AttachmentType }}')">
+ <img src="//i.juick.com/photos-512/{{ msg.getMid() }}.{{ msg.AttachmentType }}" alt=""/></a>
+ </p>
+ {% endif %}
+ <p>{{ msg.getText() | raw }}</p>
+ {%if msg.AttachmentType is not empty %}
+ <div class="irbr"></div>
+ {% endif %}
+ {% if not readonly %}
+ <nav class="l">
+ <a href="#" class="a-like">Мне нравится</a>
+ {% if msg.VisitorCanComment %}
+ <a href="#" class="a-comment">Комментировать</a>
+ {% endif %}
+ {% if msg.FriendsOnly %}
+ <a href="#" class="a-privacy">Открыть доступ</a>
+ {% endif %}
+ {% if isModerator %}
+ <a href="#" class="a-popular-plus">+</a>
+ <a href="#" class="a-popular-minus">-</a>
+ <a href="#" class="a-popular-delete">x</a>
+ {% endif %}
+ </nav>
+ {% endif %}
+ <nav class="s">
+ {% if msg.Likes > 0 %}
+ <a href="/{{ msg.getUser().getName() }}/{{ msg.getMid() }}" class="likes">
+ <i data-icon="ei-heart" data-size="s"></i>&nbsp;{{ msg.Likes }}</a>
+ {% endif %}
+ {% if msg.Replies > 0 %}
+ <a href="/{{ msg.getUser().getName() }}/{{ msg.getMid() }}" class="replies">
+ <i data-icon="ei-comment" data-size="s"></i>&nbsp;&nbsp;{{ msg.Replies }}</a>
+ {% endif %}
+ </nav>
+</article>
+{% endfor %}
+{% if next is not empty %}
+{{ next | raw }}
+{% endif %}
+{% endblock %}
+{% block "column" %}
+{% include "views/partial/homecolumn" %}
+{% if noindex %}
+<!--/noindex-->
+{% endif %}
+{% endblock %} \ No newline at end of file
diff --git a/juick-www/src/main/webapp/WEB-INF/views/macros/tags.html b/juick-www/src/main/webapp/WEB-INF/views/macros/tags.html
new file mode 100644
index 00000000..ffd81ddd
--- /dev/null
+++ b/juick-www/src/main/webapp/WEB-INF/views/macros/tags.html
@@ -0,0 +1,5 @@
+{% macro tags(uname="", tagsList) %}
+{% for tag in tagsList %}
+<a href="/{{ uname }}/?tag={{ tag }}">{{ tag }}</a>
+{% endfor %}
+{% endmacro %} \ No newline at end of file
diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/footer.html b/juick-www/src/main/webapp/WEB-INF/views/partial/footer.html
index 71d675de..491cf140 100644
--- a/juick-www/src/main/webapp/WEB-INF/views/partial/footer.html
+++ b/juick-www/src/main/webapp/WEB-INF/views/partial/footer.html
@@ -11,7 +11,7 @@
<a href="https://www.facebook.com/JuickCom" rel="nofollow" class="ico32-fb">Facebook</a>
</div>
<div id="footer-left">juick.com &copy; 2008-2017
- {% if links %}
+ {% if links is not empty %}
<br/>{{ i18n("messages","label.sponsors") }}: {{ links }}
{% endif %}
</div>
diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/newmessage.html b/juick-www/src/main/webapp/WEB-INF/views/partial/newmessage.html
new file mode 100644
index 00000000..452d1267
--- /dev/null
+++ b/juick-www/src/main/webapp/WEB-INF/views/partial/newmessage.html
@@ -0,0 +1,14 @@
+<form action="/post" method="post" enctype="multipart/form-data">
+ <section id="newmessage">
+ {% if readonly %}
+ <p>Комментирование временно недоступно</p>
+ {% else %}
+ <textarea name="body" placeholder="Новое сообщение..."></textarea>
+ <div>
+ <input type="text" class="img" name="img" placeholder="Ссылка на изображение (JPG/PNG, до 10Мб)"/> или <a href="#">загрузить</a><br/>
+ <input type="text" class="tags" name="tags" placeholder="Теги (через пробел)"/><br/>
+ <input type="submit" class="subm" value="Отправить"/>
+ </div>
+ {% endif %}
+ </section>
+</form> \ No newline at end of file