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
649578ea
Commit
649578ea
authored
Apr 21, 2013
by
Kevin Chugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unify flag moderator permissions
parent
0a627bb5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
9 deletions
+14
-9
common/static/coffee/src/discussion/utils.coffee
+4
-0
common/static/coffee/src/discussion/views/discussion_content_view.coffee
+2
-2
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
-1
lms/lib/comment_client/thread.py
+2
-1
lms/templates/discussion/index.html
+1
-1
lms/templates/discussion/single_thread.html
+1
-1
No files found.
common/static/coffee/src/discussion/utils.coffee
View file @
649578ea
...
...
@@ -18,8 +18,12 @@ class @DiscussionUtil
@
loadRoles
:
(
roles
)
->
@
roleIds
=
roles
@
loadFlagModerator
:
(
what
)
->
@
isFlagModerator
=
what
@
loadRolesFromContainer
:
->
@
loadRoles
(
$
(
"#discussion-container"
).
data
(
"roles"
))
@
loadFlagModerator
(
$
(
"#discussion-container"
).
data
(
"flag-moderator"
))
@
isStaff
:
(
user_id
)
->
staff
=
_
.
union
(
@
roleIds
[
'Staff'
],
@
roleIds
[
'Moderator'
],
@
roleIds
[
'Administrator'
])
...
...
common/static/coffee/src/discussion/views/discussion_content_view.coffee
View file @
649578ea
...
...
@@ -109,7 +109,7 @@ if Backbone?
toggleFlagAbuse
:
(
event
)
->
event
.
preventDefault
()
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
is
Staff
(
@
model
.
get
(
"user_id"
))
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
is
FlagModerator
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
@
unFlagAbuse
()
else
@
flagAbuse
()
...
...
@@ -140,7 +140,7 @@ if Backbone?
temp_array
=
_
.
clone
(
@
model
.
get
(
'abuse_flaggers'
));
temp_array
.
pop
(
window
.
user
.
id
)
# if you're an admin, clear this
if
DiscussionUtil
.
is
Staff
(
@
model
.
get
(
"user_id"
))
if
DiscussionUtil
.
is
FlagModerator
temp_array
=
[]
@
model
.
set
(
'abuse_flaggers'
,
temp_array
)
common/static/coffee/src/discussion/views/discussion_thread_show_view.coffee
View file @
649578ea
...
...
@@ -46,7 +46,7 @@ if Backbone?
@
$
(
"[data-role=discussion-vote]"
).
removeClass
(
"is-cast"
)
renderFlagged
:
=>
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
is
Staff
(
@
model
.
get
(
"user_id"
))
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
is
FlagModerator
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 @
649578ea
...
...
@@ -45,7 +45,7 @@ if Backbone?
renderFlagged
:
=>
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
is
Staff
(
@
model
.
get
(
"user_id"
))
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
is
FlagModerator
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 @
649578ea
...
...
@@ -98,7 +98,7 @@ if Backbone?
renderFlagged
:
=>
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
is
Staff
(
@
model
.
get
(
"user_id"
))
and
@
model
.
get
(
"abuse_flaggers"
).
length
>
0
)
if
window
.
user
.
id
in
@
model
.
get
(
"abuse_flaggers"
)
or
(
DiscussionUtil
.
is
FlagModerator
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 @
649578ea
...
...
@@ -323,7 +323,7 @@ def single_thread(request, course_id, discussion_id, thread_id):
'thread_pages'
:
query_params
[
'num_pages'
],
'is_course_cohorted'
:
is_course_cohorted
(
course_id
),
'is_moderator'
:
cached_has_permission
(
request
.
user
,
"see_all_cohorts"
,
course_id
),
'flag_moderator'
:
cached_has_permission
(
request
.
user
,
'openclose_thread'
,
course
.
id
),
'flag_moderator'
:
cached_has_permission
(
request
.
user
,
'openclose_thread'
,
course
.
id
)
or
has_access
(
request
.
user
,
course
,
'staff'
)
,
'cohorts'
:
cohorts
,
'user_cohort'
:
get_cohort_id
(
request
.
user
,
course_id
),
'cohorted_commentables'
:
cohorted_commentables
...
...
lms/lib/comment_client/thread.py
View file @
649578ea
...
...
@@ -10,7 +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'
'highlighted_body'
,
'endorsed'
,
'read'
,
'group_id'
,
'group_name'
,
'pinned'
,
'abuse_flaggers'
]
...
...
lms/templates/discussion/index.html
View file @
649578ea
...
...
@@ -21,7 +21,7 @@
<
%
include
file=
"_new_post.html"
/>
<section
class=
"discussion container"
id=
"discussion-container"
data-roles=
"${roles}"
data-course-id=
"${course_id}"
data-user-info=
"${user_info}"
data-threads=
"${threads}"
data-thread-pages=
"${thread_pages}"
data-content-info=
"${annotated_content_info}"
>
<section
class=
"discussion container"
id=
"discussion-container"
data-roles=
"${roles}"
data-course-id=
"${course_id}"
data-user-info=
"${user_info}"
data-threads=
"${threads}"
data-thread-pages=
"${thread_pages}"
data-content-info=
"${annotated_content_info}"
data-flag-moderator=
"${flag_moderator}"
>
<div
class=
"discussion-body"
>
<div
class=
"sidebar"
></div>
<div
class=
"discussion-column"
>
...
...
lms/templates/discussion/single_thread.html
View file @
649578ea
...
...
@@ -23,7 +23,7 @@
<
%
include
file=
"_new_post.html"
/>
<section
class=
"discussion container"
id=
"discussion-container"
data-roles=
"${roles}"
data-course-id=
"${course_id}"
data-user-info=
"${user_info}"
data-threads=
"${threads}"
data-content-info=
"${annotated_content_info}"
data-thread-pages=
"${thread_pages}"
>
<section
class=
"discussion container"
id=
"discussion-container"
data-roles=
"${roles}"
data-course-id=
"${course_id}"
data-user-info=
"${user_info}"
data-threads=
"${threads}"
data-content-info=
"${annotated_content_info}"
data-thread-pages=
"${thread_pages}"
data-flag-moderator=
"${flag_moderator}"
>
<div
class=
"discussion-body"
>
<div
class=
"sidebar"
></div>
<div
class=
"discussion-column"
></div>
...
...
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