<li id="post-{{ post.id }}" class="thread-post thread-post-{{ post.id }} media">
  <a href="{{ path('user_show', {id:author.id}) }}" class="pull-left user-avatar">
    <img class="media-object" src="{{ filepath(author.smallAvatar, 'avatar.png') }}" >
  </a>
  <div class="media-body">
    <div class="metas">
      {% include 'TopxiaWebBundle:Thread:post-manage-menu.html.twig' %}
      <a href="{{ path('user_show', {id:author.id}) }}" class="nickname">{{ author.nickname }}</a>
      <span class="bullet">•</span>
      <span class="text-muted">{{post.createdTime|smart_time}} </span>
    </div>
    <div class="thread-post-content">{{ post.content|at(post.ats)|raw }}</div>
    <div>
      {% include 'TopxiaWebBundle:Thread:post-interaction.html.twig' %}
    </div>
    <div class="thread-subpost-container clearfix {% if not post.subposts %}hide{% endif %}">
      {{ render(controller('TopxiaWebBundle:Thread:subposts', {threadId: post.threadId, postId:post.id, less:true})) }}
      <div class="thread-subpost-morebar clearfix {% if not post.subposts %}hide{% endif %}">
        {% if service.canAccess('post.create', post) %}
          <button class="btn btn-default btn-xs pull-right js-toggle-subpost-form">我也说一句</button>
        {% endif %}
        <span class="thread-subpost-moretext {% if post.subposts <= 5 %}hide{% endif %}"><span class="text-muted">还有{{ post.subposts - 5 }}条回复，</span><a href="javascript:;" class="js-post-more">点击查看</a></span>
      </div>

      {% if service.canAccess('post.create', post) %}
        <form method="post" action="{{ path('thread_post_reply', {threadId:post.threadId, postId:post.id}) }}" class="thread-subpost-form {% if post.subposts %}hide{% endif %}">
          <div class="form-group">
            <div class="controls">
              <textarea class="form-control" name="content" data-display="内容"></textarea>
            </div>
          </div>
          <div class="form-group">
            <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
            <button type="submit" data-loading-text="正在发表" class="btn btn-primary btn-sm pull-right">发表</button>
          </div>
        </form>
      {% endif %}

    </div>
  </div>
</li>