<commit_before>{% extends 'layout/base.html' %}
{% from 'macros/board.html' import render_flag_new %}
{% from 'macros/datetime.html' import render_datetime %}
{% from 'macros/icons.html' import render_icon %}
{% from 'macros/pagination.html' import render_pagination_nav %}
{% from 'macros/user.html' import render_user_avatar_16_and_name %}
{% set current_page = 'board' %}
{% set title = 'Forum - %s'|format(category.title) %}

{% block body %}

  <nav class="breadcrumbs">
    <ol>
      <li><a href="{{ url_for('.category_index') }}">Forum</a></li>
    </ol>
  </nav>
  <h1>{{ category.title }}</h1>

  <table class="index wide board-topic-index">
    <thead>
      <tr>
        <th>Thema</th>
        <th class="centered">Antworten</th>
        <th>Letzter Beitrag</th>
      </tr>
    </thead>
    <tbody>
      {%- for topic in topics.items %}
      <tr id="topic-{{ topic.id }}"{% if topic.hidden %} class="dimmed"{% endif %}>
        <td>
          <a class="board-topic-link disguised" href="{{ url_for('.topic_view', topic_id=topic.id) }}">
            <div class="board-topic-title">
              {%- if topic.hidden %}{{ render_icon('hidden', title='versteckt (durch %s)'|format(topic.hidden_by.screen_name)) }} {% endif -%}
              {%- if topic.locked %}{{ render_icon('lock', title='geschlossen (durch %s)'|format(topic.locked_by.screen_name)) }} {% endif -%}
              {%- if topic.pinned %}{{ render_icon('pin', title='angeheftet (durch %s)'|format(topic.pinned_by.screen_name)) }} {% endif -%}
              <strong>{{ topic.title }}</strong>
              {%- if topic.contains_unseen_postings %} {{ render_flag_new() }}{% endif %}
            </div>
            <div class="board-topic-initial-posting">
              begonnen von {{ render_user_avatar_16_and_name(topic.creator) }}
            </div>
          </a>
        </td>
        <td class="centered bignumber">{{ topic.reply_count }}</td>
        <td class="nowrap">{{ render_datetime(topic.last_updated_at) }}<br>von {{ render_user_avatar_16_and_name(topic.last_updated_by) }}</td>
      </tr>
      {%- endfor %}
      <tr>
    </tbody>
  </table>

{{ render_pagination_nav(topics, 'board.category_view', {'slug': category.slug}, centered=True) }}

  {%- set current_user_may_create_topic = g.current_user.has_permission(BoardTopicPermission.create) %}

  <div class="button-row button-row--right">

    {%- if current_user_may_create_topic %}
    <a class="button" href="{{ url_for('.topic_create_form', category_id=category.id) }}">{{ render_icon('add') }} Thema hinzufügen</a>
    {%- else %}
    <span class="button button--disabled">{{ render_icon('add') }} Thema hinzufügen</span>
    {%- endif %}

    {%- if not g.current_user.is_anonymous %}
    <div class="dropdown left">
      <button class="dropdown-toggle button">mehr {{ render_icon('caret-down') }}</button>
      <ol>
        <li><a data-action="mark-all-topics-in-category-as-viewed" href="{{ url_for('.mark_all_topics_in_category_as_viewed', category_id=category.id) }}">{{ render_icon('view') }} alle Themen in dieser Kategorie als gelesen markieren</a></li>
      </ol>
    </div>
    {%- endif %}

  </div>

  {%- if not current_user_may_create_topic %}
  <small>
    <p style="text-align: right;">Du musst <a href="{{ url_for('authentication.login_form') }}">angemeldet</a> sein um Themen hinzufügen zu können.</p>
  </small><commit_msg>Display fallback instead of empty table if no topics were found in a board category<commit_after>{% extends 'layout/base.html' %}
{% from 'macros/board.html' import render_flag_new %}
{% from 'macros/datetime.html' import render_datetime %}
{% from 'macros/icons.html' import render_icon %}
{% from 'macros/pagination.html' import render_pagination_nav %}
{% from 'macros/user.html' import render_user_avatar_16_and_name %}
{% set current_page = 'board' %}
{% set title = 'Forum - %s'|format(category.title) %}

