{{#if visible}}
<div class="card-content">

  <div class="user-card-avatar">
    <a href={{user.path}} {{action "showUser"}} class="card-huge-avatar">{{bound-avatar avatar "huge"}}</a>
    {{#if user.primary_group_name}}
      {{mount-widget widget="avatar-flair" args=user}}
    {{/if}}
  </div>

  <div class="names">
    <span>
      <h1 class="{{staff}} {{new_user}} {{if nameFirst "full-name" "username"}}">
        <a href={{user.path}} {{action "showUser"}}>{{if nameFirst user.name username}} {{user-status user currentUser=currentUser}}</a>
      </h1>

      {{#unless nameFirst}}
        {{#if user.name}}
          <h2 class='full-name'>{{user.name}}</h2>
        {{/if}}
      {{else}}
        <h2 class='username'>{{username}}</h2>
      {{/unless}}

      {{#if user.title}}
        <h2>{{user.title}}</h2>
      {{/if}}

      {{plugin-outlet "user-card-post-names"}}
    </span>
  </div>

  <ul class="usercard-controls">
    {{#if user.can_send_private_message_to_user}}
      <li><a class='btn btn-primary' {{action "composePrivateMessage" user post}}>{{fa-icon "envelope"}}{{i18n 'user.private_message'}}</a></li>
    {{/if}}

    {{#if showFilter}}
      <li><a class='btn' href {{action "togglePosts" user}}>{{fa-icon "filter"}}{{i18n 'topic.filter_to' username=username count=topicPostCount}}</a></li>
    {{/if}}

    {{#if hasUserFilters}}
      <li><a class='btn' href {{action "cancelFilter"}}>{{fa-icon "times"}}{{i18n 'topic.filters.cancel'}}</a></li>
    {{/if}}

    {{#if showDelete}}
      <li><a class='btn btn-danger' href {{action "deleteUser" user}}>{{fa-icon "exclamation-triangle"}}{{i18n 'admin.user.delete'}}</a></li>
    {{/if}}
  </ul>

  {{#if isSuspended}}
    <div class='suspended'>
      {{fa-icon "ban"}}
      <b>{{i18n 'user.suspended_notice' date=user.suspendedTillDate}}</b><br/>
      <b>{{i18n 'user.suspended_reason'}}</b> {{user.suspend_reason}}
    </div>
  {{else}}
    {{#if user.bio_cooked}}<div class='bio'>{{text-overflow class="overflow" text=user.bio_excerpt}}</div>{{/if}}
  {{/if}}

  {{#if user.card_badge}}
    {{#link-to 'badges.show' user.card_badge class="card-badge" title=user.card_badge.name}}
      {{icon-or-image user.card_badge.image title=user.card_badge.name}}
    {{/link-to}}
  {{/if}}

  {{#if hasLocationOrWebsite}}
    <div class="location-and-website">
      {{#if user.location}}
        <span class='location'>{{fa-icon "map-marker"}} {{user.location}}</span>
      {{/if}}

      {{#if user.website_name}}
        <span class='website-name'>
          {{fa-icon "globe"}}
          {{#if linkWebsite}}
            <a href={{user.website}} rel={{unless removeNoFollow 'nofollow'}} target="_blank">{{user.website_name}}</a>
          {{else}}
            <span title={{user.website}}>{{user.website_name}}</span>
          {{/if}}
        </span>
      {{/if}}
    </div>
  {{/if}}

  {{#if user}}
    <div class="metadata">
      {{#if user.last_posted_at}}
        <h3><span class='desc'>{{i18n 'last_post'}}</span> {{format-date user.last_posted_at leaveAgo="true"}}</h3>
      {{/if}}
      <h3><span class='desc'>{{i18n 'joined'}}</span> {{format-date user.created_at leaveAgo="true"}}</h3>
      {{plugin-outlet "user-card-metadata"}}
    </div>
  {{/if}}

  {{#if publicUserFields}}
    <div class="public-user-fields">
      {{#each publicUserFields as |uf|}}
        {{#if uf.value}}
          <div class="public-user-field {{uf.field.dasherized_name}}">
            <span class="user-field-name">{{uf.field.name}}:</span>
            <span class="user-field-value">{{uf.value}}</span>
          </div>
        {{/if}}
      {{/each}}
    </div>
  {{/if}}

  {{#if showBadges}}
    <div class="badge-section">
      {{#each user.featured_user_badges as |ub|}}
        {{user-badge badge=ub.badge user=user}}
      {{/each}}
      {{#if showMoreBadges}}
        {{#link-to 'user.badges' user class="btn more-user-badges"}}
          {{i18n 'badges.more_badges' count=moreBadgesCount}}
        {{/link-to}}
      {{/if}}
    </div>
  {{/if}}
</div>
{{/if}}
