templates/content/tmpl/forum-topic.html.twig line 1

Open in your IDE?
  1. {% extends "1-col-sidebar.html.twig" %}
  2. {# forum topic #}
  3. {% block column %}
  4.     
  5.         {% if site_code == constant("App\\Entity\\Content::SITE_RCS") %}
  6.             {% include  "includes/curtain-ads/newForum.html.twig" %}
  7.         {% endif %}
  8.     
  9.     <h1 class="page-title" >{{ content.title|raw }}</h1>
  10.     
  11.     <a href="/forum/{{ content.getPrnt().slug }}" class="button" style="margin-bottom: 10px;">« Back To {{ content.getPrnt().title }}</a>
  12.     <span class="float-right forum-search">{% include "includes/forum-search-box.html.twig" %}</span>
  13.     {% block pagination %}
  14.     <div class="pagination row">
  15.         <div class="col-12">
  16.             <span class="pagination-text">
  17.                 Viewing {{replies|length}}
  18.                 {% if replies|length > 1 %}
  19.                     replies - {{((limit * (pagenum - 1)) + 1)|number_format}} through {{((limit * (pagenum - 1)) + replies|length)|number_format }} 
  20.                 {% elseif replies|length > 0 %}
  21.                     reply
  22.                 {% else %}
  23.                     replies
  24.                 {% endif %}
  25.                 (of {{ totalcount|number_format }} total)
  26.             </span>
  27.             <span class="float-right">
  28.                 {% include "includes/pagination-links.html.twig" %}
  29.             </span>
  30.         </div>
  31.     </div>
  32.     {% endblock %}
  33.     <div class="forum-body forum-topic col-12">
  34.         <div class="row topic-header">
  35.             <div class="col-4 col-md-3 col-lg-2">
  36.                 Author
  37.             </div>
  38.             <div class="col-8 col-md-9 col-lg-10" style="text-align: left">
  39.                 Posts
  40.             </div>
  41.         </div>
  42.         
  43.         {% if pagenum == 1 %}
  44.             <div class="row reply-header">
  45.                 <div class="col-12">
  46.                     {{ content.publishedat | date | rcsDateFormat  }}
  47.                     <span class="float-right">
  48.                         {% if  is_granted('IS_AUTHENTICATED_REMEMBERED') and (content.author == app.user or app.user.isAdmin()) %}
  49.                             <a href="/forum/topic/{{ content.slug }}/edit">Edit</a> 
  50.                             {% if app.user.isAdmin() %}
  51.                                 | <a href="/forum/topic/{{ content.slug }}/delete" onclick="return confirm('Are you sure you\'d like to delete this topic?')">Trash</a> |
  52.                                 <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> |
  53.                             {% endif %}
  54.                         {% endif %}
  55.                         {% if  is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  56.                             <a href="#reply" class="quote-content" data-id="{{ content.id }}">Quote</a>
  57.                             |
  58.                             <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>
  59.                         {% endif %}
  60.                         {# Seems pointless #{{ content.id }} #}
  61.                     </span>
  62.                 </div>
  63.             </div>
  64.             <div class="row reply-body" style="background:#f7f6f4">
  65.                 <div class="col-4 col-md-3 col-lg-2 reply-author">
  66.                     {% if content.author is not empty %}
  67.                         <img src="{{ content.author.getAvatarURL() }}" width="80px" height="80px" loading='lazy' />
  68.                     {% else %}
  69.                         <img src="/assets/img/default-user.jpg" width="80px" height="80px" loading='lazy' />
  70.                     {% endif %}
  71.                     <br>
  72.                     {% if content.author is not empty %}
  73.                         {{content.author}}
  74.                     {% else %}
  75.                         Anonymous
  76.                     {% endif %}
  77.                 </div>
  78.                 {% apply spaceless %}
  79.                 <div class="col-8 col-md-9 col-lg-10 reply-content">{{ content.contentfull|wordpress|trim|raw }}</div>
  80.                 {% endapply %}
  81.             </div>
  82.         {% endif %}
  83.             
  84.         {% for reply in replies %}
  85.             <div class="row reply-header">
  86.                 <div class="col-12">
  87.                     {{ reply.publishedat | date | rcsDateFormat  }}
  88.                     <span class="float-right">
  89.                         {% if  is_granted('IS_AUTHENTICATED_REMEMBERED') and (reply.author == app.user or app.user.isAdmin()) %}
  90.                             <a href="/forum/reply/{{ reply.id }}/edit">Edit</a> |
  91.                             <a href="/forum/reply/{{ reply.id }}/delete" onclick="return confirm('Are you sure you\'d like to delete this reply?')">Trash</a> |
  92.                             {% if app.user.isAdmin() %}
  93.                                 <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> |
  94.                             {% endif %}
  95.                         {% endif %}
  96.                         {% if  is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  97.                             <a href="#reply" class="quote-content" data-id="{{ reply.id }}">Quote</a>
  98.                             |
  99.                             <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>
  100.                         {% endif %}
  101.                         {# #{{ reply.id }} #}
  102.                     </span>
  103.                 </div>
  104.             </div>
  105.             <div class="row reply-body">
  106.                 <div class="col-4 col-md-3 col-lg-2 reply-author">
  107.                     {% if reply.author is not empty %}
  108.                         <img src="{{ reply.author.getAvatarURL() }}" width="80px" height="80px" loading='lazy' />
  109.                     {% else %}
  110.                         <img src="/assets/img/default-user.jpg" width="80px" height="80px" loading='lazy' />
  111.                     {% endif %}
  112.                     <br>
  113.                     {% if reply.author is not empty %}
  114.                         {{reply.author}}
  115.                     {% else %}
  116.                         Anonymous
  117.                     {% endif %}
  118.                 </div>
  119.                 {% apply spaceless %}
  120.                 <div class="col-8 col-md-9 col-lg-10 reply-content">{{ reply.contentfull|wordpress|trim|raw }}</div>
  121.                 {% endapply %}
  122.             </div>
  123.         {% endfor %}
  124.     </div>
  125.     <div class="forumTopicSocial">
  126.         {#social share buttons#}
  127.         {% include "includes/social-share.html.twig" %}
  128.     </div>
  129.     {{ block('pagination') }}
  130.     <a href="/forum/{{ content.getPrnt().slug }}" class="button" style="margin-bottom: 10px;">« Back To {{ content.getPrnt().title }}</a>
  131.     <div class="row" style="padding: 15px;">
  132.         <div class="col-12">
  133.             {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  134.             
  135.                 {#
  136.                 {{ form_start(form) }}
  137.                     {{ form_errors(form) }}
  138.                     <label>Reply To: {{ content.title|raw }}</label>
  139.                     <div>
  140.                     {{ form_row(form.content_full, {
  141.                             'label': false,
  142.                         })
  143.                     }}
  144.                     </div>
  145.                     <div class="form-check" id="reply">
  146.                         <input type="checkbox" class="form-check-input" id="notify" name="notify">
  147.                         <label class="form-check-label" for="notify">Notify me of replies to this topic via email</label>
  148.                     </div>
  149.                     <input type="submit" class="button float-right" value="Submit" />
  150.                     {{ form_row(form._token) }}
  151.                 {{ form_end(form, {'render_rest': false}) }}
  152.                 #}
  153.                 
  154.                 
  155.                 <form method="post" name="newreply" id="newreply">
  156.                     <label>Reply To: {{ content.title|raw }}</label>
  157.                     <div class="form-row">
  158.                         <textarea class="form-control {% if unrestricted %}tinymce{% endif %}" data-admin="1" name="reply-content"></textarea>
  159.                     </div>
  160.                     <div class="form-check" id="reply">
  161.                         <input type="checkbox" class="form-check-input" id="notify" name="notify" checked>
  162.                         <label class="form-check-label" for="notify">Notify me of replies to this topic via email</label>
  163.                     </div>
  164.                     
  165.                     {#
  166.                     <div class="form-row g-recaptcha" data-sitekey="6LeEIlMUAAAAAGhdmJJLdJHPxaWx2GqBjber5n6B"></div>
  167.                     <input type="submit" class="button float-right" value="Submit" />
  168.                     #}
  169.                     <script>
  170.                     function submitFormCaptcha() {
  171.                         document.getElementById("newreply").submit();
  172.                     }
  173.                     </script>
  174.                     {% if is_granted('ROLE_ADMIN') %}
  175.                         <script> var forumTMCEAdmin = true; </script>
  176.                     {% endif %}
  177.                     <script src="{{ asset("assets/js/forum-tinymce.js?v=03-15-22") }}"></script>
  178.                     <button class="g-recaptcha button float-right" data-sitekey="6LdhRKIUAAAAAGg5rCxp6izYm4f5qo9KpAzornb0" data-callback="submitFormCaptcha" type="submit">Submit</button>
  179.                     
  180.                 </form>
  181.                 
  182.                 
  183.             {% else %}
  184.                 <div class="notice">You must be logged in to reply to this topic.</div>
  185.             {% endif %}
  186.         </div>
  187.     </div>
  188.     <br>
  189.     
  190.     
  191. {% endblock %}