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

Open in your IDE?
  1. {% extends "1-col-sidebar.html.twig" %}
  2. {# forum list #}
  3. {% block column %}
  4.     {% if site_code == constant("App\\Entity\\Content::SITE_RCS") %}
  5.         {% include  "includes/curtain-ads/newForum.html.twig" %}
  6.         <div style="width:100%;"><img src="https://www.rooferscoffeeshop.com/uploads/media/2022/02/rcs-forum-website.png" loading='lazy'></div>
  7.     {% else %}
  8.         <h1 class="page-title" >Forums</h1>
  9.     {% endif %}
  10.     
  11.     {% if forums is defined and forums is not empty %}
  12.         {% if site_code == constant("App\\Entity\\Content::SITE_RCS") %}
  13.             <a style="float: left;" href="/rcs-forum-code-conduct" class="group-append button">Code of Conduct</a>
  14.         {% else %}
  15.             <a style="float: left;" href="https://www.rooferscoffeeshop.com/rcs-forum-code-conduct" class="group-append button">Code of Conduct</a>
  16.         {% endif %}
  17.         <span class="float-right forum-search">{% include "includes/forum-search-box.html.twig" %}</span>
  18.         
  19.         <table class="table forum-body" style="margin-top:65px; margin-bottom: 50px;">
  20.          <thead>
  21.             <tr class="forum-header">
  22.                 <th scope="col">Forum</th>
  23.                 <th scope="col" style="text-align: center;">Topics</th>
  24.                 <th scope="col" style="text-align: center;">Posts</th>
  25.                 <th scope="col" style="text-align: center;">Most Recent Reply</th>
  26.             </tr>
  27.         </thead>
  28.         <tbody>
  29.             {% for forum in forums %}
  30.                 {% if (forum.forum.getMembersOnly() and app.user and app.user.isMember()) or (not forum.forum.getMembersOnly()) %}
  31.                     <tr {% if forum.forum.getMembersOnly() %}class="featured" {% endif %}>
  32.                     <td><a href="/forum/{{forum.forum.slug}}">{{forum.forum.title|raw}}</a></td>
  33.                     <td style="text-align: center;">{{forum.num_topics|number_format}}</td>
  34.                     <td style="text-align: center;">{{forum.num_posts|number_format}}</td>
  35.                     
  36.                     <td class="recentpostdate" style="text-align: center;">
  37.                     {% if forum.recent_topic is not empty %}
  38.                         {% set recent_reply = (forum.recent_topic.getActiveChildren().first() ? forum.recent_topic.getActiveChildren().first() : forum.recent_topic ) %}
  39.                         {{ post_age_format(date(recent_reply.publishedat|date).diff(date("now")))}}<br><span class="topic-meta">
  40.                         {% if recent_reply.author is not empty %}
  41.                             <img style="border: 3px double #ddd;" src="{{ recent_reply.author.getAvatarURL() }}" width="14px" height="14px" loading='lazy' />
  42.                         {% else %}
  43.                             <img style="border: 3px double #ddd;" src="/assets/img/default-user.jpg" width="14px" height="14px" loading='lazy' />
  44.                         {% endif %}
  45.                         {% if recent_reply.author is not empty %}
  46.                             {{recent_reply.author}}
  47.                         {% else %}
  48.                             Anonymous
  49.                         {% endif %}
  50.                         </span></td>
  51.                     {% else %}
  52.                         No Topics
  53.                     {% endif %}
  54.                     </td>
  55.                     </tr>
  56.                 {% endif %}
  57.             {% endfor %}
  58.           </tbody>
  59.         </table>
  60.     {% else %}
  61.         <h4 style="margin:50px 0;text-align:center;">No forums are available at this time. Please check back soon!</h4>
  62.     {% endif %}    
  63. {% endblock %}