diff options
author | Vitaly Takmazov | 2017-05-05 17:42:27 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-05-23 15:50:10 +0300 |
commit | 237739950a305b13c9f29e3ca25c2e835d563a3f (patch) | |
tree | 14eea79fe63d0a5b9586aebdbaa9795ed858532e /juick-www/src/main/webapp | |
parent | cde3f26ef2779ec08335b1d2197151231d5cce3f (diff) |
User controller -> pebble
Diffstat (limited to 'juick-www/src/main/webapp')
5 files changed, 166 insertions, 4 deletions
diff --git a/juick-www/src/main/webapp/WEB-INF/views/blog.html b/juick-www/src/main/webapp/WEB-INF/views/blog.html new file mode 100644 index 00000000..6672adff --- /dev/null +++ b/juick-www/src/main/webapp/WEB-INF/views/blog.html @@ -0,0 +1,85 @@ +{% extends "layouts/content" %} +{% import "views/macros/tags" %} +{% block content %} +{% if noindex %} +<!--noindex--> +{% endif %} +{% if paramTag | default('') is not empty %} +<p class="page"><a href="/tag/{{ paramTag.name | urlencode }}">← Все записи с тегом <b>{{ paramTag.name | escape }}</b></a></p> +{% endif %} +{% if paramTag | default('') is not empty %} +<p class="page"><a href="/tag/{{ paramTag.name | urlencode }}">← Все записи с тегом <b>{{ paramTag.name | escape }}</b></a></p> +{% endif %} +{% for msg in msgs %} +<article data-mid="{{ msg.mid }}"> + <header class="h">@<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> + <div class="msg-menu"><a href="#"></a></div> + <div class="msg-ts"> + <a href="/{{ msg.user.name }}/{{ msg.mid }}"> + <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 class="msg-tags"> + {{ tags(msg.user.name, msg.tags) }} + </div> + </header> + + {% if msg.AttachmentType is not empty %} + <p class="ir"><a href="//i.juick.com/photos-512/{{ msg.mid }}.{{ msg.AttachmentType }}" + onclick="return showPhotoDialog('{{ msg.mid }}.{{ msg.AttachmentType }}')"> + <img src="//i.juick.com/photos-512/{{ msg.mid }}.{{ msg.AttachmentType }}" alt=""/></a> + </p> + {% endif %} + <p>{{ msg | formatMessage }}</p> + {% if msg.AttachmentType is not empty %} + <div class="irbr"></div> + {% endif %} + {% if not readonly %} + <nav class="l"> + {% if visitor.uid > 0 %} + <a href="/post?body=!+%23{{ msg.getMid() }}" class="a-like">{{ i18n("messages","message.recommend") }}</a> + {% else %} + <a href="/login" class="a-login">{{ i18n("messages","message.recommend") }}</a> + {% endif %} + {% if visitor.uid > 0 and (not msg.ReadOnly or visitor.uid == msg.user.uid) %} + <a href="/{{ msg.getMid() }}" class="a-comment">{{ i18n("messages","message.comment") }}</a> + {% elseif visitor.uid == 0 and not msg.ReadOnly %} + <a href="/login" class="a-login">{{ i18n("messages","message.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> {{ 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> {{ msg.Replies }}</a> + {% endif %} + </nav> +</article> +{% endfor %} +{% if (next | default('')) is not empty %} +{{ next | raw }} +{% endif %} +{% endblock %} +{% block "column" %} +{% include "views/partial/usercolumn" %} +{% if noindex %} +<!--/noindex--> +{% endif %} +{% endblock %}
\ No newline at end of file diff --git a/juick-www/src/main/webapp/WEB-INF/views/index.html b/juick-www/src/main/webapp/WEB-INF/views/index.html index 0e4eb6ba..0bf2a2fd 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/index.html +++ b/juick-www/src/main/webapp/WEB-INF/views/index.html @@ -68,9 +68,7 @@ </nav> </article> {% endfor %} -{% if (next | default('')) is not empty %} -{{ next | raw }} -{% endif %} +{{ next | default ('') | raw }} {% endblock %} {% block "column" %} {% include "views/partial/homecolumn" %} 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 index ffd81ddd..b34e6ecc 100644 --- a/juick-www/src/main/webapp/WEB-INF/views/macros/tags.html +++ b/juick-www/src/main/webapp/WEB-INF/views/macros/tags.html @@ -1,5 +1,5 @@ {% macro tags(uname="", tagsList) %} {% for tag in tagsList %} -<a href="/{{ uname }}/?tag={{ tag }}">{{ tag }}</a> +<a href="/{{ uname }}/?tag={{ tag.name | urlencode }}">{{ tag.name }}</a> {% endfor %} {% endmacro %}
\ No newline at end of file diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/usercolumn.html b/juick-www/src/main/webapp/WEB-INF/views/partial/usercolumn.html new file mode 100644 index 00000000..7e3b8a64 --- /dev/null +++ b/juick-www/src/main/webapp/WEB-INF/views/partial/usercolumn.html @@ -0,0 +1,76 @@ +<div id="ctitle"><a href="./"> + <img src="//i.juick.com/as/{{ user.uid }}.png" alt=""/>{{ user.name }}</a></div> +{% if visitor is not empty and visitor.uid > 0 and visitor.uid != user.uid %} +<ul id="ctoolbar"> + {% if isSubscribed %} + <li> + <a href="/post?body=U+%40{{ user.name }}" title="Подписан"> + <div style="background-position: -48px 0"></div> + </a> + </li> + {% else %} + <li> + <a href="/post?body=S+%40{{ user.name }}" title="Подписаться"> + <div style="background-position: -16px 0"></div> + </a> + </li> + {% endif %} + {% if isInBL %} + <li> + <a href="/post?body=BL+%40{{ user.name }}" title="Разблокировать"> + <div style="background-position: -96px 0"></div> + </a> + </li> + {% else %} + <li> + <a href="/post?body=BL+%40{{ user.name }}" title="Заблокировать"> + <div style="background-position: -80px 0"></div> + </a> + </li> + {% endif %} + {% if not isInBLAny %} + <li> + <a href="/pm/sent?uname={{ user.name }}" title="Написать приватное сообщение"> + <div style="background-position: -112px 0"></div> + </a> + </li> + {% endif %} +</ul> +{% else %} +<hr/> +{% endif %} +<ul> + <li><a href="/{{ user.name }}/">{{ i18n("messages","blog.blog") }}</a></li> + <li><a href="/{{ user.name }}/?show=recomm" rel="nofollow">{{ i18n("messages","blog.recommendations") }}</a></li> + <li><a href="/{{ user.name }}/?show=photos" rel="nofollow">{{ i18n("messages","blog.photos") }}</a></li> + {% if visitor is not empty and visitor.uid == user.uid and false %} + <li><a href="/?show=mycomments" rel="nofollow">{{ i18n("messages","blog.comments") }}</a></li> + <li><a href="/?show=unanswered" rel="nofollow">Неотвеченные</a></li> + {% endif %} +</ul> +<hr/> +<form action="/{{ user.name }}/"> + <p><input type="text" name="search" class="inp" placeholder="Поиск"/></p> +</form> +{% include "views/partial/usertags" %} +<hr/> +<div id="ustats"> + <ul> + <li><a href="/{{ user.name }}/friends">{{ i18n("messages","blog.iread") }}: {{ statsIRead }}</a></li> + <li><a href="/{{ user.name }}/readers">{{ i18n("messages","blog.readers") }}: {{ statsMyReaders }}</a></li> + <li>{{ i18n("messages","blog.messages") }}: {{ statsMessages }}</li> + <li>{{ i18n("messages","blog.comments") }}: {{ statsReplies }}</li> + </ul> + {% if iread is not empty %} + <div class="iread"> + {% for u in iread %} + <span> + <a href="/{{ u.name }}/"> + <img src="//i.juick.com/as/{{ u.uid }}.png" alt="{{ u.name }}"/> + </a> + </span> + {% endfor %} + </div> + {% endif %} + +</div> diff --git a/juick-www/src/main/webapp/WEB-INF/views/partial/usertags.html b/juick-www/src/main/webapp/WEB-INF/views/partial/usertags.html new file mode 100644 index 00000000..78e1416e --- /dev/null +++ b/juick-www/src/main/webapp/WEB-INF/views/partial/usertags.html @@ -0,0 +1,3 @@ +{% import "views/macros/tags" %} +{{ tags(uname=user.name, tagsStats) }} +<a href="/{{ user.name }}/tags" rel="nofollow">...</a>
\ No newline at end of file |