2018-04-16 00:33:54 +00:00
|
|
|
{% macro news_preview(post) %}
|
|
|
|
<div class="container news__preview">
|
2018-07-11 21:48:41 +00:00
|
|
|
<a href="/news.php?p={{ post.post_id }}" class="container__title container__title--link">
|
2018-04-16 00:33:54 +00:00
|
|
|
{{ post.post_title }}
|
|
|
|
</a>
|
2018-07-11 21:48:41 +00:00
|
|
|
|
2018-04-16 00:33:54 +00:00
|
|
|
<div class="container__content news__preview__content">
|
|
|
|
<div class="news__preview__text">
|
2018-07-17 19:12:51 +00:00
|
|
|
{{ post.post_text|first_paragraph|parse_text('md')|raw }}
|
2018-04-16 00:33:54 +00:00
|
|
|
</div>
|
2018-07-11 21:48:41 +00:00
|
|
|
|
2018-04-16 00:33:54 +00:00
|
|
|
<div class="news__preview__info">
|
2018-05-26 21:36:15 +00:00
|
|
|
<time class="news__preview__date" datetime="{{ post.created_at|date('c') }}" title="{{ post.created_at|date('r') }}">
|
|
|
|
{{ post.created_at|time_diff }}
|
|
|
|
</time>
|
2018-07-11 21:48:41 +00:00
|
|
|
|
2018-07-15 02:15:12 +00:00
|
|
|
{% if post.user_id is not null %}
|
|
|
|
<a class="news__preview__user" href="/profile.php?u={{ post.user_id }}">
|
|
|
|
<div class="news__preview__user__name" style="{{ post.user_colour|html_colour }}">
|
|
|
|
{{ post.username }}
|
|
|
|
</div>
|
|
|
|
<div class="avatar news__preview__user__avatar" style="background-image:url('/profile.php?u={{ post.user_id }}&m=avatar')"></div>
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2018-08-10 04:20:54 +00:00
|
|
|
|
|
|
|
<a href="/news.php?p={{ post.post_id }}#comments" style="color: inherit; text-decoration: none; display: block">
|
|
|
|
{% if post.post_comments < 1 %}
|
|
|
|
No comments
|
|
|
|
{% elseif post.post_comments == 1 %}
|
|
|
|
1 comment
|
|
|
|
{% else %}
|
|
|
|
{{ post.post_comments }} comments
|
|
|
|
{% endif %}
|
|
|
|
</a>
|
2018-04-16 00:33:54 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|