From f5a87d2b7072426cfe36527db1270e5f85b73e01 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 28 Jul 2017 14:21:01 +0300 Subject: user thread is on pebble now --- .../src/main/webapp/WEB-INF/layouts/content.html | 3 +- .../src/main/webapp/WEB-INF/views/macros/tree.html | 54 +++++++++++ .../main/webapp/WEB-INF/views/partial/message.html | 6 +- .../webapp/WEB-INF/views/partial/thread_list.html | 44 +++++++++ .../webapp/WEB-INF/views/partial/thread_tree.html | 2 + .../src/main/webapp/WEB-INF/views/thread.html | 108 +++++++++++++++++++++ 6 files changed, 214 insertions(+), 3 deletions(-) create mode 100644 juick-www/src/main/webapp/WEB-INF/views/macros/tree.html create mode 100644 juick-www/src/main/webapp/WEB-INF/views/partial/thread_list.html create mode 100644 juick-www/src/main/webapp/WEB-INF/views/partial/thread_tree.html create mode 100644 juick-www/src/main/webapp/WEB-INF/views/thread.html (limited to 'juick-www/src/main/webapp/WEB-INF') diff --git a/juick-www/src/main/webapp/WEB-INF/layouts/content.html b/juick-www/src/main/webapp/WEB-INF/layouts/content.html index 420d4e0c..c059678e 100644 --- a/juick-www/src/main/webapp/WEB-INF/layouts/content.html +++ b/juick-www/src/main/webapp/WEB-INF/layouts/content.html @@ -31,7 +31,8 @@ {% include "views/partial/navigation" %} -
+
{% block content %} {% endblock %}
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 %} +
  • +
    +
    +{% if not msg.user.banned %} + @{{ msg.user.name }}: +
    + {{ msg.user.name }} +
    +{% else %} + [удалено]: +
    + +
    +{% endif %} +
    + +
    + +
    +
    {{ msg | formatMessage }}
    +
    + + +{% elseif visitor.uid == 0 %} + ·
    +{% endif %} + +{% if level == 0 and msg.childsCount > 1 and replies.size() > 10 %} + +{% endif %} +
  • + {% 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 diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/message.html b/juick-www/src/main/webapp/WEB-INF/views/partial/message.html index cdfad6b6..f67362ce 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/partial/message.html +++ b/juick-www/src/main/webapp/WEB-INF/views/partial/message.html @@ -1,7 +1,9 @@
    -
    @{{ msg.user.name }}: +
    + @{{ msg.user.name }}: + {{ msg.user.name }} +
    + + +{% endfor %} \ No newline at end of file diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/thread_tree.html b/juick-www/src/main/webapp/WEB-INF/views/partial/thread_tree.html new file mode 100644 index 00000000..f207b8e0 --- /dev/null +++ b/juick-www/src/main/webapp/WEB-INF/views/partial/thread_tree.html @@ -0,0 +1,2 @@ +{% import "views/macros/tree" %} +{{ tree(replies, visitor, 0, 0, false) }} \ No newline at end of file diff --git a/juick-www/src/main/webapp/WEB-INF/views/thread.html b/juick-www/src/main/webapp/WEB-INF/views/thread.html new file mode 100644 index 00000000..301ad8f8 --- /dev/null +++ b/juick-www/src/main/webapp/WEB-INF/views/thread.html @@ -0,0 +1,108 @@ +{% extends "layouts/content" %} +{% import "views/macros/tags" %} +{% block content %} + +
    +
    + {% if listview %} + Показать деревом + {% else %} + {% if foldable %} + Раскрыть все · + {% endif %} + Показать списком + {% endif %} +
    +

    Ответы ({{ replies.size() }})

    +
    + +
      + {% if (listview) %} + {% include "views/partial/thread_list" %} + {% else %} + {% include "views/partial/thread_tree" %} + {% endif %} +
    +{% endblock %} +{% block "column" %} +{% endblock %} \ No newline at end of file -- cgit v1.2.3