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
c78b84ca
Commit
c78b84ca
authored
Jul 12, 2017
by
Albert (AJ) St. Aubin
Committed by
GitHub
Jul 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15480 from edx/staubina/ed-592
Staubina/ed 592
parents
1f6a4f22
b8b0110d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
16 deletions
+39
-16
common/static/common/js/discussion/content.js
+1
-1
common/static/common/js/discussion/utils.js
+11
-1
common/static/common/js/discussion/views/discussion_content_view.js
+2
-1
lms/djangoapps/instructor/views/api.py
+14
-1
lms/static/js/instructor_dashboard/membership.js
+0
-0
lms/templates/instructor/instructor_dashboard_2/membership.html
+11
-12
No files found.
common/static/common/js/discussion/content.js
View file @
c78b84ca
...
...
@@ -122,7 +122,7 @@
userId
=
this
.
get
(
'user_id'
);
if
(
userId
)
{
this
.
set
(
'staff_authored'
,
DiscussionUtil
.
isStaff
(
userId
));
this
.
set
(
'community_ta_authored'
,
DiscussionUtil
.
isTA
(
userId
));
this
.
set
(
'community_ta_authored'
,
DiscussionUtil
.
isTA
(
userId
)
||
DiscussionUtil
.
isGroupTA
(
userId
)
);
}
else
{
this
.
set
(
'staff_authored'
,
false
);
this
.
set
(
'community_ta_authored'
,
false
);
...
...
common/static/common/js/discussion/utils.js
View file @
c78b84ca
/* globals $$course_id, Content, Markdown, MathJax, URI */
/* globals $$course_id, Content, Markdown, MathJax, URI
, _
*/
(
function
()
{
'use strict'
;
this
.
DiscussionUtil
=
(
function
()
{
...
...
@@ -41,6 +41,16 @@
return
_
.
include
(
ta
,
parseInt
(
userId
));
};
DiscussionUtil
.
isGroupTA
=
function
(
userId
)
{
var
groupTa
,
localUserId
=
userId
;
if
(
_
.
isUndefined
(
userId
))
{
localUserId
=
this
.
user
?
this
.
user
.
id
:
void
0
;
}
groupTa
=
_
.
union
(
this
.
roleIds
[
'Group Moderator'
]);
return
_
.
include
(
groupTa
,
parseInt
(
localUserId
,
10
));
};
DiscussionUtil
.
isPrivilegedUser
=
function
(
userId
)
{
return
this
.
isStaff
(
userId
)
||
this
.
isTA
(
userId
);
};
...
...
common/static/common/js/discussion/views/discussion_content_view.js
View file @
c78b84ca
...
...
@@ -508,7 +508,8 @@
return
_
.
template
(
$
(
'#post-user-display-template'
).
html
())({
username
:
endorsement
.
username
,
user_url
:
DiscussionUtil
.
urlFor
(
'user_profile'
,
endorsement
.
user_id
),
is_community_ta
:
DiscussionUtil
.
isTA
(
endorsement
.
user_id
),
is_community_ta
:
DiscussionUtil
.
isTA
(
endorsement
.
user_id
)
||
DiscussionUtil
.
isGroupTA
(
endorsement
.
user_id
),
is_staff
:
DiscussionUtil
.
isStaff
(
endorsement
.
user_id
)
});
}
else
{
...
...
lms/djangoapps/instructor/views/api.py
View file @
c78b84ca
...
...
@@ -45,7 +45,12 @@ from certificates.models import CertificateInvalidation, CertificateStatuses, Ce
from
courseware.access
import
has_access
from
courseware.courses
import
get_course_by_id
,
get_course_with_access
from
courseware.models
import
StudentModule
from
django_comment_client.utils
import
has_forum_access
from
django_comment_client.utils
import
(
has_forum_access
,
get_course_discussion_settings
,
get_group_name
,
get_group_id_for_user
)
from
django_comment_common.models
import
(
Role
,
FORUM_ROLE_ADMINISTRATOR
,
...
...
@@ -933,6 +938,7 @@ def list_course_role_members(request, course_id):
def
extract_user_info
(
user
):
""" convert user into dicts for json view """
return
{
'username'
:
user
.
username
,
'email'
:
user
.
email
,
...
...
@@ -2505,18 +2511,25 @@ def list_forum_members(request, course_id):
except
Role
.
DoesNotExist
:
users
=
[]
course_discussion_settings
=
get_course_discussion_settings
(
course_id
)
def
extract_user_info
(
user
):
""" Convert user to dict for json rendering. """
group_id
=
get_group_id_for_user
(
user
,
course_discussion_settings
)
group_name
=
get_group_name
(
group_id
,
course_discussion_settings
)
return
{
'username'
:
user
.
username
,
'email'
:
user
.
email
,
'first_name'
:
user
.
first_name
,
'last_name'
:
user
.
last_name
,
'group_name'
:
group_name
,
}
response_payload
=
{
'course_id'
:
course_id
.
to_deprecated_string
(),
rolename
:
map
(
extract_user_info
,
users
),
'division_scheme'
:
course_discussion_settings
.
division_scheme
,
}
return
JsonResponse
(
response_payload
)
...
...
lms/static/js/instructor_dashboard/membership.js
View file @
c78b84ca
This diff is collapsed.
Click to expand it.
lms/templates/instructor/instructor_dashboard_2/membership.html
View file @
c78b84ca
...
...
@@ -223,26 +223,25 @@ from openedx.core.djangolib.markup import HTML, Text
<div
class=
"auth-list-container"
data-rolename=
"Group Moderator"
data-display-name=
"${_("
Discussion
Group
Moderators
")}"
data-display-name=
"${_("
Group
Community
TA
")}"
data-info-text=
"
${_("
Discussion
Group
Moderators
can
edit
or
delete
any
post
,
clear
misuse
flags
,
close
"
"
and
re-open
threads
,
endorse
responses
,
and
see
posts
from
all
groups
.
"
"
Their
posts
are
marked
as
'
staff
'.
They
cannot
manage
course
team
membership
by
"
"
adding
or
removing
discussion
moderation
roles
.
Only
enrolled
users
can
be
"
"
added
as
Discussion
Moderator
s
.")}"
${_("
Group
Community
TAs
are
members
of
the
community
who
help
course
teams
moderate
discussions
.
Group
"
"
Community
TAs
see
only
posts
by
learners
in
their
assigned
group
.
They
can
edit
or
delete
posts
,
"
"
clear
flags
,
close
and
re-open
threads
,
and
endorse
responses
,
but
only
for
posts
by
learners
in
"
"
their
group
.
Their
posts
are
marked
as
'
Community
TA
'.
Only
enrolled
learners
can
be
added
as
Group
"
"
Community
TA
s
.")}"
data-list-endpoint=
"${ section_data['list_forum_members_url'] }"
data-modify-endpoint=
"${ section_data['update_forum_role_membership_url'] }"
data-add-button-label=
"${_("
Add
Group
Moderator
")}"
data-add-button-label=
"${_("
Add
Group
Community
TA
")}"
></div>
<div
class=
"auth-list-container"
data-rolename=
"Community TA"
data-display-name=
"${_("
Discussion
Community
TAs
")}"
data-display-name=
"${_("
Community
TA
")}"
data-info-text=
"
${_("
Community
TAs
are
members
of
the
community
whom
you
deem
particularly
"
"
helpful
on
the
discussion
boards
.
They
can
edit
or
delete
any
post
,
clear
"
"
misuse
flags
,
close
and
re-open
threads
,
endorse
responses
,
and
see
posts
from
"
"
all
groups
.
Their
posts
are
marked
as
'
Community
TA
'.
Only
enrolled
users
can
"
${_("
Community
TAs
are
members
of
the
community
who
help
course
teams
moderate
discussions
.
"
"
They
can
see
posts
by
all
learners
,
and
can
edit
or
delete
posts
,
clear
flags
,
close
or
re-open
"
"
threads
,
and
endorse
responses
.
Their
posts
are
marked
as
'
Community
TA
'.
Only
enrolled
learners
can
"
"
be
added
as
Community
TAs
.")}"
data-list-endpoint=
"${ section_data['list_forum_members_url'] }"
data-modify-endpoint=
"${ section_data['update_forum_role_membership_url'] }"
...
...
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