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
8b7940f4
Commit
8b7940f4
authored
Sep 11, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed context links after searching for real, and removed some more dead code.
parent
8f776ab2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
9 deletions
+15
-9
lms/djangoapps/django_comment_client/forum/views.py
+9
-4
lms/djangoapps/django_comment_client/utils.py
+1
-0
lms/static/coffee/src/discussion/utils.coffee
+1
-5
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+4
-0
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
8b7940f4
...
...
@@ -49,7 +49,6 @@ def render_accordion(request, course, discussion_id):
return
render_to_string
(
'discussion/_accordion.html'
,
context
)
def
render_discussion
(
request
,
course_id
,
threads
,
*
args
,
**
kwargs
):
discussion_id
=
kwargs
.
get
(
'discussion_id'
)
user_id
=
kwargs
.
get
(
'user_id'
)
discussion_type
=
kwargs
.
get
(
'discussion_type'
,
'inline'
)
...
...
@@ -182,13 +181,13 @@ def inline_discussion(request, course_id, discussion_id):
def
forum_form_discussion
(
request
,
course_id
):
"""
Renders the main Discussion page
Renders the main Discussion page
, potentially filtered by a search query
"""
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
category_map
=
utils
.
get_discussion_category_map
(
course
)
try
:
unsafethreads
,
query_params
=
get_threads
(
request
,
course_id
)
unsafethreads
,
query_params
=
get_threads
(
request
,
course_id
)
# This might process a search query
threads
=
[
utils
.
safe_content
(
thread
)
for
thread
in
unsafethreads
]
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
raise
Http404
...
...
@@ -201,11 +200,16 @@ def forum_form_discussion(request, course_id):
return
utils
.
get_annotated_content_infos
(
course_id
,
thread
,
request
.
user
,
user_info
)
annotated_content_info
=
reduce
(
merge_dict
,
map
(
infogetter
,
threads
),
{})
for
thread
in
threads
:
courseware_context
=
get_courseware_context
(
thread
,
course
)
if
courseware_context
:
thread
[
'courseware_location'
]
=
courseware_context
[
'courseware_location'
]
thread
[
'courseware_title'
]
=
courseware_context
[
'courseware_title'
]
if
request
.
is_ajax
():
return
utils
.
JsonResponse
({
#'html': content,
'discussion_data'
:
threads
,
'annotated_content_info'
:
annotated_content_info
,
})
else
:
#recent_active_threads = cc.search_recent_active_threads(
...
...
@@ -217,6 +221,7 @@ def forum_form_discussion(request, course_id):
#trending_tags = cc.search_trending_tags(
# course_id,
#)
escapedict
=
{
'"'
:
'"'
}
context
=
{
'csrf'
:
csrf
(
request
)[
'csrf_token'
],
...
...
lms/djangoapps/django_comment_client/utils.py
View file @
8b7940f4
...
...
@@ -273,6 +273,7 @@ def safe_content(content):
'created_at'
,
'updated_at'
,
'depth'
,
'type'
,
'commentable_id'
,
'comments_count'
,
'at_position_list'
,
'children'
,
'highlighted_title'
,
'highlighted_body'
,
'courseware_title'
,
'courseware_location'
]
if
content
.
get
(
'anonymous'
)
is
False
:
...
...
lms/static/coffee/src/discussion/utils.coffee
View file @
8b7940f4
...
...
@@ -15,13 +15,9 @@ class @DiscussionUtil
@
getTemplate
:
(
id
)
->
$
(
"script#
#{
id
}
"
).
html
()
@
addContent
:
(
id
,
content
)
->
window
.
$
$contents
[
id
]
=
content
@
getContent
:
(
id
)
->
window
.
$
$contents
[
id
]
@
bulkUpdateContentInfo
:
(
infos
)
->
for
id
,
info
of
infos
@
getContent
(
id
).
updateInfo
(
info
)
Content
.
getContent
(
id
).
updateInfo
(
info
)
@
generateDiscussionLink
:
(
cls
,
txt
,
handler
)
->
$
(
"<a>"
).
addClass
(
"discussion-link"
)
...
...
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
8b7940f4
...
...
@@ -229,6 +229,10 @@ if Backbone?
success
:
(
response
,
textStatus
)
=>
if
textStatus
==
'success'
@
collection
.
reset
(
response
.
discussion_data
)
Content
.
loadContentInfos
(
response
.
content_info
)
# TODO: Perhaps reload user info so that votes can be updated.
# In the future we might not load all of a user's votes at once
# so this would probably be necessary anyway
@
displayedCollection
.
reset
(
@
collection
.
models
)
setActiveItem
:
(
event
)
->
...
...
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