{% import 'allura:templates/jinja_master/lib.html' as lib with context %}

<div>
                <div class="row">
                        <div class="column grid_12">
      {% if limit %}
        {{widgets.page_list.display(limit=limit, page=page, count=count)}}
      {% endif %}
      <div id="comment">
        {% set posts = value.find_posts(page=page, limit=limit) %}
          {% if posts %}
            {% for t in value.create_post_threads(posts) %}
            <ul>
              {{widgets.post_thread.display(value=t['post'], children=t['children'],
                  indent=0, show_subject=show_subject,
                  supress_promote=True, page=page, limit=limit)}}
            </ul>
            {% endfor %}
          {% endif %}
        {% if h.has_access(value, 'moderate')() %}
          <div id="allow_moderate"></div>
        {% endif %}
      </div>
      <div style="clear:both"></div>
      {% if limit and count>limit %}
      <div>
        {{widgets.page_list.display(limit=limit, page=page, count=count)}}
      </div>
      {% endif %}
      <div style="clear:both"></div>
    </div>
  </div>
</div>
{% if h.has_access(value, 'post')() %}
  <div id="new_post_holder">
    <span id="add_comment"></span>
    <div class="row reply">
      <div class="grid-2 tcenter">
          <p class="gravatar">
            {{lib.gravatar(c.user, size=48)}}<br>
            <small><a href="{{c.user.url()}}">{{c.user.display_name}}</a></small>
          </p>
        </div>
        <div class="grid-17">
        {{widgets.edit_post.display(submit_text='Post', action=value.url() + 'post')}}
      </div>
    </div>
  </div>
{% endif %}
