2016-01-04 20:14:09 +00:00
|
|
|
{% extends 'global/master.twig' %}
|
2015-09-05 16:11:04 +00:00
|
|
|
|
2015-11-15 21:43:39 +00:00
|
|
|
{% set forumBackLink %}{{ urls.format('FORUM_SUB', [forum.id]) }}{% endset %}
|
2016-01-10 18:24:47 +00:00
|
|
|
|
|
|
|
{% if thread.status != 1 or forum.permission(constant('Sakura\\Perms\\Forum::LOCK'), user.id) %}
|
|
|
|
{% set forumReplyLink %}{{ urls.format('FORUM_REPLY', [thread.id]) }}{% endset %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if forum.permission(constant('Sakura\\Perms\\Forum::STICKY'), user.id) %}
|
|
|
|
{% if thread.type == 1 %}
|
|
|
|
{% set forumUnsticky %}{{ urls.format('FORUM_STICKY', [thread.id, php.sessionid]) }}{% endset %}
|
|
|
|
{% else %}
|
|
|
|
{% set forumSticky %}{{ urls.format('FORUM_STICKY', [thread.id, php.sessionid]) }}{% endset %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if forum.permission(constant('Sakura\\Perms\\Forum::ANNOUNCEMENT'), user.id) %}
|
|
|
|
{% if thread.type == 2 %}
|
|
|
|
{% set forumUnannounce %}{{ urls.format('FORUM_ANNOUNCE', [thread.id, php.sessionid]) }}{% endset %}
|
|
|
|
{% else %}
|
|
|
|
{% set forumAnnounce %}{{ urls.format('FORUM_ANNOUNCE', [thread.id, php.sessionid]) }}{% endset %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if forum.permission(constant('Sakura\\Perms\\Forum::LOCK'), user.id) %}
|
|
|
|
{% if thread.status == 1 %}
|
|
|
|
{% set forumUnlock %}{{ urls.format('FORUM_LOCK', [thread.id, php.sessionid]) }}{% endset %}
|
|
|
|
{% else %}
|
|
|
|
{% set forumLock %}{{ urls.format('FORUM_LOCK', [thread.id, php.sessionid]) }}{% endset %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if forum.permission(constant('Sakura\\Perms\\Forum::MOVE'), user.id) %}
|
|
|
|
{% if thread.oldForum %}
|
|
|
|
{% set forumRestore %}{{ urls.format('FORUM_RESTORE', [thread.id, php.sessionid]) }}{% endset %}
|
|
|
|
{% endif %}
|
|
|
|
{% if thread.forum != sakura.trashForumId %}
|
|
|
|
{% set forumTrash %}{{ urls.format('FORUM_TRASH', [thread.id, php.sessionid]) }}{% endset %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if forum.permission(constant('Sakura\\Perms\\Forum::DELETE_ANY'), user.id) %}
|
|
|
|
{% if thread.forum == sakura.trashForumId %}
|
|
|
|
{% set forumPrune %}{{ urls.format('FORUM_PRUNE', [thread.id, php.sessionid]) }}{% endset %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2015-11-15 21:43:39 +00:00
|
|
|
|
|
|
|
{% set posts = thread.posts|batch(10) %}
|
|
|
|
|
2015-12-03 18:41:14 +00:00
|
|
|
{% if get.p and not get.page %}
|
|
|
|
{% set num = 0 %}
|
|
|
|
|
|
|
|
{% for k,v in thread.posts %}
|
|
|
|
{% if k < get.p %}
|
|
|
|
{% set num = num + 1 %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
2015-12-13 23:29:53 +00:00
|
|
|
{% set num = (num / 10)|round(0, 'floor') + 1 %}
|
2015-12-03 18:41:14 +00:00
|
|
|
|
|
|
|
{% set get = get|merge({'page': num}) %}
|
|
|
|
{% endif %}
|
|
|
|
|
2015-11-15 21:43:39 +00:00
|
|
|
{% set paginationPages = posts %}
|
|
|
|
{% set paginationUrl %}{{ urls.format('FORUM_THREAD', [thread.id]) }}{% endset %}
|
|
|
|
|
2015-11-15 14:29:26 +00:00
|
|
|
{% block title %}{{ thread.title }}{% endblock %}
|
2015-09-07 20:53:47 +00:00
|
|
|
|
2015-12-02 18:15:34 +00:00
|
|
|
{% block css %}
|
2015-12-29 01:27:49 +00:00
|
|
|
<link rel="stylesheet" href="{{ sakura.contentPath }}/libraries/highlight.css" />
|
2015-12-02 18:15:34 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block js %}
|
2015-12-29 01:27:49 +00:00
|
|
|
<script src="{{ sakura.contentPath }}/libraries/highlight.js"></script>
|
2015-12-03 18:41:14 +00:00
|
|
|
<script>hljs.initHighlightingOnLoad();</script>
|
2015-12-02 18:15:34 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
2015-09-05 16:11:04 +00:00
|
|
|
{% block content %}
|
2015-06-28 14:43:46 +00:00
|
|
|
<div class="content homepage forum viewtopic">
|
|
|
|
<div class="content-column">
|
2015-12-10 20:55:51 +00:00
|
|
|
<div class="head"><a href="{{ forumBackLink }}" class="clean">{{ forum.name }}</a> / <a href="{{ paginationUrl }}" class="clean">{{ thread.title }}</a></div>
|
2016-01-04 20:14:09 +00:00
|
|
|
{% include 'forum/forumBtns.twig' %}
|
2015-06-28 14:43:46 +00:00
|
|
|
<table class="posts">
|
2015-11-15 21:43:39 +00:00
|
|
|
{% for post in posts[get.page|default(1) - 1] %}
|
2015-11-15 14:29:26 +00:00
|
|
|
<tr class="post" id="p{{ post.id }}">
|
2015-06-28 14:43:46 +00:00
|
|
|
<td class="userpanel">
|
2015-12-29 21:52:19 +00:00
|
|
|
{% if not post.poster.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or post.poster.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) %}<a href="{{ urls.format('USER_PROFILE', [post.poster.id]) }}" class="default username" style="color: {{ post.poster.colour }}; text-shadow: 0 0 5px {% if post.poster.colour != 'inherit' %}{{ post.poster.colour }}{% else %}#222{% endif %};" title="Go to {{ post.poster.username }}'s profile">{{ post.poster.username }}</a>
|
2015-11-15 14:29:26 +00:00
|
|
|
<img src="{{ urls.format('IMAGE_AVATAR', [post.poster.id]) }}" alt="{{ post.poster.username }}" class="avatar" style="box-shadow: 0 3px 7px #{% if post.poster.isOnline %}484{% else %}844{% endif %};" />
|
2015-08-10 15:52:15 +00:00
|
|
|
{% else %}
|
|
|
|
<a class="username">[deleted user]</a>
|
|
|
|
{% endif %}
|
2015-06-28 14:43:46 +00:00
|
|
|
<div class="userdata">
|
2016-01-17 01:58:31 +00:00
|
|
|
<div class="usertitle">{{ post.poster.title }}</div>
|
|
|
|
<img src="{{ sakura.contentPath }}/images/tenshi.png" alt="Tenshi"{% if not post.poster.isPremium[0] %} style="opacity: 0;"{% endif %} /> <img src="{{ sakura.contentPath }}/images/flags/{{ post.poster.country|lower }}.png" alt="{{ post.poster.country(true) }}" />{% if post.poster.id == (thread.posts|first).poster.id %} <img src="{{ sakura.contentPath }}/images/op.png" alt="OP" title="Original Poster" />{% endif %}
|
2015-08-19 19:44:01 +00:00
|
|
|
{% if session.checkLogin %}
|
2015-06-28 14:43:46 +00:00
|
|
|
<div class="actions">
|
2016-01-10 18:24:47 +00:00
|
|
|
{% if (user.id == post.poster.id and forum.permission(constant('Sakura\\Perms\\Forum::EDIT_OWN'), user.id)) or forum.permission(constant('Sakura\\Perms\\Forum::EDIT_ANY'), user.id) %}
|
2015-11-15 14:29:26 +00:00
|
|
|
<a class="fa fa-pencil-square-o" title="Edit this post" href="{{ urls.format('FORUM_EDIT_POST', [post.id]) }}"></a>
|
2016-01-10 18:24:47 +00:00
|
|
|
{% endif %}
|
|
|
|
{% if (user.id == post.poster.id and forum.permission(constant('Sakura\\Perms\\Forum::DELETE_OWN'), user.id)) or forum.permission(constant('Sakura\\Perms\\Forum::DELETE_ANY'), user.id) %}
|
2015-11-15 14:29:26 +00:00
|
|
|
<a class="fa fa-trash" title="Delete this post" href="{{ urls.format('FORUM_DELETE_POST', [post.id]) }}"></a>
|
2015-09-16 20:34:36 +00:00
|
|
|
{% endif %}
|
2016-01-10 18:24:47 +00:00
|
|
|
{% if not (post.poster.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or post.poster.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) or user.id == post.poster.id) %}
|
|
|
|
{% if user.isFriends(post.poster.id) != 0 %}
|
|
|
|
<a class="fa fa-{% if user.isFriends(post.poster.id) == 2 %}heart{% else %}star{% endif %}" title="You are friends"></a>
|
|
|
|
{% endif %}
|
|
|
|
<a class="fa fa-user-{% if user.isFriends(post.poster.id) == 0 %}plus{% else %}times{% endif %} forum-friend-toggle" title="{% if user.isFriends(post.poster.id) == 0 %}Add {{ post.poster.username }} as a friend{% else %}Remove friend{% endif %}" href="{% if user.isFriends(post.poster.id) == 0 %}{{ urls.format('FRIEND_ADD', [post.poster.id, php.sessionid, php.time, sakura.currentPage]) }}{% else %}{{ urls.format('FRIEND_REMOVE', [post.poster.id, php.sessionid, php.time, sakura.currentPage]) }}{% endif %}"></a>
|
|
|
|
<a class="fa fa-flag" title="Report {{ post.poster.username }}" href="{{ urls.format('USER_REPORT', [post.poster.id]) }}"></a>
|
2015-06-28 14:43:46 +00:00
|
|
|
{% endif %}
|
2015-11-15 14:29:26 +00:00
|
|
|
<a class="fa fa-reply" title="Quote this post" href="{{ urls.format('FORUM_QUOTE_POST', [post.id]) }}"></a>
|
2015-06-28 14:43:46 +00:00
|
|
|
</div>
|
2015-08-10 15:52:15 +00:00
|
|
|
{% endif %}
|
2015-06-28 14:43:46 +00:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td class="post-content">
|
|
|
|
<div class="details">
|
|
|
|
<div class="subject">
|
2015-12-03 18:41:14 +00:00
|
|
|
<a href="#p{{ post.id }}" class="clean">{{ post.subject|slice(0, 50) }}{% if post.subject|length > 50 %}...{% endif %}</a>
|
2015-06-28 14:43:46 +00:00
|
|
|
</div>
|
|
|
|
<div class="date">
|
2016-01-22 12:46:52 +00:00
|
|
|
<a href="{{ urls.format('FORUM_POST', [post.id]) }}#p{{ post.id }}" class="clean" title="{{ post.time|date(sakura.dateFormat) }}">#{{ post.id }} - {{ post.timeElapsed }}</a>
|
2015-06-28 14:43:46 +00:00
|
|
|
</div>
|
|
|
|
<div class="clear"></div>
|
|
|
|
</div>
|
2015-12-02 18:15:34 +00:00
|
|
|
<div class="post-text bbcode">
|
2015-11-15 14:29:26 +00:00
|
|
|
{{ post.parsed|raw }}
|
2015-06-28 14:43:46 +00:00
|
|
|
</div>
|
2016-01-09 21:57:54 +00:00
|
|
|
{% if post.poster.signature and post.poster.permission(constant('Sakura\\Perms\\Site::CHANGE_SIGNATURE')) %}
|
2015-06-28 14:43:46 +00:00
|
|
|
<div class="clear"></div>
|
2015-12-02 18:15:34 +00:00
|
|
|
<div class="signature bbcode">
|
2016-01-17 01:58:31 +00:00
|
|
|
{{ post.poster.signature()|raw|nl2br }}
|
2015-06-28 14:43:46 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</table>
|
2016-01-04 20:14:09 +00:00
|
|
|
{% include 'forum/forumBtns.twig' %}
|
2015-06-28 14:43:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-09-05 16:11:04 +00:00
|
|
|
{% endblock %}
|