diff --git a/lms/djangoapps/django_comment_client/forum/views.py b/lms/djangoapps/django_comment_client/forum/views.py
index 0de42a1e82..e876561ce0 100644
--- a/lms/djangoapps/django_comment_client/forum/views.py
+++ b/lms/djangoapps/django_comment_client/forum/views.py
@@ -136,16 +136,16 @@ def get_annotated_content_info(content, user, is_thread):
'can_delete': check_permissions_by_view(user, content, "delete_thread" if is_thread else "delete_comment"),
}
-def get_annotated_content_infos(thread, user):
+def get_annotated_content_infos(thread, user, is_thread=True):
infos = {}
- def _annotate(content, is_thread=True):
+ def _annotate(content, is_thread=is_thread):
infos[str(content['id'])] = get_annotated_content_info(content, user, is_thread)
for child in content.get('children', []):
_annotate(child, is_thread=False)
_annotate(thread)
return infos
-def render_single_thread(request, course_id, thread_id):
+def render_single_thread(request, discussion_id, course_id, thread_id):
thread = comment_client.get_thread(thread_id, recursive=True)
@@ -153,6 +153,7 @@ def render_single_thread(request, course_id, thread_id):
user=request.user, is_thread=True)
context = {
+ 'discussion_id': discussion_id,
'thread': thread,
'user_info': comment_client.get_user_info(request.user.id, raw=True),
'annotated_content_info': json.dumps(annotated_content_info),
@@ -179,9 +180,10 @@ def single_thread(request, course_id, discussion_id, thread_id):
course = check_course(course_id)
context = {
+ 'discussion_id': discussion_id,
'csrf': csrf(request)['csrf_token'],
'init': '',
- 'content': render_single_thread(request, course_id, thread_id),
+ 'content': render_single_thread(request, discussion_id, course_id, thread_id),
'accordion': render_accordion(request, course, discussion_id),
'course': course,
}
diff --git a/lms/templates/discussion/_thread.html b/lms/templates/discussion/_thread.html
index 573142083c..692cb41d9b 100644
--- a/lms/templates/discussion/_thread.html
+++ b/lms/templates/discussion/_thread.html
@@ -87,6 +87,10 @@
${render_link("discussion-link discussion-reply discussion-reply-" + type, "Reply")}
${render_link("discussion-link discussion-edit", "Edit")}
+ % if type == "thread":
+ Permanent Link
+ % endif
+
% if content.get('endorsed', False):