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
de7c5113
Commit
de7c5113
authored
Apr 05, 2013
by
Kevin Chugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flagging working again
parent
0e8ef283
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
10 additions
and
11 deletions
+10
-11
common/static/coffee/src/discussion/views/discussion_content_view.coffee
+1
-1
common/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
+1
-1
common/static/coffee/src/discussion/views/response_comment_show_view.coffee
+1
-1
common/static/coffee/src/discussion/views/thread_response_show_view.coffee
+1
-1
lms/djangoapps/django_comment_client/forum/views.py
+1
-2
lms/djangoapps/django_comment_client/utils.py
+2
-2
lms/lib/comment_client/comment.py
+1
-1
lms/lib/comment_client/thread.py
+2
-2
No files found.
common/static/coffee/src/discussion/views/discussion_content_view.coffee
View file @
de7c5113
...
...
@@ -109,7 +109,7 @@ if Backbone?
toggleFlagAbuse
:
(
event
)
->
event
.
preventDefault
()
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
@
unFlagAbuse
()
else
@
flagAbuse
()
...
...
common/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
View file @
de7c5113
...
...
@@ -46,7 +46,7 @@ if Backbone?
@
$
(
"[data-role=discussion-vote]"
).
removeClass
(
"is-cast"
)
renderFlagged
:
=>
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
@
model
.
get
(
"show_any_flag"
)
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
@
$
(
"[data-role=thread-flag]"
).
addClass
(
"flagged"
)
@
$
(
"[data-role=thread-flag]"
).
removeClass
(
"notflagged"
)
@
$
(
".discussion-flag-abuse .flag-label"
).
html
(
"Misuse Reported"
)
...
...
common/static/coffee/src/discussion/views/response_comment_show_view.coffee
View file @
de7c5113
...
...
@@ -45,7 +45,7 @@ if Backbone?
renderFlagged
:
=>
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
@
$
(
"[data-role=thread-flag]"
).
addClass
(
"flagged"
)
@
$
(
"[data-role=thread-flag]"
).
removeClass
(
"notflagged"
)
else
...
...
common/static/coffee/src/discussion/views/thread_response_show_view.coffee
View file @
de7c5113
...
...
@@ -98,7 +98,7 @@ if Backbone?
renderFlagged
:
=>
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
or
(
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
@
$
(
"[data-role=thread-flag]"
).
addClass
(
"flagged"
)
@
$
(
"[data-role=thread-flag]"
).
removeClass
(
"notflagged"
)
@
$
(
".discussion-flag-abuse .flag-label"
).
html
(
"Misuse Reported"
)
...
...
lms/djangoapps/django_comment_client/forum/views.py
View file @
de7c5113
...
...
@@ -96,7 +96,7 @@ def get_threads(request, course_id, discussion_id=None, per_page=THREADS_PER_PAG
#patch for backward compatibility to comments service
if
not
'pinned'
in
thread
:
thread
[
'pinned'
]
=
False
query_params
[
'page'
]
=
page
query_params
[
'num_pages'
]
=
num_pages
...
...
@@ -242,7 +242,6 @@ def single_thread(request, course_id, discussion_id, thread_id):
try
:
thread
=
cc
.
Thread
.
find
(
thread_id
)
.
retrieve
(
recursive
=
True
,
user_id
=
request
.
user
.
id
)
thread
[
'show_any_flag'
]
=
cached_has_permission
(
request
.
user
,
'openclose_thread'
,
course
.
id
)
and
thread
[
'abuse_flaggers'
]
and
len
(
thread
[
'abuse_flaggers'
])
>
0
except
(
cc
.
utils
.
CommentClientError
,
cc
.
utils
.
CommentClientUnknownError
)
as
err
:
log
.
error
(
"Error loading single thread."
)
raise
Http404
...
...
lms/djangoapps/django_comment_client/utils.py
View file @
de7c5113
...
...
@@ -409,8 +409,8 @@ def safe_content(content):
'updated_at'
,
'depth'
,
'type'
,
'commentable_id'
,
'comments_count'
,
'at_position_list'
,
'children'
,
'highlighted_title'
,
'highlighted_body'
,
'courseware_title'
,
'courseware_url'
,
'tags'
,
'unread_comments_count'
,
'read'
,
'group_id'
,
'group_name'
,
'group_string'
,
'pinned'
,
'abuse_flaggers'
,
'show_any_flag'
'read'
,
'group_id'
,
'group_name'
,
'group_string'
,
'pinned'
,
'abuse_flaggers'
]
if
(
content
.
get
(
'anonymous'
)
is
False
)
and
(
content
.
get
(
'anonymous_to_peers'
)
is
False
):
...
...
lms/lib/comment_client/comment.py
View file @
de7c5113
...
...
@@ -11,7 +11,7 @@ class Comment(models.Model):
'id'
,
'body'
,
'anonymous'
,
'anonymous_to_peers'
,
'course_id'
,
'endorsed'
,
'parent_id'
,
'thread_id'
,
'username'
,
'votes'
,
'user_id'
,
'closed'
,
'created_at'
,
'updated_at'
,
'depth'
,
'at_position_list'
,
'type'
,
'commentable_id'
,
'abuse_flaggers'
,
'show_any_flag'
'type'
,
'commentable_id'
,
'abuse_flaggers'
]
updatable_fields
=
[
...
...
lms/lib/comment_client/thread.py
View file @
de7c5113
...
...
@@ -10,8 +10,8 @@ class Thread(models.Model):
'closed'
,
'tags'
,
'votes'
,
'commentable_id'
,
'username'
,
'user_id'
,
'created_at'
,
'updated_at'
,
'comments_count'
,
'unread_comments_count'
,
'at_position_list'
,
'children'
,
'type'
,
'highlighted_title'
,
'highlighted_body'
,
'endorsed'
,
'read'
,
'group_id'
,
'group_name'
,
'pinned'
,
'abuse_flaggers'
,
'show_any_flag'
'highlighted_body'
,
'endorsed'
,
'read'
,
'group_id'
,
'group_name'
,
'pinned'
,
'abuse_flaggers'
]
updatable_fields
=
[
...
...
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