{% block body %}

  <nav class="breadcrumbs">
    <ol>
      <li><a href="{{ url_for('.category_index') }}">Forum</a></li>
    </ol>
  </nav>
  <h1>{{ category.title }}</h1>

  {%- if topics.items %}
  <table class="index wide board-topic-index">
    <thead>
      <tr>
        <th>Thema</th>
        <th class="centered">Antworten</th>
        <th>Letzter Beitrag</th>
      </tr>
    </thead>
    <tbody>
      {%- for topic in topics.items %}
      <tr id="topic-{{ topic.id }}"{% if topic.hidden %} class="dimmed"{% endif %}>
        <td>
          <a class="board-topic-link disguised" href="{{ url_for('.topic_view', topic_id=topic.id) }}">
            <div class="board-topic-title">
              {%- if topic.hidden %}{{ render_icon('hidden', title='versteckt (durch %s)'|format(topic.hidden_by.screen_name)) }} {% endif -%}
              {%- if topic.locked %}{{ render_icon('lock', title='geschlossen (durch %s)'|format(topic.locked_by.screen_name)) }} {% endif -%}
              {%- if topic.pinned %}{{ render_icon('pin', title='angeheftet (durch %s)'|format(topic.pinned_by.screen_name)) }} {% endif -%}
              <strong>{{ topic.title }}</strong>
              {%- if topic.contains_unseen_postings %} {{ render_flag_new() }}{% endif %}
            </div>
            <div class="board-topic-initial-posting">
              begonnen von {{ render_user_avatar_16_and_name(topic.creator) }}
            </div>
          </a>
        </td>
        <td class="centered bignumber">{{ topic.reply_count }}</td>
        <td class="nowrap">{{ render_datetime(topic.last_updated_at) }}<br>von {{ render_user_avatar_16_and_name(topic.last_updated_by) }}</td>
      </tr>
      {%- endfor %}
      <tr>
    </tbody>
  </table>
  {%- else %}
  <p class="dimmed">In dieser Kategorie gibt es noch keine Themen.</p>
  {%- endif %}

{{ render_pagination_nav(topics, 'board.category_view', {'slug': category.slug}, centered=True) }}

  {%- set current_user_may_create_topic = g.current_user.has_permission(BoardTopicPermission.create) %}

  <div class="button-row button-row--right">

    {%- if current_user_may_create_topic %}
    <a class="button" href="{{ url_for('.topic_create_form', category_id=category.id) }}">{{ render_icon('add') }} Thema hinzufügen</a>
    {%- else %}
    <span class="button button--disabled">{{ render_icon('add') }} Thema hinzufügen</span>
    {%- endif %}

    {%- if not g.current_user.is_anonymous %}
    <div class="dropdown left">
      <button class="dropdown-toggle button">mehr {{ render_icon('caret-down') }}</button>
      <ol>
        <li><a data-action="mark-all-topics-in-category-as-viewed" href="{{ url_for('.mark_all_topics_in_category_as_viewed', category_id=category.id) }}">{{ render_icon('view') }} alle Themen in dieser Kategorie als gelesen markieren</a></li>
      </ol>
    </div>
    {%- endif %}

  </div>

  {%- if not current_user_may_create_topic %}
  <small>
    <p style="text-align: right;">Du musst <a href="{{ url_for('authentication.login_form') }}">angemeldet</a> sein um Themen hinzufügen zu können.</p>
  </small>
{'fraction_non_alphanumeric': 0.18840165690615626, 'fraction_numerical': 0.0022853878017426083, 'mean_word_length': 3.3436724565756824, 'pattern_counts': {'":': 0, '<': 133, '<?xml version=': 0, '>': 133, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5626232', 'n_tokens_mistral': 2520, 'n_tokens_neox': 2374, 'n_words': 444}