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
d4db0ee7
Commit
d4db0ee7
authored
Mar 26, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused methods from comment_client
parent
e1afbe50
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
60 deletions
+0
-60
common/static/coffee/src/discussion/utils.coffee
+0
-1
lms/djangoapps/django_comment_client/base/urls.py
+0
-2
lms/djangoapps/django_comment_client/base/views.py
+0
-21
lms/djangoapps/django_comment_client/forum/views.py
+0
-12
lms/lib/comment_client/comment_client.py
+0
-24
No files found.
common/static/coffee/src/discussion/utils.coffee
View file @
d4db0ee7
...
...
@@ -51,7 +51,6 @@ class @DiscussionUtil
follow_discussion
:
"/courses/
#{
$$course_id
}
/discussion/
#{
param
}
/follow"
unfollow_discussion
:
"/courses/
#{
$$course_id
}
/discussion/
#{
param
}
/unfollow"
create_thread
:
"/courses/
#{
$$course_id
}
/discussion/
#{
param
}
/threads/create"
search_similar_threads
:
"/courses/
#{
$$course_id
}
/discussion/
#{
param
}
/threads/search_similar"
update_thread
:
"/courses/
#{
$$course_id
}
/discussion/threads/
#{
param
}
/update"
create_comment
:
"/courses/
#{
$$course_id
}
/discussion/threads/
#{
param
}
/reply"
delete_thread
:
"/courses/
#{
$$course_id
}
/discussion/threads/
#{
param
}
/delete"
...
...
lms/djangoapps/django_comment_client/base/urls.py
View file @
d4db0ee7
...
...
@@ -25,8 +25,6 @@ urlpatterns = patterns('django_comment_client.base.views', # nopep8
url
(
r'comments/(?P<comment_id>[\w\-]+)/flagAbuse$'
,
'flag_abuse_for_comment'
,
name
=
'flag_abuse_for_comment'
),
url
(
r'comments/(?P<comment_id>[\w\-]+)/unFlagAbuse$'
,
'un_flag_abuse_for_comment'
,
name
=
'un_flag_abuse_for_comment'
),
url
(
r'^(?P<commentable_id>[\w\-.]+)/threads/create$'
,
'create_thread'
,
name
=
'create_thread'
),
# TODO should we search within the board?
url
(
r'^(?P<commentable_id>[\w\-.]+)/threads/search_similar$'
,
'search_similar_threads'
,
name
=
'search_similar_threads'
),
url
(
r'^(?P<commentable_id>[\w\-.]+)/follow$'
,
'follow_commentable'
,
name
=
'follow_commentable'
),
url
(
r'^(?P<commentable_id>[\w\-.]+)/unfollow$'
,
'unfollow_commentable'
,
name
=
'unfollow_commentable'
),
)
lms/djangoapps/django_comment_client/base/views.py
View file @
d4db0ee7
...
...
@@ -521,27 +521,6 @@ def unfollow_user(request, course_id, followed_user_id):
return
JsonResponse
({})
@require_GET
def
search_similar_threads
(
request
,
course_id
,
commentable_id
):
"""
given a course id and commentable id, run query given in text get param
of request
"""
text
=
request
.
GET
.
get
(
'text'
,
None
)
if
text
:
query_params
=
{
'text'
:
text
,
'commentable_id'
:
commentable_id
,
}
threads
=
cc
.
search_similar_threads
(
course_id
,
recursive
=
False
,
query_params
=
query_params
)
else
:
theads
=
[]
context
=
{
'threads'
:
map
(
utils
.
extend_content
,
threads
)}
return
JsonResponse
({
'html'
:
render_to_string
(
'discussion/_similar_posts.html'
,
context
)
})
@require_POST
@login_required
@csrf.csrf_exempt
...
...
lms/djangoapps/django_comment_client/forum/views.py
View file @
d4db0ee7
...
...
@@ -196,12 +196,6 @@ def forum_form_discussion(request, course_id):
'page'
:
query_params
[
'page'
],
})
else
:
#recent_active_threads = cc.search_recent_active_threads(
# course_id,
# recursive=False,
# query_params={'follower_id': request.user.id},
#)
with
newrelic
.
agent
.
FunctionTrace
(
nr_transaction
,
"get_cohort_info"
):
cohorts
=
get_course_cohorts
(
course_id
)
cohorted_commentables
=
get_cohorted_commentables
(
course_id
)
...
...
@@ -283,12 +277,6 @@ def single_thread(request, course_id, discussion_id, thread_id):
threads
=
[
utils
.
safe_content
(
thread
)
for
thread
in
threads
]
#recent_active_threads = cc.search_recent_active_threads(
# course_id,
# recursive=False,
# query_params={'follower_id': request.user.id},
#)
with
newrelic
.
agent
.
FunctionTrace
(
nr_transaction
,
"get_metadata_for_threads"
):
annotated_content_info
=
utils
.
get_metadata_for_threads
(
course_id
,
threads
,
request
.
user
,
user_info
)
...
...
lms/lib/comment_client/comment_client.py
View file @
d4db0ee7
...
...
@@ -4,27 +4,3 @@ from .comment import Comment
from
.thread
import
Thread
from
.user
import
User
from
.commentable
import
Commentable
from
.utils
import
perform_request
import
settings
def
search_similar_threads
(
course_id
,
recursive
=
False
,
query_params
=
{},
*
args
,
**
kwargs
):
default_params
=
{
'course_id'
:
course_id
,
'recursive'
:
recursive
}
attributes
=
dict
(
default_params
.
items
()
+
query_params
.
items
())
return
perform_request
(
'get'
,
_url_for_search_similar_threads
(),
attributes
,
*
args
,
**
kwargs
)
def
search_recent_active_threads
(
course_id
,
recursive
=
False
,
query_params
=
{},
*
args
,
**
kwargs
):
default_params
=
{
'course_id'
:
course_id
,
'recursive'
:
recursive
}
attributes
=
dict
(
default_params
.
items
()
+
query_params
.
items
())
return
perform_request
(
'get'
,
_url_for_search_recent_active_threads
(),
attributes
,
*
args
,
**
kwargs
)
def
_url_for_search_similar_threads
():
return
"{prefix}/search/threads/more_like_this"
.
format
(
prefix
=
settings
.
PREFIX
)
def
_url_for_search_recent_active_threads
():
return
"{prefix}/search/threads/recent_active"
.
format
(
prefix
=
settings
.
PREFIX
)
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