<nav class='buttons'>
  <button class='btn' {{action toggleMap}} title="{{i18n topic.toggle_information}}">
    <i {{bind-attr class=":fa toggleMapClass"}}></i>
  </button>
</nav>

<section {{bind-attr class=":map mapCollapsed"}}>
  <ul class="clearfix">
    <li>
      <a href='{{unbound topic.url}}' {{bind-attr class=topic.ageCold}}>
      <h4>{{i18n created}}</h4>
      {{avatar details.created_by imageSize="tiny"}}
      {{unboundDate topic.created_at}}
      </a>
    </li>
    <li>
      <a {{bind-attr href="topic.lastPostUrl"}}>
      <h4>{{i18n last_post}}</h4>
      {{avatar details.last_poster imageSize="tiny"}}
      {{unboundDate topic.last_posted_at}}
      </a>
    </li>
    <li>
      <h4>{{i18n posts}}</h4>
      {{number topic.posts_count}}
    </li>
    <li class='secondary'>
      <h4>{{i18n views}}</h4>
      {{number topic.views class=topic.viewsHeat}}
    </li>
    <li class='secondary'>
      <h4>{{i18n users}}</h4>
      {{number topic.participant_count}}
    </li>
    {{#if topic.like_count}}
      <li class='secondary'>
        <h4>{{i18n likes}}</h4>
        <i class='fa fa-heart'></i> {{number topic.like_count}}
      </li>
    {{/if}}
    {{#if details.links.length}}
    <li class='secondary'>
      <h4>{{i18n links}}</h4>
      {{number details.links.length}}
    </li>
    {{/if}}
    <li {{bind-attr class=":avatars mapCollapsed::hidden"}}>
      {{#groupedEach participant in details.fewParticipants}}{{topic-participant participant=participant}}{{/groupedEach}}
    </li>
  </ul>
</section>

{{#unless mapCollapsed}}
  <section class='avatars clearfix'>
    {{#groupedEach participant in details.participants}}{{topic-participant participant=participant}}{{/groupedEach}}
  </section>

  {{#if infoLinks}}
    <section class='links'>
        <ul class='topic-links'>
          {{#groupedEach infoLinks}}
            <li>
              <span class='badge badge-notification clicks' title='{{i18n topic_map.clicks}}'>{{clicks}}</span>
              <a href="{{unbound url}}" target="_blank" class='topic-link track-link' data-user-id="{{unbound user_id}}" data-ignore-post-id="true" title="{{unbound url}}">
                {{#if title}}{{title}}{{else}}{{shortenUrl url}}{{/if}}
                {{#unless internal}}<i class='fa fa-external-link'></i>{{/unless}}
              </a>
            </li>
          {{/groupedEach}}
        </ul>

        {{#if showAllLinksControls}}
          <div class='link-summary'>
            <a href='#' {{action showAllLinks}}>{{i18n topic_map.links_shown totalLinks="details.links.length"}}</a>
          </div>
        {{/if}}

    </section>
  {{/if}}
{{/unless}}
