misuzu/views/mio/news/post.twig

67 lines
2.7 KiB
Twig
Raw Normal View History

2018-04-14 02:58:53 +00:00
{% extends '@mio/news/master.twig' %}
{% from '@mio/_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-04-14 02:58:53 +00:00
{% block news_content %}
2018-04-16 00:33:54 +00:00
<div class="container news__post">
<div class="container__title">
2018-05-16 02:58:21 +00:00
<a href="/news.php?c={{ post.category_id }}" class="container__title__link">{{ post.category_name }}</a> »
2018-04-16 00:33:54 +00:00
{{ post.post_title }}
</div>
<div class="container__content news__post__content">
<div class="news__post__text">
{{ post.post_text|parse_text('md')|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.created_at|date('c') }}" title="{{ post.created_at|date('r') }}">
{{ post.created_at|time_diff }}
</time>
2018-04-14 02:58:53 +00:00
</div>
2018-04-16 00:33:54 +00:00
{# TODO: make this work
{% if post.updated_at is defined %}
<div class="news__post__detail news__post__info">
<div class="news__post__info__name">
Updated
</div>
<div class="news__post__info__value">
{{ post.updated_at }}
</div>
</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">
<div class="container__title">
Comments
</div>
{{ 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 %}