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
daa0cd22
Commit
daa0cd22
authored
Apr 01, 2013
by
Kevin Chugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter implemented for flagged
parent
2f431071
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
4 deletions
+28
-4
common/static/coffee/src/discussion/discussion.coffee
+3
-0
common/static/coffee/src/discussion/utils.coffee
+1
-1
common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
+11
-0
lms/djangoapps/django_comment_client/forum/views.py
+3
-2
lms/lib/comment_client/comment_client.py
+0
-1
lms/lib/comment_client/thread.py
+2
-0
lms/templates/discussion/_filter_dropdown.html
+8
-0
No files found.
common/static/coffee/src/discussion/discussion.coffee
View file @
daa0cd22
...
@@ -37,6 +37,9 @@ if Backbone?
...
@@ -37,6 +37,9 @@ if Backbone?
data
[
'commentable_ids'
]
=
options
.
commentable_ids
data
[
'commentable_ids'
]
=
options
.
commentable_ids
when
'all'
when
'all'
url
=
DiscussionUtil
.
urlFor
'threads'
url
=
DiscussionUtil
.
urlFor
'threads'
when
'flagged'
data
[
'flagged'
]
=
true
url
=
DiscussionUtil
.
urlFor
'search'
when
'followed'
when
'followed'
url
=
DiscussionUtil
.
urlFor
'followed_threads'
,
options
.
user_id
url
=
DiscussionUtil
.
urlFor
'followed_threads'
,
options
.
user_id
if
options
[
'group_id'
]
if
options
[
'group_id'
]
...
...
common/static/coffee/src/discussion/utils.coffee
View file @
daa0cd22
...
@@ -76,7 +76,7 @@ class @DiscussionUtil
...
@@ -76,7 +76,7 @@ class @DiscussionUtil
permanent_link_thread
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/threads/
#{
param1
}
"
permanent_link_thread
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/threads/
#{
param1
}
"
permanent_link_comment
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/threads/
#{
param1
}
#
#{
param2
}
"
permanent_link_comment
:
"/courses/
#{
$$course_id
}
/discussion/forum/
#{
param
}
/threads/
#{
param1
}
#
#{
param2
}
"
user_profile
:
"/courses/
#{
$$course_id
}
/discussion/forum/users/
#{
param
}
"
user_profile
:
"/courses/
#{
$$course_id
}
/discussion/forum/users/
#{
param
}
"
followed_threads
:
"/courses/
#{
$$course_id
}
/discussion/forum/users/
#{
param
}
/followed"
followed_threads
:
"/courses/
#{
$$course_id
}
/discussion/forum/users/
#{
param
}
/followed"
threads
:
"/courses/
#{
$$course_id
}
/discussion/forum"
threads
:
"/courses/
#{
$$course_id
}
/discussion/forum"
}[
name
]
}[
name
]
...
...
common/static/coffee/src/discussion/views/discussion_thread_list_view.coffee
View file @
daa0cd22
...
@@ -276,6 +276,11 @@ if Backbone?
...
@@ -276,6 +276,11 @@ if Backbone?
@
$
(
".post-search-field"
).
val
(
""
)
@
$
(
".post-search-field"
).
val
(
""
)
@
$
(
'.cohort'
).
show
()
@
$
(
'.cohort'
).
show
()
@
retrieveAllThreads
()
@
retrieveAllThreads
()
else
if
discussionId
==
"#flagged"
@
discussionIds
=
""
@
$
(
".post-search-field"
).
val
(
""
)
@
$
(
'.cohort'
).
hide
()
@
retrieveFlaggedThreads
()
else
if
discussionId
==
"#following"
else
if
discussionId
==
"#following"
@
retrieveFollowed
(
event
)
@
retrieveFollowed
(
event
)
@
$
(
'.cohort'
).
hide
()
@
$
(
'.cohort'
).
hide
()
...
@@ -321,6 +326,12 @@ if Backbone?
...
@@ -321,6 +326,12 @@ if Backbone?
@
collection
.
reset
()
@
collection
.
reset
()
@
loadMorePages
(
event
)
@
loadMorePages
(
event
)
retrieveFlaggedThreads
:
(
event
)
->
@
collection
.
current_page
=
0
@
collection
.
reset
()
@
mode
=
'flagged'
@
loadMorePages
(
event
)
sortThreads
:
(
event
)
->
sortThreads
:
(
event
)
->
@
$
(
".sort-bar a"
).
removeClass
(
"active"
)
@
$
(
".sort-bar a"
).
removeClass
(
"active"
)
$
(
event
.
target
).
addClass
(
"active"
)
$
(
event
.
target
).
addClass
(
"active"
)
...
...
lms/djangoapps/django_comment_client/forum/views.py
View file @
daa0cd22
...
@@ -42,7 +42,7 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG
...
@@ -42,7 +42,7 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG
'course_id'
:
course_id
,
'course_id'
:
course_id
,
'user_id'
:
request
.
user
.
id
,
'user_id'
:
request
.
user
.
id
,
}
}
if
not
request
.
GET
.
get
(
'sort_key'
):
if
not
request
.
GET
.
get
(
'sort_key'
):
# If the user did not select a sort key, use their last used sort key
# If the user did not select a sort key, use their last used sort key
cc_user
=
cc
.
User
.
from_django_user
(
request
.
user
)
cc_user
=
cc
.
User
.
from_django_user
(
request
.
user
)
...
@@ -79,7 +79,7 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG
...
@@ -79,7 +79,7 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG
strip_none
(
extract
(
request
.
GET
,
strip_none
(
extract
(
request
.
GET
,
[
'page'
,
'sort_key'
,
[
'page'
,
'sort_key'
,
'sort_order'
,
'text'
,
'sort_order'
,
'text'
,
'tags'
,
'commentable_ids'
])))
'tags'
,
'commentable_ids'
,
'flagged'
])))
threads
,
page
,
num_pages
=
cc
.
Thread
.
search
(
query_params
)
threads
,
page
,
num_pages
=
cc
.
Thread
.
search
(
query_params
)
...
@@ -218,6 +218,7 @@ def forum_form_discussion(request, course_id):
...
@@ -218,6 +218,7 @@ def forum_form_discussion(request, course_id):
'threads'
:
saxutils
.
escape
(
json
.
dumps
(
threads
),
escapedict
),
'threads'
:
saxutils
.
escape
(
json
.
dumps
(
threads
),
escapedict
),
'thread_pages'
:
query_params
[
'num_pages'
],
'thread_pages'
:
query_params
[
'num_pages'
],
'user_info'
:
saxutils
.
escape
(
json
.
dumps
(
user_info
),
escapedict
),
'user_info'
:
saxutils
.
escape
(
json
.
dumps
(
user_info
),
escapedict
),
'flag_moderator'
:
cached_has_permission
(
request
.
user
,
'openclose_thread'
,
course
.
id
),
'annotated_content_info'
:
saxutils
.
escape
(
json
.
dumps
(
annotated_content_info
),
escapedict
),
'annotated_content_info'
:
saxutils
.
escape
(
json
.
dumps
(
annotated_content_info
),
escapedict
),
'course_id'
:
course
.
id
,
'course_id'
:
course
.
id
,
'category_map'
:
category_map
,
'category_map'
:
category_map
,
...
...
lms/lib/comment_client/comment_client.py
View file @
daa0cd22
...
@@ -29,7 +29,6 @@ def search_trending_tags(course_id, query_params={}, *args, **kwargs):
...
@@ -29,7 +29,6 @@ def search_trending_tags(course_id, query_params={}, *args, **kwargs):
def
tags_autocomplete
(
value
,
*
args
,
**
kwargs
):
def
tags_autocomplete
(
value
,
*
args
,
**
kwargs
):
return
perform_request
(
'get'
,
_url_for_threads_tags_autocomplete
(),
{
'value'
:
value
},
*
args
,
**
kwargs
)
return
perform_request
(
'get'
,
_url_for_threads_tags_autocomplete
(),
{
'value'
:
value
},
*
args
,
**
kwargs
)
def
_url_for_search_similar_threads
():
def
_url_for_search_similar_threads
():
return
"{prefix}/search/threads/more_like_this"
.
format
(
prefix
=
settings
.
PREFIX
)
return
"{prefix}/search/threads/more_like_this"
.
format
(
prefix
=
settings
.
PREFIX
)
...
...
lms/lib/comment_client/thread.py
View file @
daa0cd22
...
@@ -33,6 +33,7 @@ class Thread(models.Model):
...
@@ -33,6 +33,7 @@ class Thread(models.Model):
'course_id'
:
query_params
[
'course_id'
],
'course_id'
:
query_params
[
'course_id'
],
'recursive'
:
False
}
'recursive'
:
False
}
params
=
merge_dict
(
default_params
,
strip_blank
(
strip_none
(
query_params
)))
params
=
merge_dict
(
default_params
,
strip_blank
(
strip_none
(
query_params
)))
if
query_params
.
get
(
'text'
)
or
query_params
.
get
(
'tags'
)
or
query_params
.
get
(
'commentable_ids'
):
if
query_params
.
get
(
'text'
)
or
query_params
.
get
(
'tags'
)
or
query_params
.
get
(
'commentable_ids'
):
url
=
cls
.
url
(
action
=
'search'
)
url
=
cls
.
url
(
action
=
'search'
)
else
:
else
:
...
@@ -55,6 +56,7 @@ class Thread(models.Model):
...
@@ -55,6 +56,7 @@ class Thread(models.Model):
@classmethod
@classmethod
def
url
(
cls
,
action
,
params
=
{}):
def
url
(
cls
,
action
,
params
=
{}):
if
action
in
[
'get_all'
,
'post'
]:
if
action
in
[
'get_all'
,
'post'
]:
return
cls
.
url_for_threads
(
params
)
return
cls
.
url_for_threads
(
params
)
elif
action
==
'search'
:
elif
action
==
'search'
:
...
...
lms/templates/discussion/_filter_dropdown.html
View file @
daa0cd22
...
@@ -33,6 +33,14 @@
...
@@ -33,6 +33,14 @@
<span
class=
"board-name"
data-discussion_id=
'#all'
>
Show All Discussions
</span>
<span
class=
"board-name"
data-discussion_id=
'#all'
>
Show All Discussions
</span>
</a>
</a>
</li>
</li>
%if flag_moderator:
<li>
<a
href=
"#"
>
<span
class=
"board-name"
data-discussion_id=
'#flagged'
>
Show Flagged Discussions
</span>
</a>
</li>
%endif
<li>
<li>
<a
href=
"#"
>
<a
href=
"#"
>
<span
class=
"board-name"
data-discussion_id=
'#following'
>
Following
</span>
<span
class=
"board-name"
data-discussion_id=
'#following'
>
Following
</span>
...
...
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