Test post comments templates implementation.

This commit is contained in:
Alexey Skobkin 2016-03-29 07:13:01 +03:00
parent 0ceaf43ff3
commit c880304ef5
7 changed files with 97 additions and 2 deletions

View file

@ -133,4 +133,21 @@ a.tag {
a.post { a.post {
font-weight: bold; font-weight: bold;
}
/* Comments */
.comment {
margin-top: 20px;
}
.comment .comment-text {
margin-top: 5px;
}
.comment .comment-footer .comment-number {
margin-top: -8px;
}
.comments .children .comment {
margin-left: 20px;
} }

View file

@ -35,6 +35,9 @@ No subscribers data found: Информация о подписчиках отс
No rename log data found: Лог переименований отсутствует No rename log data found: Лог переименований отсутствует
No subscribers log data found: Лог подписчиков отсутствует No subscribers log data found: Лог подписчиков отсутствует
# Страница поста
in response to: в ответ на
# Топ пользователей # Топ пользователей
Top users: Популярные пользователи Top users: Популярные пользователи
Subscribers count: Подписчиков Subscribers count: Подписчиков

View file

@ -0,0 +1,3 @@
{% extends '@SkobkinPointTools/Post/comment_tree.html.twig' %}
{% block comment_children %}{% endblock %}

View file

@ -0,0 +1,48 @@
<a name="{{ comment.number }}"></a>
<div class="comment">
<div class="container content">
<div class="row">
<div class="col-xs-1">
<div class="userpic">
<img src="{{ point_avatar_medium(comment.author.login) }}" alt="{{ comment.author.login }} avatar">
</div>
<div class="post-date">
{{ comment.createdAt|date('j M Y G:i') }}
</div>
</div>
<div class="col-xs-11">
<div class="container">
<div class="row">
<div class="col-xs-12">
<a href="{{ path('user_show', {'login': comment.author.login}) }}">@{{ comment.author.login }}</a>
</div>
</div>
<div class="row comment-text">
<div class="col-xs-12">
{{ comment.text|markdown('markdown.parser.point') }}
</div>
</div>
<div class="row comment-footer">
<div class="col-xs-12 comment-number">
<a href="#{{ comment.number }}" class="post">#{{ comment.post.id }}/{{ comment.number }}</a>
{% if comment.parent is not null %}
{{ 'in response to'|trans }} <a href="#{{ comment.parent.number }}" class="post">/{{ comment.parent.number }}</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
{% block comment_children %}
{% if comment.children|length > 0 %}
<div class="children">
{% include '@SkobkinPointTools/Post/comments_tree.html.twig' with {
'comments': comment.children
} only %}
</div>
{% endif %}
{% endblock %}
</div>

View file

@ -0,0 +1,5 @@
{% if comments|length > 0 %}
{% for comment in comments %}
{% include '@SkobkinPointTools/Post/comment_list.html.twig' with {'comment': comment} only %}
{% endfor %}
{% endif %}

View file

@ -0,0 +1,5 @@
{% if comments|length > 0 %}
{% for comment in comments %}
{% include '@SkobkinPointTools/Post/comment_tree.html.twig' with {'comment': comment} only %}
{% endfor %}
{% endif %}

View file

@ -16,7 +16,7 @@
<div class="container post-block"> <div class="container post-block">
<div class="row"> <div class="row">
<div class="col-xs-1"> <div class="col-xs-1">
<img src="{{ avatar_url }}" alt="Avatar"> <img src="{{ point_avatar_large(post.author.login) }}" alt="Avatar">
</div> </div>
<div class="col-xs-11"> <div class="col-xs-11">
<div><a href="{{ path('user_show', {'login': post.author.login}) }}">@{{ post.author.login }}</a></div> <div><a href="{{ path('user_show', {'login': post.author.login}) }}">@{{ post.author.login }}</a></div>
@ -33,7 +33,7 @@
{{ post.text|markdown('markdown.parser.point') }} {{ post.text|markdown('markdown.parser.point') }}
</div> </div>
</div> </div>
<div class="row"> <div class="row post-files">
<div class="col-xs-2"> <div class="col-xs-2">
{% for file in post.files %} {% for file in post.files %}
<div class="post-attachment"> <div class="post-attachment">
@ -45,5 +45,19 @@
<div class="row"> <div class="row">
<div class="col-xs-12"><a href="https://point.im/{{ post.id }}" class="post">#{{ post.id }}</a></div> <div class="col-xs-12"><a href="https://point.im/{{ post.id }}" class="post">#{{ post.id }}</a></div>
</div> </div>
{% if post.comments|length > 0 %}
<div class="row comments">
{#
{% include '@SkobkinPointTools/Post/comments_tree.html.twig' with {
'comments': post.firstLevelComments
} only %}
#}
{% include '@SkobkinPointTools/Post/comments_list.html.twig' with {
'comments': post.comments
} %}
</div>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}