{{#each categories}}
  <div class='category-list-item'>
    <table class='topic-list'>
      <tr>
        <th class="main-link">
          {{category-link this allowUncategorized=true}}
        </th>
      </tr>

      {{#if description_excerpt}}
        <tr class="category-description">
          <td colspan="3">
            {{{description_excerpt}}}
          </td>
        </tr>
      {{/if}}

      {{#each topics}}
        <tr {{bind-attr class="archived :category-topic-link"}}>
          <td class='main-link'>
            <div class='topic-inset'>
              {{topic-status topic=this}}
              {{topic-link this}}

              {{topic-post-badges unread=unread newPosts=new_posts unseen=unseen url=lastUnreadUrl}}
              {{#if hasExcerpt}}
                <div class="topic-excerpt">
                  {{{excerpt}}}
                  {{#if excerptTruncated}}
                  {{#unless canClearPin}}<a href="{{unbound url}}">{{i18n read_more}}</a>{{/unless}}
                  {{/if}}
                  {{#if canClearPin}}
                    <a href="#" {{action "clearPin" this}} title="{{unbound i18n topic.clear_pin.help}}">{{i18n topic.clear_pin.title}}</a>
                  {{/if}}
                </div>
              {{/if}}
            </div>
          </td>
          <td class='num posts'>{{number posts_count}}</td>
          <td class='num age'><span class="{{cold-age-class created_at}}" title='{{raw-date created_at}}'>{{{format-age created_at}}}</span></td>
        </tr>

      {{/each}}
      {{#if subcategories}}
        <tr>
          <td>
            <div class='subcategories'>
              {{#each subcategory in subcategories}}
                {{category-link subcategory showParent=true}}
              {{/each}}
            </div>
          </td>
        </tr>
      {{/if}}

    </table>
    <footer class="clearfix">
      <figure title="{{i18n year_desc}}">{{number topics_year}} <figcaption>{{i18n category.this_year}}</figcaption></figure>
      <figure title="{{i18n month_desc}}">{{number topics_month}} <figcaption>{{i18n month}}</figcaption></figure>
      <figure title="{{i18n week_desc}}">{{number topics_week}} <figcaption>{{i18n week}}</figcaption></figure>

      {{#if controller.canEdit}}
        <a href='#' {{action "editCategory" this}} class='btn btn-small'>{{i18n category.edit}}</a>
      {{/if}}

    </footer>
  </div>
{{/each}}
