<%! from django.utils.translation import ugettext as _ %>
<%! from django_comment_client.permissions import has_permission %>

<%namespace name='static' file='../static_content.html'/>

<%block name="js_extra">
    <%static:js group='discussion' raw='true'/>
</%block>

<%block name="css_extra">
    <%static:css group='discussion' raw='true'/>
</%block>

<div class="discussion-course">

  % if enable_new_post_btn and has_permission(user, "create_thread", course_id):
  <div class="discussion-course-new right">
    <a href="#" class="new-post-btn" role="button"><span class="icon icon-edit new-post-icon"></span>${_("New Post")}</a>
  </div>

  <div style="display: block; clear: both; height: 1px;"></div>
  % endif

  <section class="discussion container" id="discussion-container"
           data-roles="${roles}"
           data-course-id="${course_id}"
           data-user-info="${user_info}"
           data-threads="${threads}"
           data-thread-pages="${thread_pages}"
           data-content-info="${annotated_content_info}"
           data-sort-preference="${sort_preference}"
           data-flag-moderator="${flag_moderator}"
           data-user-cohort-id="${user_cohort}"
           data-course-settings="${course_settings}">
    <div class="discussion-body">
      <div class="forum-nav"></div>
      <div class="discussion-column">
        <article class="new-post-article" style="display: none"></article>
        <div class="forum-content"></div>
      </div>
    </div>
  </section>

  <%include file="_underscore_templates.html" />
  <%include file="_thread_list_template.html" />

</div>
