From 80ab2d27a0ea83997498b9aec287a3d6a8e5363d Mon Sep 17 00:00:00 2001 From: Rocky Duan Date: Sun, 19 Aug 2012 10:07:31 -0700 Subject: [PATCH] fixed comment retrieval --- lms/templates/discussion/_ajax_single_thread.html | 4 ++-- lms/templates/discussion/_content_renderer.html | 4 +++- lms/templates/discussion/_single_thread.html | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lms/templates/discussion/_ajax_single_thread.html b/lms/templates/discussion/_ajax_single_thread.html index aa2a5b1a76..ab52a31d94 100644 --- a/lms/templates/discussion/_ajax_single_thread.html +++ b/lms/templates/discussion/_ajax_single_thread.html @@ -1,2 +1,2 @@ -<%namespace name="renderer" file="_thread.html"/> -${renderer.render_comments(thread['children'])} +<%namespace name="renderer" file="_content_renderer.html"/> +${renderer.render_comments(thread.get('children'))} diff --git a/lms/templates/discussion/_content_renderer.html b/lms/templates/discussion/_content_renderer.html index 8834e4b327..88b87da4a2 100644 --- a/lms/templates/discussion/_content_renderer.html +++ b/lms/templates/discussion/_content_renderer.html @@ -7,7 +7,9 @@ <%def name="render_content_with_comments(content)">
${render_content(content)} - ${render_comments(content.get('children', []))} + % if content.get('children') is not None: + ${render_comments(content['children'])} + % endif
diff --git a/lms/templates/discussion/_single_thread.html b/lms/templates/discussion/_single_thread.html index 3f380bcc7a..523945be56 100644 --- a/lms/templates/discussion/_single_thread.html +++ b/lms/templates/discussion/_single_thread.html @@ -1,8 +1,8 @@ -<%namespace name="renderer" file="_thread.html"/> +<%namespace name="renderer" file="_content_renderer.html"/>
Discussion - ${renderer.render_thread(course_id, thread, show_comments=True)} + ${renderer.render_content_with_comments(thread)}
<%include file="_js_data.html" />