<commit_before>{% extends "forum/_base.html" %}
{%- from "macros/user.html" import m_user_link, m_user_photo %}
{% from "macros/box.html" import m_box_menu, m_box_content %}
{% from "forum/_macros.html" import forum_menu %}


{% block forumcontent %}
  {% call m_box_content(_("Recent conversations")) %}

    <div class="forum-menu-container">
      <div class="forum-menu" role="group">
        {%- set global_actions = actions.for_category('forum:global') %}
        {%- for action in global_actions %}
          {{ forum_menu(action) }}
        {%- endfor %}
      </div>
    </div>

    {% if threads %}
      <table class="thread-table" border="0">
        <tr>
          <th colspan="2" style="">Topic</th>
          <th>Users</th>
          <th>
            <center>Replies</center>
          </th>
          <th>
            <center>Viewers</center>
          </th>
          <th>
            <center>Views</center>
          </th>
          <th>
            <center>Activity</center>
          </th>
        </tr>
        {% for thread in threads %}
          {{ m_thread(thread) }}
        {% endfor %}
      </table>
      <br>
      <br> {% else %}
      <p>{{ _("No message has been posted to this community yet.") }}</p>
    {% endif %}
    {% if has_more or True %}
      <br>
      <p class="thread-all"><i class="fa fa-th-list" aria-hidden="true" style="color:gray;"></i> <a
          href="{{ url_for('.archives', community_id=g.community.slug) }}">{{ _("All conversations") }}</a></p>
    {% endif %}
  {% endcall %}
{% endblock %}



{% macro m_thread(thread) %}
  {%- set thread_href = url_for(thread) %}
  {%- set thread_length = thread.posts|length %}
  <tr>
    <td class="thread-user">
      {% call m_user_link(thread.creator) %}
        {{ m_user_photo(thread.creator, size=40) }}
      {%- endcall %}
    </td>
    <td style="width: 31%;">
      <div class="entry">
        <h4><a href="{{ thread_href }}" title="{{ thread.created_at | age(date_threshold='day') }}"
               class="thread-title"> {{ thread.title }} </a></h4> {%- if thread.closed %}
        <i class="fa fa-lock fa-big"></i>{%- endif %}
      </div>
    </td>
    <td class="thread-frequent-posters">
      {% for p in thread.get_frequent_posters(5) %} {% call m_user_link(p) %} {{ m_user_photo(p, size=30) }}
      {%- endcall %} {% endfor %}
    </td>
    <td>
      <center>
        <div class="comments" style="position: relative;">
          <a class="thread-replies" href="{{ thread_href }}">
            {{ thread_length-1 }}</a>
          {% if thread.get_viewed_posts((g.user)) !=0 %}
            <span style="color:gray;"></span>
            <span class="thread-hilightview"
                  title="not viewed"> (+{{ thread.get_viewed_posts(g.user) }})</span>
          {% endif %}
      </center>
    </td>
    <td>
      <center><span class="thread-viewers"><i class="fa fa-user"
                                              aria-hidden="true"></i>
        {{ thread.get_nb_viewers(thread.creator.id) }}</span>
      </center>
    </td>
    <td>
      <center>
        <span class="thread-viewed-times"> {{ thread.viewed_times }}</span>
      </center>
    </td>
    <td>
      <center>
        {%- if thread_length > 1 %} {% set last_post_creator = thread.posts[-1].creator %}
          <span class="hidden-xs" style="">
          <span class="divider"
                style="color:silver;">{{ thread.posts[-1].created_at | age(date_threshold='day') }}</span>
        {%- endif %}
        </span>
      </center>
    </td>
  </tr>
{% endmacro %}
<commit_msg>Clean up / format templates.<commit_after>{% extends "forum/_base.html" %}
{%- from "macros/user.html" import m_user_link, m_user_photo %}
{% from "macros/box.html" import m_box_menu, m_box_content %}
{% from "forum/_macros.html" import forum_menu %}


{% block forumcontent %}
  {% call m_box_content(_("Recent conversations")) %}

    <div class="forum-menu-container">
      <div class="forum-menu" role="group">
        {%- set global_actions = actions.for_category('forum:global') %}
        {%- for action in global_actions %}
          {{ forum_menu(action) }}
        {%- endfor %}
      </div>
    </div>

    {% if threads %}
      <table class="thread-table" border="0">
        <tr>
          <th colspan="2" style="">Topic</th>
          <th>Users</th>
          <th>
            <center>Replies</center>
          </th>
          <th>
            <center>Viewers</center>
          </th>
          <th>
            <center>Views</center>
          </th>
          <th>
            <center>Activity</center>
          </th>
        </tr>
        {% for thread in threads %}
          {{ m_thread(thread) }}
        {% endfor %}
      </table>
      <br>
      <br> {% else %}
      <p>{{ _("No message has been posted to this community yet.") }}</p>
    {% endif %}
    {% if has_more or True %}
      <br>
      <p class="thread-all"><i class="fa fa-th-list" aria-hidden="true" style="color:gray;"></i> <a
          href="{{ url_for('.archives', community_id=g.community.slug) }}">{{ _("All conversations") }}</a></p>
    {% endif %}
  {% endcall %}
{% endblock %}



{% macro m_thread(thread) %}
  {%- set thread_href = url_for(thread) %}
  {%- set thread_length = thread.posts|length %}
  <tr>
    <td class="thread-user">
      {% call m_user_link(thread.creator) %}
        {{ m_user_photo(thread.creator, size=40) }}
      {%- endcall %}
    </td>
    <td style="width: 31%;">
      <div class="entry">
        <h4><a href="{{ thread_href }}" title="{{ thread.created_at | age(date_threshold='day') }}"
               class="thread-title"> {{ thread.title }} </a></h4>
        {%- if thread.closed %}
          <i class="fa fa-lock fa-big"></i>
        {%- endif %}
      </div>
    </td>
    <td class="thread-frequent-posters">
      {% for p in thread.get_frequent_posters(5) %}
        {% call m_user_link(p) %}
          {{ m_user_photo(p, size=30) }}
        {%- endcall %}
      {% endfor %}
    </td>
    <td>
      <center>
        <div class="comments" style="position: relative;">
          <a class="thread-replies" href="{{ thread_href }}">{{ thread_length-1 }}</a>
          {% if thread.get_viewed_posts(g.user) !=0 %}
            <span style="color:gray;"></span>
            <span class="thread-hilightview"
                  title="not viewed"> (+{{ thread.get_viewed_posts(g.user) }})</span>
          {% endif %}
      </center>
    </td>
    <td>
      <center>
        <span class="thread-viewers">
          <i class="fa fa-user" aria-hidden="true"></i>
          {{ thread.get_nb_viewers(thread.creator.id) }}
        </span>
      </center>
    </td>
    <td>
      <center>
        <span class="thread-viewed-times"> {{ thread.viewed_times }}</span>
      </center>
    </td>
    <td>
      <center>
        {%- if thread_length > 1 %}
          {% set last_post_creator = thread.posts[-1].creator %}
          <span class="hidden-xs">
          <span class="divider"
                style="color:silver;">{{ thread.posts[-1].created_at | age(date_threshold='day') }}</span>
        {%- endif %}
        </span>
      </center>
    </td>
  </tr>
{% endmacro %}

{'fraction_non_alphanumeric': 0.19509817574154018, 'fraction_numerical': 0.0044562038713271135, 'mean_word_length': 2.073170731707317, 'pattern_counts': {'":': 0, '<': 179, '<?xml version=': 0, '>': 181, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3514386', 'n_tokens_mistral': 2530, 'n_tokens_neox': 2331, 'n_words': 452}