<%namespace name="renderer" file="_thread.html"/>

<section class="discussion inline-discussion" _id="${discussion_id}">
  <div class="discussion-non-content">
    <div class="search-wrapper-inline">
      <%include file="_search_bar.html" />
    </div>
    <div class="discussion-new-post control-button" href="javascript:void(0)">New Post</div>
    <%include file="_sort.html" />
  </div>
  % for thread in threads:
    ${renderer.render_thread(course_id, thread, edit_thread=False, show_comments=False)}
  % endfor
  <%include file="_paginator.html" />
</section>

<%!
  def escape_quotes(text):
    return text.replace('\"', '\\\"').replace("\'", "\\\'")
%>

<script type="text/javascript">
  var $$user_info = JSON.parse('${user_info | escape_quotes}');
  var $$course_id = "${course_id}";
</script>
