at_theme-1.4.1/at_core/templates/dataset/forum-list.html.twig

at_core/templates/dataset/forum-list.html.twig
{#
/**
 * @file
 * Theme override to display a list of forums and containers.
 *
 * Available variables:
 * - forums: A collection of forums and containers to display. It is keyed to
 *   the numeric IDs of all child forums and containers. Each forum in forums
 *   contains:
 *   - is_container: A flag indicating if the forum can contain other
 *     forums. Otherwise, the forum can only contain topics.
 *   - depth: How deep the forum is in the current hierarchy.
 *   - zebra: 'even' or 'odd', used for row class.
 *   - icon_class: 'default' or 'new', used for forum icon class.
 *   - icon_title: Text alternative for the forum icon.
 *   - name: The name of the forum.
 *   - link: The URL to link to this forum.
 *   - description: The description field for the forum, containing:
 *     - value: The descriptive text for the forum.
 *   - new_topics: A flag indicating if the forum contains unread posts.
 *   - new_url: A URL to the forum's unread posts.
 *   - new_text: Text for the above URL, which tells how many new posts.
 *   - old_topics: A count of posts that have already been read.
 *   - num_posts: The total number of posts in the forum.
 *   - last_reply: Text representing the last time a forum was posted or
 *     commented in.
 * - forum_id: Forum ID for the current forum. Parent to all items within the
 *   forums array.
 *
 * @see template_preprocess_forum_list()
 */
#}
{# The svg must come before the <use> elements due to a bug in Safari. #}
<svg style="display:none;">
  {# Comment icon #}
  <symbol id="forum-icon-default" viewBox="0 0 24 20" preserveAspectRatio="xMinYMid">
    <path d="M22.4 4.1c-1.1-1.3-2.5-2.3-4.4-3S14.2 0 12 0 7.8 0.4 6 1.1s-3.3 1.8-4.4 3C0.5 5.4 0 6.8 0 8.3c0 1.3 0.4 2.5 1.2 3.7s1.9 2.1 3.3 2.9c-0.1 0.3-0.2 0.7-0.3 1 -0.1 0.3-0.3 0.6-0.4 0.8 -0.1 0.2-0.3 0.4-0.4 0.7 -0.2 0.2-0.3 0.4-0.4 0.5s-0.2 0.3-0.5 0.5c-0.2 0.2-0.4 0.4-0.4 0.4 0 0 0 0-0.1 0.1C1.9 18.9 1.9 19 1.9 19l-0.1 0.1c0 0.1-0.1 0.1-0.1 0.1 0 0 0 0.1 0 0.1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.3 0.4 0.3h0c0.1 0 0.2 0 0.3-0.1 0.1-0.1 0.1-0.2 0.1-0.2l0.7-5.8h5.6c0.2 0 0.4-0.1 0.6-0.2 0.2-0.2 0.2-0.3 0.2-0.5C15 12.1 14.6 11.2 14 10.4zM6.3 8.8c0 0.1 0 0.2-0.1 0.3C6.1 9.2 6 9.2 5.8 9.2s-0.2 0-0.3-0.1C5.5 9.1 5.4 9 5.4 8.8V3.5c0-0.1 0-0.2 0.1-0.3s0.2-0.1 0.3-0.1 0.2 0 0.3 0.1c0.1 0.1 0.1 0.2 0.1 0.3V8.8z"/>
  </symbol>
  {# Lock icon #}
  <symbol id="forum-icon-closed" viewBox="0 0 16 20" preserveAspectRatio="xMinYMid">
    <path d="M15.6 9.5c-0.3-0.3-0.6-0.4-0.9-0.4h-0.4V6.4c0-1.7-0.6-3.2-1.8-4.5C11.2 0.6 9.7 0 8 0S4.8 0.6 3.6 1.9C2.4 3.1 1.8 4.6 1.8 6.4v2.7H1.3C1 9.1 0.6 9.2 0.4 9.5 0.1 9.8 0 10.1 0 10.5v8.2c0 0.4 0.1 0.7 0.4 1C0.6 19.9 1 20 1.3 20h13.3c0.4 0 0.7-0.1 0.9-0.4 0.3-0.3 0.4-0.6 0.4-1v-8.2C16 10.1 15.9 9.8 15.6 9.5zM11.6 9.1H4.4V6.4c0-1 0.3-1.9 1-2.6C6.2 3.1 7 2.7 8 2.7s1.8 0.4 2.5 1.1c0.7 0.7 1 1.6 1 2.6V9.1z"/>
  </symbol>
</svg>
<table id="forum-{{ forum_id }}" class="table table--forum forum cols-4">
  <thead class="table__header forum-header">
    <tr class="table__row">
      <th class="table__cell forum-header__forum"><span>{{ 'Forum'|t }}</span></th>
      <th class="table__cell forum-header__topics"><span>{{ 'Topics'|t }}</span></th>
      <th class="table__cell forum-header__posts"><span>{{ 'Posts'|t }}</span></th>
      <th class="table__cell forum-header__last-reply"><span>{{ 'Last post'|t }}</span></th>
    </tr>
  </thead>
  <tbody class="table__body forum-list">
  {% for child_id, forum in forums %}
    <tr id="forum-list-{{ child_id }}" class="{{ forum.zebra }} table__row">
      <td {% if forum.is_container == true -%}
        colspan="4" class="table__container container"
      {%- else -%}
        class="table__cell forum-list__forum"
      {%- endif -%}>
        {#
          Enclose the contents of this cell with X divs, where X is the
          depth this forum resides at. This will allow us to use CSS
          left-margin for indenting.
        #}
        {% for i in 1..forum.depth|filter(forum.depth > 0) %}<div class="indent">{% endfor %}
          <div class="icon forum-icon forum-status-{{ forum.icon_class }}" title="{{ forum.icon_title }}">
            <svg class="{{ 'forum-icon-' ~  forum.icon_class }}">
              <use xlink:href="#{{ 'forum-icon-' ~  forum.icon_class }}"></use>
            </svg>
            <span class="visually-hidden">{{ forum.icon_title }}</span>
          </div>
          <div class="forum-list__name"><a href="{{ forum.link }}">{{ forum.label }}</a></div>
          {% if forum.description.value %}
            <div class="forum-list__description">{{ forum.description.value }}</div>
          {% endif %}
        {% for i in 1..forum.depth|filter(forum.depth > 0) %}</div>{% endfor %}
      </td>
      {% if forum.is_container == false %}
        <td class="table__cell forum-list__topics">
          <span class="forum__topic-count">{{ forum.num_topics }}</span>
          {% if forum.new_topics == true %}
            <a href="{{ forum.new_url }}" class="forum-list__replies-link">{{ forum.new_text }}</a>
          {% endif %}
        </td>
        <td class="table__cell forum-list__posts"><span class="forum__post-count">{{ forum.num_posts }}</span></td>
        <td class="table__cell forum-list__last-reply"><span class="forum__last-reply-datetime">{{ forum.last_reply }}</span></td>
      {% endif %}
    </tr>
  {% endfor %}
  </tbody>
</table>

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc