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
24095679
Commit
24095679
authored
Apr 05, 2013
by
Kevin Chugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add back comment response flagging
parent
de7c5113
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
3 deletions
+12
-3
common/static/coffee/src/discussion/views/discussion_content_view.coffee
+4
-0
common/static/coffee/src/discussion/views/thread_response_show_view.coffee
+1
-1
lms/djangoapps/django_comment_client/base/views.py
+2
-1
lms/lib/comment_client/comment.py
+5
-1
No files found.
common/static/coffee/src/discussion/views/discussion_content_view.coffee
View file @
24095679
...
...
@@ -139,4 +139,8 @@ if Backbone?
if
textStatus
==
'success'
temp_array
=
_
.
clone
(
@
model
.
get
(
'abuse_flaggers'
));
temp_array
.
pop
(
window
.
user
.
id
)
# if you're an admin, clear this
if
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
temp_array
=
[]
@
model
.
set
(
'abuse_flaggers'
,
temp_array
)
common/static/coffee/src/discussion/views/thread_response_show_view.coffee
View file @
24095679
...
...
@@ -98,7 +98,7 @@ if Backbone?
renderFlagged
:
=>
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
or
(
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
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"
)
...
...
lms/djangoapps/django_comment_client/base/views.py
View file @
24095679
...
...
@@ -309,8 +309,9 @@ def flag_abuse_for_comment(request, course_id, comment_id):
def
un_flag_abuse_for_comment
(
request
,
course_id
,
comment_id
):
user
=
cc
.
User
.
from_django_user
(
request
.
user
)
removeAll
=
cached_has_permission
(
request
.
user
,
'openclose_thread'
,
course_id
)
comment
=
cc
.
Comment
.
find
(
comment_id
)
comment
.
unFlagAbuse
(
user
,
comment
)
comment
.
unFlagAbuse
(
user
,
comment
,
removeAll
)
return
JsonResponse
(
utils
.
safe_content
(
comment
.
to_dict
()))
@require_POST
...
...
lms/lib/comment_client/comment.py
View file @
24095679
...
...
@@ -53,7 +53,7 @@ class Comment(models.Model):
request
=
perform_request
(
'put'
,
url
,
params
)
voteable
.
update_attributes
(
request
)
def
unFlagAbuse
(
self
,
user
,
voteable
):
def
unFlagAbuse
(
self
,
user
,
voteable
,
removeAll
):
if
voteable
.
type
==
'thread'
:
url
=
_url_for_unflag_abuse_thread
(
voteable
.
id
)
elif
voteable
.
type
==
'comment'
:
...
...
@@ -61,6 +61,10 @@ class Comment(models.Model):
else
:
raise
CommentClientError
(
"Can flag/unflag for threads or comments"
)
params
=
{
'user_id'
:
user
.
id
}
if
removeAll
:
params
[
'all'
]
=
True
request
=
perform_request
(
'put'
,
url
,
params
)
voteable
.
update_attributes
(
request
)
...
...
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