aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/webapp/WEB-INF/views/macros/tree.html
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-07-28 14:21:01 +0300
committerGravatar Vitaly Takmazov2017-08-18 09:39:11 +0000
commitf5a87d2b7072426cfe36527db1270e5f85b73e01 (patch)
tree66c2e2834b7bcd28a083e2239b23a7ee12ae06d9 /juick-www/src/main/webapp/WEB-INF/views/macros/tree.html
parent6110f14830a9345aeac7eccfe4919c109b4a6434 (diff)
user thread is on pebble now
Diffstat (limited to 'juick-www/src/main/webapp/WEB-INF/views/macros/tree.html')
-rw-r--r--juick-www/src/main/webapp/WEB-INF/views/macros/tree.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/juick-www/src/main/webapp/WEB-INF/views/macros/tree.html b/juick-www/src/main/webapp/WEB-INF/views/macros/tree.html
new file mode 100644
index 00000000..3e35f92a
--- /dev/null
+++ b/juick-www/src/main/webapp/WEB-INF/views/macros/tree.html
@@ -0,0 +1,54 @@
+{% macro tree(replies, visitor, level, margin, hidden) %}
+{% for msg in replies %}
+ {% if msg.replyto == level %}
+ <li id="{{ msg.rid }}" style="margin-left: {{ margin }}px;{% if hidden %}display: none;{% endif %}" class="msg">
+ <div class="msg-cont">
+ <div class="msg-header">
+{% if not msg.user.banned %}
+ @<a href="/{{ msg.user.name }}/">{{ msg.user.name }}</a>:
+ <div class="msg-avatar"><a href="/{{ msg.user.name }}/">
+ <img src="//i.juick.com/a/{{ msg.user.uid }}.png" alt="{{ msg.user.name }}"/></a>
+ </div>
+{% else %}
+ [удалено]:
+ <div class="msg-avatar">
+ <img src="//i.juick.com/av-96.png"/>
+ </div>
+{% endif %}
+ <div class="msg-menu">
+ <a href="#" class="a-thread-links"></a>
+ </div>
+ <div class="msg-ts">
+ <a href="/{{ msg.mid }}#{{ msg.rid }}">
+ <time datetime="{{ msg.date | date('yyyy-MM-dd HH:mm:ss') }}Z"
+ title="{{ msg.date | date('yyyy-MM-dd HH:mm:ss') }} GMT">
+ {{ msg.date | prettyTime }}
+ </time>
+ </a>
+ </div>
+ </div>
+ <div class="msg-txt">{{ msg | formatMessage }}</div>
+ <div class="msg-media"></div>
+ <div class="msg-links">/{{ msg.rid }}
+{% if msg.replyto > 0 %}
+ в ответ на <a href="#{{ msg.replyto }}">/{{ msg.replyto }}</a>
+{% endif %}
+{% if msg.VisitorCanComment %}
+ &#183; <a href="/post?body=%23{{ msg.mid }}/{{ msg.rid }}%20" class="a-thread-comment">Ответить</a></div>
+ <div class="msg-comment" style="display: none"></div>
+{% elseif visitor.uid == 0 %}
+ &#183; <a href="#" class="a-login">Ответить</a></div>
+{% endif %}
+
+{% if level == 0 and msg.childsCount > 1 and replies.size() > 10 %}
+ <div class="msg-comments"><a href="#">{{ msg | formatReplies }}</a></div>
+{% endif %}
+ </li>
+ {% if (level == 0 and msg.childsCount > 1 and replies.size() > 10) %}
+ {{ tree(msg.childs, visitor, msg.rid, margin + 20, true) }}
+ {% elseif (msg.childsCount > 0) %}
+ {{ tree(msg.childs, visitor, msg.rid, margin + 20, hidden) }}
+ {% endif %}
+ {% endif %}
+{% endfor %}
+{% endmacro %} \ No newline at end of file