<div class='row'>
  {{view Discourse.ReplyHistory contentBinding="replyHistory"}}
</div>

<article class='boxed' {{bindAttr id="postElementId"}} {{bindAttr data-post-id="id"}} data-user-id="{{unbound user_id}}">
  <div class='row'>
    {{#if showUserReplyTab}}
      <a href='#' {{action toggleReplyHistory this target="view"}} class='reply-to-tab'>
        {{#if loadingReplyHistory}}
          {{i18n loading}}
        {{else}}
          {{i18n post.in_reply_to}}
          {{avatar reply_to_user imageSize="tiny"}}
          {{reply_to_user.username}}
        {{/if}}
      </a>
    {{/if}}

    <div class='topic-meta-data span2'>
      {{#unless userDeleted}}
        <div {{bindAttr class=":contents byTopicCreator:topic-creator :trigger-expansion"}}>
          <a href='{{unbound usernameUrl}}' {{action showPosterExpansion this}}>{{avatar this imageSize="large"}}</a>
          <h3 {{bindAttr class="staff new_user"}}><a href='{{unbound usernameUrl}}' {{action showPosterExpansion this}}>{{breakUp username}}</a></h3>
          {{#if user_title}}<div class="user-title" {{action showPosterExpansion this}}>{{user_title}}</div>{{/if}}
        </div>
      {{else}}
        <div class="contents">
          <i class="icon icon-trash deleted-user-avatar"></i>
          <h3 class="deleted-username">{{i18n user.deleted}}</h3>
        </div>
      {{/unless}}
    </div>

    <div class='topic-body span14'>
      <div {{bindAttr class=":select-posts controller.multiSelect::hidden"}}>
        <button {{action toggledSelectedPostReplies this}} {{bindAttr class="view.canSelectReplies::hidden"}}>{{i18n topic.multi_select.select_replies}}</button>
        <button {{action toggledSelectedPost this}} class="select-post">{{view.selectPostText}}</button>
      </div>

      <div {{bindAttr class="showUserReplyTab:avoid-tab view.repliesShown::bottom-round :contents :regular view.extraClass"}}>
        {{#unless controller.multiSelect}}
          <div class='topic-meta-data-inside'>
            {{#if hasHistory}}
              <div class='post-info edits'>
                {{#if canViewEditHistory}}
                  <a href='#' class="{{unbound historyHeat}}" {{action showHistory this}} title="{{i18n post.last_edited_on}} {{unboundDate updated_at}}">
                    {{editCount}}
                    <i class='icon-pencil'></i>
                  </a>
                {{else}}
                  <span class="{{unbound historyHeat}}" title="{{i18n post.last_edited_on}} {{unboundDate updated_at}}">
                    {{editCount}}
                    <i class='icon-pencil'></i>
                  </span>
                {{/if}}
              </div>
            {{/if}}
            <div class='post-info'>
              <a href='#' class='post-date' {{bindAttr data-share-url="shareUrl"}} {{bindAttr data-post-number="post_number"}}>{{unboundAgeWithTooltip created_at}}</a>
            </div>
          </div>
        {{/unless}}
        <div class='cooked'>{{{cooked}}}</div>
        {{view Discourse.PostMenuView postBinding="this" postViewBinding="view"}}
      </div>
      {{view Discourse.RepliesView contentBinding="replies" postViewBinding="view"}}
      {{view Discourse.ActionsHistoryView postBinding="this"}}
      {{view Discourse.TopicSummaryView postBinding="this"}}
    </div>

    <div class='span5 gutter'>
      {{collection contentBinding="internalLinks" itemViewClass="Discourse.PostLinkView" tagName="ul" classNames="post-links"}}
      {{#if topic.details.can_reply_as_new_topic}}
        <a href='#' class='reply-new' {{action replyAsNewTopic this}}><i class='icon icon-plus'></i>{{i18n post.reply_as_new_topic}}</a>
      {{/if}}
    </div>
  </div>

</article>
