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
384f0191
Commit
384f0191
authored
Sep 27, 2012
by
Ibrahim Awwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename discussion_data to threads.
parent
afb2e3b7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
14 deletions
+8
-14
lms/djangoapps/django_comment_client/forum/views.py
+3
-9
lms/static/coffee/src/discussion/discussion.coffee
+1
-1
lms/static/coffee/src/discussion/discussion_module_view.coffee
+2
-2
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+2
-2
No files found.
lms/djangoapps/django_comment_client/forum/views.py
View file @
384f0191
...
@@ -139,7 +139,7 @@ def forum_form_discussion(request, course_id):
...
@@ -139,7 +139,7 @@ def forum_form_discussion(request, course_id):
if
request
.
is_ajax
():
if
request
.
is_ajax
():
return
utils
.
JsonResponse
({
return
utils
.
JsonResponse
({
'
discussion_data'
:
context
[
'threads'
],
# TODO: Standardize on 'discussion_data' vs 'threads'
'
threads'
:
context
[
'threads'
],
'annotated_content_info'
:
context
[
'annotated_content_info'
],
'annotated_content_info'
:
context
[
'annotated_content_info'
],
'num_pages'
:
query_params
[
'num_pages'
],
'num_pages'
:
query_params
[
'num_pages'
],
'page'
:
query_params
[
'page'
],
'page'
:
query_params
[
'page'
],
...
@@ -218,7 +218,7 @@ def user_profile(request, course_id, user_id):
...
@@ -218,7 +218,7 @@ def user_profile(request, course_id, user_id):
if
request
.
is_ajax
():
if
request
.
is_ajax
():
return
utils
.
JsonResponse
({
return
utils
.
JsonResponse
({
'
discussion_data
'
:
context
[
'threads'
],
'
threads
'
:
context
[
'threads'
],
'page'
:
page
,
'page'
:
page
,
'num_pages'
:
num_pages
,
'num_pages'
:
num_pages
,
'annotated_content_info'
:
context
[
'annotated_content_info'
],
'annotated_content_info'
:
context
[
'annotated_content_info'
],
...
@@ -252,13 +252,7 @@ def followed_threads(request, course_id, user_id):
...
@@ -252,13 +252,7 @@ def followed_threads(request, course_id, user_id):
threads
,
page
,
num_pages
=
profiled_user
.
subscribed_threads
(
query_params
)
threads
,
page
,
num_pages
=
profiled_user
.
subscribed_threads
(
query_params
)
context
=
threads_context
(
request
.
user
,
threads
,
course_id
,
page
,
num_pages
)
context
=
threads_context
(
request
.
user
,
threads
,
course_id
,
page
,
num_pages
)
#return utils.JsonResponse(extract(context, ['annotated_content_info', 'threads', 'page', 'num_pages']))
return
utils
.
JsonResponse
(
extract
(
context
,
[
'annotated_content_info'
,
'threads'
,
'page'
,
'num_pages'
]))
return
utils
.
JsonResponse
({
'annotated_content_info'
:
context
[
'annotated_content_info'
],
'discussion_data'
:
context
[
'threads'
],
'page'
:
page
,
'num_pages'
:
num_pages
,
})
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
raise
Http404
raise
Http404
lms/static/coffee/src/discussion/discussion.coffee
View file @
384f0191
...
@@ -66,7 +66,7 @@ if Backbone?
...
@@ -66,7 +66,7 @@ if Backbone?
dataType
:
'json'
dataType
:
'json'
success
:
(
response
,
textStatus
)
=>
success
:
(
response
,
textStatus
)
=>
models
=
@
models
models
=
@
models
new_threads
=
[
new
Thread
(
data
)
for
data
in
response
.
discussion_data
][
0
]
new_threads
=
[
new
Thread
(
data
)
for
data
in
response
.
threads
][
0
]
new_collection
=
_
.
union
(
models
,
new_threads
)
new_collection
=
_
.
union
(
models
,
new_threads
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
@
reset
new_collection
@
reset
new_collection
...
...
lms/static/coffee/src/discussion/discussion_module_view.coffee
View file @
384f0191
...
@@ -72,8 +72,8 @@ if Backbone?
...
@@ -72,8 +72,8 @@ if Backbone?
allow_anonymous_to_peers
=
response
.
allow_anonymous_to_peers
allow_anonymous_to_peers
=
response
.
allow_anonymous_to_peers
# $elem.html("Hide Discussion")
# $elem.html("Hide Discussion")
@
discussion
=
new
Discussion
()
@
discussion
=
new
Discussion
()
@
discussion
.
reset
(
response
.
discussion_data
,
{
silent
:
false
})
@
discussion
.
reset
(
response
.
threads
,
{
silent
:
false
})
$discussion
=
$
(
Mustache
.
render
$
(
"script#_inline_discussion"
).
html
(),
{
'threads'
:
response
.
discussion_data
,
'discussionId'
:
discussionId
,
'allow_anonymous_to_peers'
:
allow_anonymous_to_peers
,
'allow_anonymous'
:
allow_anonymous
})
$discussion
=
$
(
Mustache
.
render
$
(
"script#_inline_discussion"
).
html
(),
{
'threads'
:
response
.
threads
,
'discussionId'
:
discussionId
,
'allow_anonymous_to_peers'
:
allow_anonymous_to_peers
,
'allow_anonymous'
:
allow_anonymous
})
if
@
$
(
'section.discussion'
).
length
if
@
$
(
'section.discussion'
).
length
@
$
(
'section.discussion'
).
replaceWith
(
$discussion
)
@
$
(
'section.discussion'
).
replaceWith
(
$discussion
)
else
else
...
...
lms/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
384f0191
...
@@ -274,7 +274,7 @@ if Backbone?
...
@@ -274,7 +274,7 @@ if Backbone?
success
:
(
response
,
textStatus
)
=>
success
:
(
response
,
textStatus
)
=>
@
collection
.
current_page
=
response
.
page
@
collection
.
current_page
=
response
.
page
@
collection
.
pages
=
response
.
num_pages
@
collection
.
pages
=
response
.
num_pages
@
collection
.
reset
(
response
.
discussion_data
)
@
collection
.
reset
(
response
.
threads
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
@
displayedCollection
.
reset
(
@
collection
.
models
)
# Don't think this is necessary because it's called on collection.reset
@
displayedCollection
.
reset
(
@
collection
.
models
)
# Don't think this is necessary because it's called on collection.reset
if
callback
?
if
callback
?
...
@@ -337,7 +337,7 @@ if Backbone?
...
@@ -337,7 +337,7 @@ if Backbone?
success
:
(
response
,
textStatus
)
=>
success
:
(
response
,
textStatus
)
=>
if
textStatus
==
'success'
if
textStatus
==
'success'
# TODO: Augment existing collection?
# TODO: Augment existing collection?
@
collection
.
reset
(
response
.
discussion_data
)
@
collection
.
reset
(
response
.
threads
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
Content
.
loadContentInfos
(
response
.
annotated_content_info
)
@
collection
.
current_page
=
response
.
page
@
collection
.
current_page
=
response
.
page
@
collection
.
pages
=
response
.
num_pages
@
collection
.
pages
=
response
.
num_pages
...
...
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