diff --git a/lms/djangoapps/django_comment_client/utils.py b/lms/djangoapps/django_comment_client/utils.py index ead9bc9999..305f3d0929 100644 --- a/lms/djangoapps/django_comment_client/utils.py +++ b/lms/djangoapps/django_comment_client/utils.py @@ -342,4 +342,8 @@ def safe_content(content): if (content.get('anonymous') is False) and (content.get('anonymous_to_peers') is False): fields += ['username', 'user_id'] + if 'children' in content: + safe_children = [safe_content(child) for child in content['children']] + content['children'] = safe_children + return strip_none(extract(content, fields)) diff --git a/lms/static/coffee/src/discussion/views/response_comment_show_view.coffee b/lms/static/coffee/src/discussion/views/response_comment_show_view.coffee index d0de32bd7a..7ae8f779c5 100644 --- a/lms/static/coffee/src/discussion/views/response_comment_show_view.coffee +++ b/lms/static/coffee/src/discussion/views/response_comment_show_view.coffee @@ -19,7 +19,8 @@ if Backbone? addReplyLink: () -> if @model.hasOwnProperty('parent') - html = "@#{@model.parent.get('username')}: " + name = @model.parent.get('username') ? "anonymous" + html = "@#{name}: " p = @$('.response-body p:first') p.prepend(html) diff --git a/lms/static/sass/_discussion.scss b/lms/static/sass/_discussion.scss index 7a697923d9..78bda06442 100644 --- a/lms/static/sass/_discussion.scss +++ b/lms/static/sass/_discussion.scss @@ -1702,6 +1702,12 @@ body.discussion { background: #f6f6f6 !important; border-radius: 3px; + header { + .anonymous{ + font-size: 15px; + } + } + .responses { margin-top: 40px; diff --git a/lms/templates/discussion/_underscore_templates.html b/lms/templates/discussion/_underscore_templates.html index 69a3bac1ed..bf1eb596d4 100644 --- a/lms/templates/discussion/_underscore_templates.html +++ b/lms/templates/discussion/_underscore_templates.html @@ -93,7 +93,9 @@
${"<%- votes['up_count'] %>"} - ${"<%- username %>"} + ${"<% if (obj.username) { %>"} + ${'<%- username %>'} + ${"<% } else {print('anonymous');} %>"}

${'<%- created_at %>'}

${"<%- body %>"}
@@ -121,7 +123,11 @@
${'<%- body %>'}
-

–posted ${'<%- created_at %>'} by ${'<%- username %>'}

+

–posted ${'<%- created_at %>'} by + ${"<% if (obj.username) { %>"} + ${'<%- username %>'} + ${"<% } else {print('anonymous');} %>"} +