{{#if categories}}
  <div class='contents'>
    <table class='topic-list categories'>
      <thead>
        <tr>
          <th class='category'>{{i18n categories.category}}</th>
          <th class='latest'>{{i18n categories.latest}}</th>
          <th class='stats topics'>{{i18n categories.topics}}</th>
        </tr>
      </thead>
      <tbody>
        {{#each categories}}
        <tr data-category_id='{{unbound id}}' {{bind-attr class="description_excerpt:has-description:no-description logo_url:has-logo:no-logo"}}>
          <td class='category' style="border-color: #{{unbound color}}">
            <div>
              <div class="pull-left">
                {{category-title-link category=this}}
                {{#if unreadTopics}}
                  <a href={{unbound unreadUrl}} class='badge new-posts badge-notification' title='{{i18n topic.unread_topics count="unreadTopics"}}'>{{i18n filters.unread.lower_title_with_count count="unreadTopics"}}</a>
                {{/if}}
                {{#if newTopics}}
                  <a href={{unbound newUrl}} class='badge new-posts badge-notification' title='{{i18n topic.new_topics count="newTopics"}}'>{{i18n filters.new.lower_title_with_count count="newTopics"}}</a>
                {{/if}}
              </div>
              <div class="clearfix"></div>
            </div>
            {{#if description_excerpt}}
              <div class="category-description">
                {{{description_excerpt}}}
              </div>
            {{/if}}
            {{#if subcategories}}
              <div class='subcategories'>
                {{#each subcategories}}
                  {{category-link this showParent=true onlyStripe=true}}
                  {{#if unreadTopics}}
                    <a href={{unbound unreadUrl}} class='badge new-posts badge-notification' title='{{i18n topic.unread_topics count="unreadTopics"}}'>{{unbound unreadTopics}}</a>
                  {{/if}}
                  {{#if newTopics}}
                    <a href={{unbound newUrl}} class='badge new-posts badge-notification' title='{{i18n topic.new_topics count="newTopics"}}'>{{unbound newTopics}}</a>
                  {{/if}}
                {{/each}}
              </div>
            {{/if}}
          </td>
          <td {{bind-attr class="archived :latest"}}>
            {{#each featuredTopics}}
              <div class="featured-topic">
                {{topic-status topic=this}}
                <a class='title' href="{{unbound lastUnreadUrl}}">{{{unbound fancy_title}}}</a>
                {{topic-post-badges newPosts=totalUnread unseen=unseen url=lastUnreadUrl}}

                {{#if controller.latestTopicOnly}}
                  <div class='last-user-info'>
                    {{i18n categories.latest_by}} <a href="{{{unbound lastPosterUrl}}}">{{unbound last_poster.username}}</a>
                    <a href="{{unbound lastPostUrl}}">{{format-age last_posted_at}}</a>
                  </div>
                {{else}}
                  &nbsp;
                  <a href="{{unbound lastPostUrl}}" class="last-posted-at">{{format-age last_posted_at}}</a>
                {{/if}}
              </div>
            {{/each}}
          </td>
          <td class='stats' {{bind-attr title="topicStatsTitle"}}>
            <table class="categoryStats">
              <tbody>
              {{#each topicCountStats}}
                <tr>
                  <td class="value">{{value}}</td>
                  <td class="unit"> / {{unit}}</td>
                </tr>
              {{/each}}
              </tbody>
            </table>
          </td>
        </tr>
        {{/each}}
      </tbody>
    </table>
  </div>
  <footer class='topic-list-bottom'></footer>
{{/if}}
