{% extends "1-col-sidebar.html.twig" %}
{# forum topic #}
{% block column %}
{% if site_code == constant("App\\Entity\\Content::SITE_RCS") %}
{% include "includes/curtain-ads/newForum.html.twig" %}
{% endif %}
<h1 class="page-title" >{{ content.title|raw }}</h1>
<a href="/forum/{{ content.getPrnt().slug }}" class="button" style="margin-bottom: 10px;">« Back To {{ content.getPrnt().title }}</a>
<span class="float-right forum-search">{% include "includes/forum-search-box.html.twig" %}</span>
{% block pagination %}
<div class="pagination row">
<div class="col-12">
<span class="pagination-text">
Viewing {{replies|length}}
{% if replies|length > 1 %}
replies - {{((limit * (pagenum - 1)) + 1)|number_format}} through {{((limit * (pagenum - 1)) + replies|length)|number_format }}
{% elseif replies|length > 0 %}
reply
{% else %}
replies
{% endif %}
(of {{ totalcount|number_format }} total)
</span>
<span class="float-right">
{% include "includes/pagination-links.html.twig" %}
</span>
</div>
</div>
{% endblock %}
<div class="forum-body forum-topic col-12">
<div class="row topic-header">
<div class="col-4 col-md-3 col-lg-2">
Author
</div>
<div class="col-8 col-md-9 col-lg-10" style="text-align: left">
Posts
</div>
</div>
{% if pagenum == 1 %}
<div class="row reply-header">
<div class="col-12">
{{ content.publishedat | date | rcsDateFormat }}
<span class="float-right">
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') and (content.author == app.user or app.user.isAdmin()) %}
<a href="/forum/topic/{{ content.slug }}/edit">Edit</a>
{% if app.user.isAdmin() %}
| <a href="/forum/topic/{{ content.slug }}/delete" onclick="return confirm('Are you sure you\'d like to delete this topic?')">Trash</a> |
<a href="/forum/topic/{{ content.slug }}/spam" onclick="return confirm('Mark this user as spam? (This will remove the user and all posts they\'ve made.)')">Spam</a> |
{% endif %}
{% endif %}
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
<a href="#reply" class="quote-content" data-id="{{ content.id }}">Quote</a>
|
<button class="btn {{ (content.countContentMetum('_like_user_id', app.user.getId())) ? 'unlike-content' : 'like-content' }}" type="button" data-id="{{ content.id }}"><i class='fa fa-thumbs-up'></i> {{ content.countContentMetum('_like_user_id')}}</button>
{% endif %}
{# Seems pointless #{{ content.id }} #}
</span>
</div>
</div>
<div class="row reply-body" style="background:#f7f6f4">
<div class="col-4 col-md-3 col-lg-2 reply-author">
{% if content.author is not empty %}
<img src="{{ content.author.getAvatarURL() }}" width="80px" height="80px" loading='lazy' />
{% else %}
<img src="/assets/img/default-user.jpg" width="80px" height="80px" loading='lazy' />
{% endif %}
<br>
{% if content.author is not empty %}
{{content.author}}
{% else %}
Anonymous
{% endif %}
</div>
{% apply spaceless %}
<div class="col-8 col-md-9 col-lg-10 reply-content">{{ content.contentfull|wordpress|trim|raw }}</div>
{% endapply %}
</div>
{% endif %}
{% for reply in replies %}
<div class="row reply-header">
<div class="col-12">
{{ reply.publishedat | date | rcsDateFormat }}
<span class="float-right">
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') and (reply.author == app.user or app.user.isAdmin()) %}
<a href="/forum/reply/{{ reply.id }}/edit">Edit</a> |
<a href="/forum/reply/{{ reply.id }}/delete" onclick="return confirm('Are you sure you\'d like to delete this reply?')">Trash</a> |
{% if app.user.isAdmin() %}
<a href="/forum/reply/{{ reply.id }}/spam" onclick="return confirm('Mark this user as spam? (This will remove the user and all posts they\'ve made.)')">Spam</a> |
{% endif %}
{% endif %}
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
<a href="#reply" class="quote-content" data-id="{{ reply.id }}">Quote</a>
|
<button class="btn {{ (reply.countContentMetum('_like_user_id', app.user.getId())) ? 'unlike-content' : 'like-content' }}" type="button" data-id="{{ reply.id }}"><i class='fa fa-thumbs-up'></i> {{ reply.countContentMetum('_like_user_id')}}</button>
{% endif %}
{# #{{ reply.id }} #}
</span>
</div>
</div>
<div class="row reply-body">
<div class="col-4 col-md-3 col-lg-2 reply-author">
{% if reply.author is not empty %}
<img src="{{ reply.author.getAvatarURL() }}" width="80px" height="80px" loading='lazy' />
{% else %}
<img src="/assets/img/default-user.jpg" width="80px" height="80px" loading='lazy' />
{% endif %}
<br>
{% if reply.author is not empty %}
{{reply.author}}
{% else %}
Anonymous
{% endif %}
</div>
{% apply spaceless %}
<div class="col-8 col-md-9 col-lg-10 reply-content">{{ reply.contentfull|wordpress|trim|raw }}</div>
{% endapply %}
</div>
{% endfor %}
</div>
<div class="forumTopicSocial">
{#social share buttons#}
{% include "includes/social-share.html.twig" %}
</div>
{{ block('pagination') }}
<a href="/forum/{{ content.getPrnt().slug }}" class="button" style="margin-bottom: 10px;">« Back To {{ content.getPrnt().title }}</a>
<div class="row" style="padding: 15px;">
<div class="col-12">
{% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
{#
{{ form_start(form) }}
{{ form_errors(form) }}
<label>Reply To: {{ content.title|raw }}</label>
<div>
{{ form_row(form.content_full, {
'label': false,
})
}}
</div>
<div class="form-check" id="reply">
<input type="checkbox" class="form-check-input" id="notify" name="notify">
<label class="form-check-label" for="notify">Notify me of replies to this topic via email</label>
</div>
<input type="submit" class="button float-right" value="Submit" />
{{ form_row(form._token) }}
{{ form_end(form, {'render_rest': false}) }}
#}
<form method="post" name="newreply" id="newreply">
<label>Reply To: {{ content.title|raw }}</label>
<div class="form-row">
<textarea class="form-control {% if unrestricted %}tinymce{% endif %}" data-admin="1" name="reply-content"></textarea>
</div>
<div class="form-check" id="reply">
<input type="checkbox" class="form-check-input" id="notify" name="notify" checked>
<label class="form-check-label" for="notify">Notify me of replies to this topic via email</label>
</div>
{#
<div class="form-row g-recaptcha" data-sitekey="6LeEIlMUAAAAAGhdmJJLdJHPxaWx2GqBjber5n6B"></div>
<input type="submit" class="button float-right" value="Submit" />
#}
<script>
function submitFormCaptcha() {
document.getElementById("newreply").submit();
}
</script>
{% if is_granted('ROLE_ADMIN') %}
<script> var forumTMCEAdmin = true; </script>
{% endif %}
<script src="{{ asset("assets/js/forum-tinymce.js?v=03-15-22") }}"></script>
<button class="g-recaptcha button float-right" data-sitekey="6LdhRKIUAAAAAGg5rCxp6izYm4f5qo9KpAzornb0" data-callback="submitFormCaptcha" type="submit">Submit</button>
</form>
{% else %}
<div class="notice">You must be logged in to reply to this topic.</div>
{% endif %}
</div>
</div>
<br>
{% endblock %}