{{#unless loading}}
  <div class="container">

    <section class='user-navigation'>

      <ul class='action-list nav-stacked'>
        {{discourse-activity-filter count=statsCountNonPM user=model userActionType=userActionType indexStream=indexStream}}
        {{#each stat in statsExcludingPms}}
          {{discourse-activity-filter content=stat user=model userActionType=userActionType indexStream=indexStream}}
        {{/each}}
      </ul>

      {{#if canSeePrivateMessages}}
        <h3><i class='fa fa-envelope'></i> {{i18n user.private_messages}}</h3>
        <ul class='action-list nav-stacked'>
          <li {{bindAttr class=":noGlyph privateMessagesActive:active"}}>
            {{#link-to 'userPrivateMessages.index' model}}{{i18n user.messages.all}}<span class='fa fa-chevron-right'></span>{{/link-to}}
          </li>
          <li {{bindAttr class=":noGlyph privateMessagesMineActive:active"}}>
            {{#link-to 'userPrivateMessages.mine' model}}{{i18n user.messages.mine}}<span class='fa fa-chevron-right'></span>{{/link-to}}
          </li>
          <li {{bindAttr class=":noGlyph privateMessagesUnreadActive:active"}}>
            {{#link-to 'userPrivateMessages.unread' model}}{{i18n user.messages.unread}}<span class='fa fa-chevron-right'></span>{{/link-to}}
          </li>
        </ul>
      {{/if}}

      {{#if can_edit}}
        <div style='margin-top: 10px'>
          <button class='btn' data-not-implemented='true' disabled title="{{i18n not_implemented}}"><i class='fa fa-download'></i>{{i18n user.download_archive}}</button>
        </div>
      {{/if}}
    </section>

    <section class='user-main'>
      <section {{bindAttr class="collapsedInfo :about"}}>

        <div class='details'>
          <div class='primary'>
          {{boundAvatar model imageSize="huge"}}
          <h1>{{username}} {{{statusIcon}}}</h1>
          <h2>{{name}}</h2>

          <div class='bio'>{{{bio_cooked}}}</div>

          {{#if isSuspended}}
            <div class='suspended'>
              <i class='fa fa-ban'></i>
              <b>{{i18n user.suspended_notice date="suspendedTillDate"}}</b><br/>
              <b>{{i18n user.suspended_reason}}</b> {{suspend_reason}}
            </div>
          {{/if}}
          </div>

          <div class='secondary'>
            <dl>
              {{#if websiteName}}
                <dt>{{i18n user.website}}</dt><dd><a {{bindAttr href="website"}} target="_blank">{{websiteName}}</a></dd>
              {{/if}}
              {{#if created_at}}
                <dt>{{i18n user.created}}</dt><dd>{{date created_at}}</dd>
              {{/if}}
              {{#if last_posted_at}}
                <dt>{{i18n user.last_posted}}</dt><dd>{{date last_posted_at}}</dd>
              {{/if}}
              {{#if last_seen_at}}
                <dt>{{i18n user.last_seen}}</dt><dd>{{date last_seen_at}}</dd>
              {{/if}}
              {{#if invited_by}}
                <dt>{{i18n user.invited_by}}</dt><dd>{{#link-to 'userActivity' invited_by}}{{invited_by.username}}{{/link-to}}</dd>
              {{/if}}
              {{#if email}}
                <dt>{{i18n user.email.title}}</dt><dd {{bindAttr title="email"}}>{{email}}</dd>
              {{/if}}
              <dt>{{i18n user.trust_level}}</dt><dd>{{trustLevel.name}}</dd>
            </dl>
          </div>

          <div style='clear: both'></div>
        </div>

        <section class='controls'>
          {{#if can_send_private_message_to_user}}
            <button class='btn btn-primary' {{action composePrivateMessage}}>
              <i class='fa fa-envelope'></i>
              {{i18n user.private_message}}
            </button>
          {{/if}}

          {{#if viewingSelf}}
            <button {{action "logout"}} class='btn btn-danger right'><i class='fa fa-sign-out'></i>{{i18n user.log_out}}</button>
          {{/if}}

          {{#if currentUser.staff}}
            <a {{bindAttr href="adminPath"}} class='btn right'><i class="fa fa-wrench"></i>{{i18n admin.user.show_admin_profile}}</a>
          {{/if}}

          {{#if can_edit}}
            {{#link-to 'preferences' class="btn right"}}<i class='fa fa-cog'></i>{{i18n user.preferences}}{{/link-to}}
          {{/if}}

          {{#link-to 'user.invited' class="btn right"}}<i class='fa fa-envelope-o'></i>{{i18n user.invited.title}}{{/link-to}}

        </section>
      </section>

      {{outlet userOutlet}}
    </section>

  </div>
{{/unless}}
