2018-10-16 21:38:17 +00:00
|
|
|
{% macro forum_category_listing(forums, title, colour) %}
|
2018-05-18 01:20:27 +00:00
|
|
|
{% from _self import forum_category_entry %}
|
2018-10-22 19:53:21 +00:00
|
|
|
{% from 'macros.twig' import container_title %}
|
2018-05-18 01:20:27 +00:00
|
|
|
|
2018-10-22 17:26:59 +00:00
|
|
|
<div class="container forum__categories"{% if colour is not null %} style="{{ colour|html_colour('--accent-colour') }}"{% endif %}>
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title(title) }}
|
2018-09-25 22:11:20 +00:00
|
|
|
|
|
|
|
{% if forums|length > 0 %}
|
|
|
|
<div class="forum__categories__list">
|
2018-05-18 01:20:27 +00:00
|
|
|
{% for forum in forums %}
|
|
|
|
{{ forum_category_entry(forum) }}
|
|
|
|
{% endfor %}
|
2018-09-25 22:11:20 +00:00
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="forum__categories__empty">
|
|
|
|
This category is empty.
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2018-05-18 01:20:27 +00:00
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2018-10-15 23:00:17 +00:00
|
|
|
{% macro forum_header(title, breadcrumbs, omit_last_breadcrumb) %}
|
2018-10-22 17:26:59 +00:00
|
|
|
<div class="container forum__header">
|
2018-10-15 23:00:17 +00:00
|
|
|
{% if breadcrumbs is iterable and breadcrumbs|length > 0 %}
|
|
|
|
<div class="forum__header__breadcrumbs">
|
|
|
|
{% for name, url in breadcrumbs %}
|
|
|
|
{% if url != breadcrumbs|first %}
|
|
|
|
<div class="forum__header__breadcrumb__separator">
|
|
|
|
<i class="fas fa-chevron-right"></i>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if not (omit_last_breadcrumb|default(false) and url == breadcrumbs|last) %}
|
|
|
|
<a href="{{ url }}" class="forum__header__breadcrumb">{{ name }}</a>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if title|length > 0 %}
|
|
|
|
<div class="forum__header__title">
|
|
|
|
{{ title }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2018-10-25 00:15:23 +00:00
|
|
|
{% macro forum_category_tools(info, perms, take, offset) %}
|
|
|
|
{% from 'macros.twig' import pagination %}
|
|
|
|
|
|
|
|
<div class="container forum__actions">
|
|
|
|
<div class="forum__actions__buttons">
|
|
|
|
{% if perms|perms_check(constant('MSZ_FORUM_PERM_CREATE_TOPIC')) %}
|
2018-12-01 11:57:23 +00:00
|
|
|
<a href="{{ url_construct('/forum/posting.php', {'f':info.forum_id}) }}" class="input__button">New Topic</a>
|
2018-10-25 00:15:23 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="forum__actions__pagination">
|
|
|
|
{{ pagination(
|
|
|
|
info.forum_topic_count,
|
|
|
|
take,
|
|
|
|
offset,
|
2018-12-01 11:57:23 +00:00
|
|
|
url_construct('/forum/forum.php', {'f':info.forum_id}),
|
2018-10-25 00:15:23 +00:00
|
|
|
false,
|
|
|
|
null,
|
|
|
|
5
|
|
|
|
) }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro forum_topic_tools(info, take, offset, can_reply) %}
|
|
|
|
{% from 'macros.twig' import pagination %}
|
|
|
|
|
|
|
|
<div class="container forum__actions">
|
|
|
|
<div class="forum__actions__buttons">
|
|
|
|
{% if can_reply %}
|
2018-11-06 22:55:05 +00:00
|
|
|
<a href="#reply" class="input__button">Reply</a>
|
2018-10-25 00:15:23 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="forum__actions__pagination">
|
|
|
|
{{ pagination(
|
|
|
|
info.topic_post_count,
|
|
|
|
take,
|
|
|
|
offset,
|
2018-12-01 11:57:23 +00:00
|
|
|
url_construct('/forum/topic.php', {'t':info.topic_id}),
|
2018-10-25 00:15:23 +00:00
|
|
|
false,
|
|
|
|
null,
|
|
|
|
5
|
|
|
|
) }}
|
|
|
|
</div>
|
2018-05-20 20:12:45 +00:00
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2018-09-28 16:40:41 +00:00
|
|
|
{% macro forum_category_entry(forum, forum_unread, forum_type) %}
|
2018-05-20 20:12:45 +00:00
|
|
|
{% set forum_type = forum_type|default(null) %}
|
2018-05-24 00:38:42 +00:00
|
|
|
{% set forum_unread = forum_unread|default(forum.forum_unread|default(false)) ? 'unread' : 'read' %}
|
2018-05-18 01:20:27 +00:00
|
|
|
|
2018-05-20 20:12:45 +00:00
|
|
|
{% if forum_type is null %}
|
2018-05-18 01:20:27 +00:00
|
|
|
{% if forum.forum_archived is defined and forum.forum_archived %}
|
2018-09-28 16:40:41 +00:00
|
|
|
{% set forum_type = 'fas fa-archive' %}
|
2018-05-20 20:12:45 +00:00
|
|
|
{% elseif forum.forum_type is defined and forum.forum_type != 0 %}
|
2018-05-18 01:20:27 +00:00
|
|
|
{% if forum.forum_type == 2 %}
|
2018-09-28 16:40:41 +00:00
|
|
|
{% set forum_type = 'fas fa-link' %}
|
2018-05-18 01:20:27 +00:00
|
|
|
{% elseif forum.forum_type == 1 %}
|
2018-09-28 16:40:41 +00:00
|
|
|
{% set forum_type = 'fas fa-folder' %}
|
2018-05-18 01:20:27 +00:00
|
|
|
{% endif %}
|
2018-05-20 20:12:45 +00:00
|
|
|
{% else %}
|
2018-09-28 16:40:41 +00:00
|
|
|
{% set forum_type = 'fas fa-comments' %}
|
2018-05-18 01:20:27 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
2018-09-28 16:40:41 +00:00
|
|
|
<div class="forum__category">
|
|
|
|
<a href="/forum/forum.php?f={{ forum.forum_id }}" class="forum__category__link"></a>
|
2018-05-18 01:20:27 +00:00
|
|
|
|
2018-09-28 16:40:41 +00:00
|
|
|
<div class="forum__category__container">
|
|
|
|
<div class="forum__category__icon forum__category__icon--{{ forum_unread }}">
|
|
|
|
<i class="{{ forum_type }}"></i>
|
2018-05-21 19:08:40 +00:00
|
|
|
</div>
|
|
|
|
|
2018-09-28 16:40:41 +00:00
|
|
|
<div class="forum__category__details">
|
|
|
|
<div class="forum__category__title">
|
|
|
|
{{ forum.forum_name }}
|
|
|
|
</div>
|
2018-05-21 19:08:40 +00:00
|
|
|
|
2018-09-28 16:40:41 +00:00
|
|
|
<div class="forum__category__description">
|
|
|
|
{{ forum.forum_description|nl2br }}
|
2018-05-19 00:51:31 +00:00
|
|
|
</div>
|
2018-05-18 01:20:27 +00:00
|
|
|
|
2018-09-28 16:40:41 +00:00
|
|
|
{% if forum.forum_subforums is defined and forum.forum_subforums|length > 0 %}
|
|
|
|
<div class="forum__category__subforums">
|
|
|
|
{% for subforum in forum.forum_subforums %}
|
|
|
|
<a href="/forum/forum.php?f={{ subforum.forum_id }}"
|
|
|
|
class="forum__category__subforum{% if subforum.forum_unread %} forum__category__subforum--unread{% endif %}">
|
|
|
|
{{ subforum.forum_name }}
|
|
|
|
</a>
|
|
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% if forum.forum_type == 2 %}
|
|
|
|
{% if forum.forum_link_clicks is not null %}
|
|
|
|
<div class="forum__category__stats">
|
|
|
|
<div class="forum__category__stat" title="Clicks">{{ forum.forum_link_clicks|number_format }}</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% elseif forum.forum_type != 1 %}
|
|
|
|
<div class="forum__category__stats">
|
|
|
|
<div class="forum__category__stat" title="Topics">{{ forum.forum_topic_count|number_format }}</div>
|
|
|
|
<div class="forum__category__stat" title="Posts">{{ forum.forum_post_count|number_format }}</div>
|
2018-05-21 19:08:40 +00:00
|
|
|
</div>
|
2018-05-22 02:09:53 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2018-09-28 16:40:41 +00:00
|
|
|
{% if forum.forum_type == 0 or forum.forum_link_clicks is not null %}
|
|
|
|
<div class="forum__category__activity{% if forum.forum_link_clicks is not null %} forum__category__activity--empty{% endif %}">
|
|
|
|
{% if forum.forum_type != 2 %}
|
|
|
|
{% if forum.recent_topic_id is null %}
|
|
|
|
<div class="forum__category__activity__none">
|
|
|
|
There are no posts in this forum yet.
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="forum__category__activity__details">
|
|
|
|
<a class="forum__category__activity__post"
|
2018-05-22 02:09:53 +00:00
|
|
|
href="/forum/topic.php?p={{ forum.recent_post_id }}#p{{ forum.recent_post_id }}">
|
2018-05-26 20:33:05 +00:00
|
|
|
{{ forum.recent_topic_title }}
|
2018-05-22 02:09:53 +00:00
|
|
|
</a>
|
2018-09-28 16:40:41 +00:00
|
|
|
|
|
|
|
<div class="forum__category__activity__info">
|
|
|
|
<time datetime="{{ forum.recent_post_created|date('c') }}"
|
|
|
|
title="{{ forum.recent_post_created|date('r') }}">{{ forum.recent_post_created|time_diff }}</time>
|
|
|
|
{% if forum.recent_post_user_id is not null %}
|
|
|
|
by
|
|
|
|
<a href="/profile.php?u={{ forum.recent_post_user_id }}" class="forum__category__username"
|
|
|
|
style="{{ forum.recent_post_user_colour|html_colour }}">
|
|
|
|
{{ forum.recent_post_username }}
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2018-05-22 02:09:53 +00:00
|
|
|
</div>
|
|
|
|
|
2018-09-28 16:40:41 +00:00
|
|
|
{% if forum.recent_post_user_id is not null %}
|
|
|
|
<a href="/profile.php?u={{ forum.recent_post_user_id }}"
|
2018-10-22 17:26:59 +00:00
|
|
|
class="avatar forum__category__avatar"
|
2018-09-28 16:40:41 +00:00
|
|
|
style="background-image:url('/profile.php?u={{ forum.recent_post_user_id }}&m=avatar')">
|
|
|
|
</a>
|
|
|
|
{% endif %}
|
2018-05-21 19:08:40 +00:00
|
|
|
{% endif %}
|
2018-05-22 02:09:53 +00:00
|
|
|
{% endif %}
|
2018-09-28 16:40:41 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2018-05-18 01:20:27 +00:00
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2018-05-23 01:41:57 +00:00
|
|
|
{% macro forum_topic_locked(locked, archived) %}
|
|
|
|
{% if locked is not null or archived %}
|
2018-10-22 17:26:59 +00:00
|
|
|
<div class="container forum__status">
|
2018-10-15 20:45:06 +00:00
|
|
|
<div class="forum__status__icon">
|
|
|
|
<i class="fas fa-{{ archived ? 'archive' : 'lock' }}"></i>
|
|
|
|
</div>
|
2018-10-15 14:29:35 +00:00
|
|
|
<div class="forum__status__text">
|
2018-05-23 01:41:57 +00:00
|
|
|
{% if archived %}
|
2018-10-15 14:29:35 +00:00
|
|
|
This topic has been <span class="forum__status__emphasis">archived</span>.
|
2018-05-23 01:41:57 +00:00
|
|
|
{% else %}
|
2018-10-15 20:45:06 +00:00
|
|
|
This topic was locked
|
|
|
|
<time class="forum__status__emphasis"
|
2018-05-26 21:36:15 +00:00
|
|
|
datetime="{{ locked|date('c') }}"
|
|
|
|
title="{{ locked|date('r') }}">{{ locked|time_diff }}</time>.
|
2018-05-23 01:41:57 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
2018-05-18 01:20:27 +00:00
|
|
|
{% macro forum_topic_listing(topics) %}
|
|
|
|
{% from _self import forum_topic_entry %}
|
2018-10-22 19:53:21 +00:00
|
|
|
{% from 'macros.twig' import container_title %}
|
2018-05-18 01:20:27 +00:00
|
|
|
|
2018-10-22 17:26:59 +00:00
|
|
|
<div class="container forum__topics">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title('Topics') }}
|
|
|
|
|
2018-10-15 20:39:31 +00:00
|
|
|
<div class="forum__topics__list">
|
2018-05-18 01:20:27 +00:00
|
|
|
{% if topics|length > 0 %}
|
|
|
|
{% for topic in topics %}
|
|
|
|
{{ forum_topic_entry(topic) }}
|
|
|
|
{% endfor %}
|
|
|
|
{% else %}
|
2018-10-15 20:39:31 +00:00
|
|
|
<div class="forum__topics__empty">
|
2018-05-18 01:20:27 +00:00
|
|
|
There are no topics in this forum.
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
2018-10-15 14:29:35 +00:00
|
|
|
{% macro forum_topic_entry(topic, topic_type, topic_unread) %}
|
2018-05-20 01:16:29 +00:00
|
|
|
{% set topic_type = topic_type|default(null) %}
|
2018-05-24 00:38:42 +00:00
|
|
|
{% set topic_unread = topic_unread|default(topic.topic_unread|default(false)) ? 'unread' : 'read' %}
|
2018-05-20 01:16:29 +00:00
|
|
|
|
|
|
|
{% if topic_type is null %}
|
|
|
|
{% if topic.topic_deleted is defined and topic.topic_deleted is not null %}
|
2018-10-15 14:29:35 +00:00
|
|
|
{% set topic_type = 'fas fa-trash-alt' %}
|
2018-05-20 01:16:29 +00:00
|
|
|
{% elseif topic.topic_type is defined and topic.topic_type != 0 %}
|
|
|
|
{% if topic.topic_type == 2 %}
|
2018-10-15 14:29:35 +00:00
|
|
|
{% set topic_type = 'fas fa-bullhorn' %}
|
2018-05-20 01:16:29 +00:00
|
|
|
{% elseif topic.topic_type == 1 %}
|
2018-10-15 14:29:35 +00:00
|
|
|
{% set topic_type = 'fas fa-thumbtack' %}
|
2018-05-20 01:16:29 +00:00
|
|
|
{% endif %}
|
2018-05-23 01:41:57 +00:00
|
|
|
{% elseif topic.topic_locked is defined and topic.topic_locked is not null %}
|
2018-10-15 14:29:35 +00:00
|
|
|
{% set topic_type = 'fas fa-lock' %}
|
2018-05-20 01:16:29 +00:00
|
|
|
{% else %}
|
2018-10-15 14:29:35 +00:00
|
|
|
{% set topic_type = 'fas fa-comment' %}
|
2018-05-20 01:16:29 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2018-05-18 01:20:27 +00:00
|
|
|
|
2018-10-15 20:39:31 +00:00
|
|
|
<div class="forum__topic">
|
|
|
|
<a href="/forum/topic.php?t={{ topic.topic_id }}" class="forum__topic__link"></a>
|
2018-05-20 01:16:29 +00:00
|
|
|
|
2018-10-15 20:39:31 +00:00
|
|
|
<div class="forum__topic__container">
|
|
|
|
<div class="forum__topic__icon forum__topic__icon--{{ topic_unread }}">
|
|
|
|
<i class="{{ topic_type }}"></i>
|
2018-05-18 01:20:27 +00:00
|
|
|
</div>
|
2018-05-21 16:37:17 +00:00
|
|
|
|
2018-10-15 20:39:31 +00:00
|
|
|
<div class="forum__topic__details">
|
|
|
|
<div class="forum__topic__title">
|
|
|
|
<span class="forum__topic__title__inner">
|
|
|
|
{{ topic.topic_title }}
|
|
|
|
</span>
|
|
|
|
</div>
|
2018-05-18 01:20:27 +00:00
|
|
|
|
2018-10-15 20:39:31 +00:00
|
|
|
<div class="forum__topic__info">
|
|
|
|
{% if topic.author_id is not null %}
|
|
|
|
by <a
|
|
|
|
href="/profile.php?u={{ topic.author_id }}"
|
|
|
|
class="forum__topic__username"
|
|
|
|
style="{{ topic.author_colour|html_colour }}">{{ topic.author_name }}</a>,
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
<time datetime="{{ topic.topic_created|date('c') }}" title="{{ topic.topic_created|date('r') }}">{{ topic.topic_created|time_diff }}</time>
|
|
|
|
</div>
|
2018-05-20 01:16:29 +00:00
|
|
|
</div>
|
2018-10-15 20:39:31 +00:00
|
|
|
|
|
|
|
<div class="forum__topic__stats">
|
|
|
|
<div class="forum__topic__stat" title="Posts">{{ topic.topic_post_count|number_format }}</div>
|
|
|
|
<div class="forum__topic__stat" title="Views">{{ topic.topic_view_count|number_format }}</div>
|
2018-05-20 01:16:29 +00:00
|
|
|
</div>
|
2018-05-18 01:20:27 +00:00
|
|
|
|
2018-10-15 20:39:31 +00:00
|
|
|
<div class="forum__topic__activity">
|
|
|
|
<div class="forum__topic__activity__details">
|
|
|
|
{% if topic.respondent_id is not null %}
|
|
|
|
<a href="/profile.php?u={{ topic.respondent_id }}" class="forum__topic__username"
|
|
|
|
style="{{ topic.respondent_colour|html_colour }}">{{ topic.respondent_name }}</a>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<a class="forum__topic__activity__post"
|
|
|
|
href="/forum/topic.php?p={{ topic.response_id }}#p{{ topic.response_id }}">
|
|
|
|
<time datetime="{{ topic.response_created|date('c') }}"
|
2018-05-26 21:36:15 +00:00
|
|
|
title="{{ topic.response_created|date('r') }}">{{ topic.response_created|time_diff }}</time>
|
2018-05-20 20:12:45 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
2018-10-15 20:39:31 +00:00
|
|
|
|
2018-05-21 19:15:08 +00:00
|
|
|
{% if topic.respondent_id is not null %}
|
2018-10-15 20:39:31 +00:00
|
|
|
<a href="/profile.php?u={{ topic.respondent_id }}"
|
2018-10-22 17:26:59 +00:00
|
|
|
class="avatar forum__topic__avatar"
|
2018-10-15 20:39:31 +00:00
|
|
|
style="background-image:url('/profile.php?u={{ topic.respondent_id }}&m=avatar')">
|
|
|
|
</a>
|
2018-05-21 19:15:08 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2018-05-20 20:12:45 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro forum_post_listing(posts, opening_post_id) %}
|
|
|
|
{% from _self import forum_post_entry %}
|
|
|
|
|
2018-05-21 23:05:25 +00:00
|
|
|
{% for post in posts %}
|
|
|
|
{{ forum_post_entry(post, post.post_id == opening_post_id) }}
|
|
|
|
{% endfor %}
|
2018-05-20 20:12:45 +00:00
|
|
|
{% endmacro %}
|
|
|
|
|
2018-05-21 23:05:25 +00:00
|
|
|
{% macro forum_post_entry(post, is_original_post, is_original_poster) %}
|
|
|
|
{% set is_original_post = is_original_post|default(false) %}
|
|
|
|
{% set is_original_poster = is_original_poster|default(false) %}
|
2018-05-20 20:12:45 +00:00
|
|
|
|
2018-10-22 20:23:56 +00:00
|
|
|
<div class="container forum__post" id="p{{ post.post_id }}" style="{{ post.poster_colour|html_colour('--accent-colour') }}">
|
|
|
|
<div class="forum__post__info">
|
|
|
|
<div class="forum__post__info__background"></div>
|
|
|
|
<div class="forum__post__info__content">
|
|
|
|
{% if post.poster_id is not null %}
|
|
|
|
<a class="avatar forum__post__avatar"
|
|
|
|
style="background-image:url('/profile.php?u={{ post.poster_id }}&m=avatar');"
|
|
|
|
href="/profile.php?u={{ post.poster_id }}">
|
|
|
|
</a>
|
2018-10-15 21:57:16 +00:00
|
|
|
|
2018-10-22 20:23:56 +00:00
|
|
|
<a class="forum__post__username" href="/profile.php?u={{ post.poster_id }}">{{ post.poster_name }}</a>
|
|
|
|
|
|
|
|
<div class="forum__post__icons">
|
|
|
|
<div class="flag flag--{{ post.poster_country|lower }}" title="{{ post.poster_country|country_name }}"></div>
|
|
|
|
<div class="forum__post__posts-count">{{ post.poster_post_count|number_format }} posts</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="forum__post__joined">
|
|
|
|
joined <time datetime="{{ post.poster_joined|date('c') }}" title="{{ post.poster_joined|date('r') }}">{{ post.poster_joined|time_diff }}</time>
|
|
|
|
</div>
|
|
|
|
{% else %}
|
|
|
|
<div class="forum__post__username">Deleted User</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2018-10-15 21:57:16 +00:00
|
|
|
</div>
|
2018-05-21 02:28:51 +00:00
|
|
|
|
|
|
|
<div class="forum__post__content">
|
2018-10-15 21:57:16 +00:00
|
|
|
<div class="forum__post__details">
|
|
|
|
<a class="forum__post__datetime" href="/forum/topic.php?t={{ post.topic_id }}#p{{ post.post_id }}">
|
2018-05-26 21:36:15 +00:00
|
|
|
<time datetime="{{ post.post_created|date('c') }}" title="{{ post.post_created|date('r') }}">{{ post.post_created|time_diff }}</time>
|
2018-05-21 02:28:51 +00:00
|
|
|
</a>
|
2018-10-15 21:57:16 +00:00
|
|
|
|
|
|
|
<a class="forum__post__id" href="/forum/topic.php?p={{ post.post_id }}#p{{ post.post_id }}">
|
2018-05-21 02:28:51 +00:00
|
|
|
#{{ post.post_id }}
|
|
|
|
</a>
|
|
|
|
</div>
|
2018-10-15 21:57:16 +00:00
|
|
|
|
2018-11-01 21:35:10 +00:00
|
|
|
<div class="forum__post__text{% if post.post_parse == constant('MSZ_PARSER_MARKDOWN') %} markdown{% endif %}">
|
2018-09-21 08:56:52 +00:00
|
|
|
{{ post.post_text|escape|parse_text(post.post_parse)|raw }}
|
2018-05-21 02:28:51 +00:00
|
|
|
</div>
|
2018-05-20 20:12:45 +00:00
|
|
|
</div>
|
2018-05-18 01:20:27 +00:00
|
|
|
</div>
|
|
|
|
{% endmacro %}
|
2018-05-22 01:26:47 +00:00
|
|
|
|
|
|
|
{% macro forum_posting_form(title, target_id, is_reply, element_id) %}
|
2018-10-22 19:53:21 +00:00
|
|
|
{% from 'macros.twig' import container_title %}
|
2018-10-25 01:35:53 +00:00
|
|
|
{% from '_layout/input.twig' import input_hidden, input_csrf, input_text %}
|
2018-05-22 01:26:47 +00:00
|
|
|
{% set is_reply = is_reply ? true : false %}
|
|
|
|
|
2018-05-22 02:09:53 +00:00
|
|
|
<form{% if element_id is defined %} id="{{ element_id }}"{% endif %}
|
2018-10-22 17:26:59 +00:00
|
|
|
class="container forum__posting"
|
2018-05-22 01:26:47 +00:00
|
|
|
method="post"
|
|
|
|
action="/forum/posting.php">
|
2018-10-22 19:53:21 +00:00
|
|
|
{{ container_title(title) }}
|
2018-05-22 01:26:47 +00:00
|
|
|
|
2018-08-11 16:46:39 +00:00
|
|
|
<div class="forum__posting__content">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_hidden('post[' ~ (is_reply ? 'topic' : 'forum') ~ ']', target_id) }}
|
|
|
|
{{ input_csrf('forum_post') }}
|
2018-05-22 01:26:47 +00:00
|
|
|
|
2018-05-23 01:41:57 +00:00
|
|
|
{#<div class="forum__posting__errors">
|
|
|
|
<p class="forum__posting__error">Error: Your post contained too much text, shorten it a bit or split it out in two posts.</p>
|
|
|
|
</div>#}
|
|
|
|
|
2018-05-22 01:26:47 +00:00
|
|
|
{% if not is_reply %}
|
|
|
|
<div class="forum__posting__title">
|
2018-10-25 01:35:53 +00:00
|
|
|
{{ input_text('post[title]', 'forum__posting__title__input', '', 'text', 'Topic title') }}
|
2018-05-22 01:26:47 +00:00
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div class="forum__posting__text">
|
2018-10-22 17:26:59 +00:00
|
|
|
<textarea class="input__textarea forum__posting__text__input" name="post[text]"></textarea>
|
2018-05-22 01:26:47 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="forum__posting__buttons">
|
2018-10-22 17:26:59 +00:00
|
|
|
<button class="input__button">Submit</button>
|
2018-05-22 01:26:47 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{% endmacro %}
|