_inline.html 1.25 KB
Newer Older
Rocky Duan committed
1
<%namespace name="renderer" file="_thread.html"/>
2

Rocky Duan committed
3
<section class="discussion inline-discussion" _id="${discussion_id}">
4
  <div class="discussion-non-content discussion-local">
5
    <div class="search-wrapper-inline search-wrapper">
6
      <%include file="_search_bar.html" />
7 8 9
    </div>
    <div class="discussion-new-post control-button" href="javascript:void(0)">New Post</div>
  </div>
Rocky Duan committed
10
  % if len(threads) == 0:
Brittany Cheng committed
11 12 13
    <div class="blank">
      <%include file="_blank_slate.html" />
    </div>
Rocky Duan committed
14 15
    <div class="threads"></div>
  % else:
Brittany Cheng committed
16
    <%include file="_sort.html" />
Rocky Duan committed
17 18 19 20 21
    <div class="threads">
      % for thread in threads:
        ${renderer.render_thread(course_id, thread, show_comments=False)}
      % endfor
    </div>
Brittany Cheng committed
22
    <%include file="_paginator.html" />
Rocky Duan committed
23
  % endif
24 25 26 27 28 29 30 31 32 33
</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}";
34 35 36 37
  if (typeof $$annotated_content_info === undefined || $$annotated_content_info === null) {
    var $$annotated_content_info = {};
  }
  $$annotated_content_info = $.extend($$annotated_content_info, JSON.parse("${annotated_content_info | escape_quotes}"));
38
</script>