misuzu/templates/news/post.twig

63 lines
2.7 KiB
Twig
Raw Normal View History

2018-08-15 01:12:58 +00:00
{% extends 'news/master.twig' %}
2018-10-22 19:53:21 +00:00
{% from 'macros.twig' import container_title %}
2018-08-15 01:12:58 +00:00
{% from '_layout/comments.twig' import comments_section %}
2018-04-14 02:58:53 +00:00
{% set title = post.post_title ~ ' :: News' %}
2018-05-16 20:48:33 +00:00
{% set canonical_url = '/news.php?p=' ~ post.post_id %}
2018-10-10 12:25:18 +00:00
{% set manage_link = '/manage/news.php?v=post&p=' ~ post.post_id %}
2018-04-14 02:58:53 +00:00
{% block content %}
2018-04-16 00:33:54 +00:00
<div class="container news__post">
2018-10-22 19:53:21 +00:00
{{ container_title(post.post_title) }}
2018-04-16 00:33:54 +00:00
<div class="news__post__content">
2018-04-16 00:33:54 +00:00
<div class="news__post__text">
{{ post.post_text|parse_text(constant('MSZ_PARSER_MARKDOWN'))|raw }}
2018-04-14 02:58:53 +00:00
</div>
2018-04-16 00:33:54 +00:00
<div class="news__sidebar news__post__details">
2018-05-16 02:58:21 +00:00
<a class="news__post__detail news__post__user" href="/profile.php?u={{ post.user_id }}">
2018-07-06 01:28:06 +00:00
<div class="news__post__username" style="{{ post.user_colour|html_colour }}">{{ post.username }}</div>
2018-05-16 02:58:21 +00:00
<div class="avatar news__post__avatar" style="background-image:url('/profile.php?u={{ post.user_id }}&amp;m=avatar');"></div>
2018-04-16 00:33:54 +00:00
</a>
2018-05-16 02:58:21 +00:00
<a class="news__post__detail news__post__info news__post__info--link" href="/news.php?c={{ post.category_id }}">
2018-04-16 00:33:54 +00:00
<div class="news__post__info__name">
Category
</div>
<div class="news__post__info__value">
2018-05-16 02:58:21 +00:00
{{ post.category_name }}
2018-04-16 00:33:54 +00:00
</div>
</a>
<div class="news__post__detail news__post__info">
<div class="news__post__info__name">
Posted
</div>
<time class="news__post__info__value" datetime="{{ post.post_created|date('c') }}" title="{{ post.post_created|date('r') }}">
{{ post.post_created|time_diff }}
</time>
2018-04-14 02:58:53 +00:00
</div>
2018-04-16 00:33:54 +00:00
{% if post.post_updated|date('U') > post.post_created|date('U') %}
2018-04-16 00:33:54 +00:00
<div class="news__post__detail news__post__info">
<div class="news__post__info__name">
Updated
</div>
<time class="news__post__info__value" datetime="{{ post.post_updated|date('c') }}" title="{{ post.post_updated|date('r') }}">
{{ post.post_updated|time_diff }}
</time>
2018-04-16 00:33:54 +00:00
</div>
{% endif %}
2018-04-14 02:58:53 +00:00
</div>
</div>
</div>
2018-04-16 00:33:54 +00:00
{% if comments is defined %}
<div class="container">
2018-10-22 19:53:21 +00:00
{{ container_title('Comments') }}
{{ comments_section(comments, comments_category, current_user|default(null), comments_perms) }}
2018-04-16 00:33:54 +00:00
</div>
{% endif %}
2018-04-14 02:58:53 +00:00
{% endblock %}