Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a8beb2a8
Commit
a8beb2a8
authored
Sep 10, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add context link to threads rendered via AJAX.
parent
ca8b2997
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
lms/djangoapps/django_comment_client/forum/views.py
+5
-3
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
a8beb2a8
...
...
@@ -265,22 +265,24 @@ def render_single_thread(request, discussion_id, course_id, thread_id):
def
single_thread
(
request
,
course_id
,
discussion_id
,
thread_id
):
if
request
.
is_ajax
():
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
user_info
=
cc
.
User
.
from_django_user
(
request
.
user
)
.
to_dict
()
try
:
thread
=
cc
.
Thread
.
find
(
thread_id
)
.
retrieve
(
recursive
=
True
)
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
raise
Http404
courseware_context
=
get_courseware_context
(
thread
,
course
)
annotated_content_info
=
utils
.
get_annotated_content_infos
(
course_id
,
thread
,
request
.
user
,
user_info
=
user_info
)
context
=
{
'thread'
:
thread
.
to_dict
(),
'course_id'
:
course_id
}
# TODO: Remove completely or switch back to server side rendering
html
=
render_to_string
(
'discussion/_ajax_single_thread.html'
,
context
)
content
=
utils
.
safe_content
(
thread
.
to_dict
())
content
.
update
(
courseware_context
)
return
utils
.
JsonResponse
({
'html'
:
html
,
'content'
:
utils
.
safe_content
(
thread
.
to_dict
())
,
'content'
:
content
,
'annotated_content_info'
:
annotated_content_info
,
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment