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
41df538d
Commit
41df538d
authored
Oct 12, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #875 from MITx/feature/arjun/community_tas
styles and tiny bit of logic for community tas
parents
2063b2db
ddb33df2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
2 deletions
+37
-2
lms/djangoapps/django_comment_client/management/commands/seed_permissions_roles.py
+4
-0
lms/static/coffee/src/discussion/utils.coffee
+4
-0
lms/static/coffee/src/discussion/views/response_comment_show_view.coffee
+2
-0
lms/static/coffee/src/discussion/views/thread_response_show_view.coffee
+3
-0
lms/static/sass/_discussion.scss
+24
-2
No files found.
lms/djangoapps/django_comment_client/management/commands/seed_permissions_roles.py
View file @
41df538d
...
@@ -14,6 +14,7 @@ class Command(BaseCommand):
...
@@ -14,6 +14,7 @@ class Command(BaseCommand):
course_id
=
args
[
0
]
course_id
=
args
[
0
]
administrator_role
=
Role
.
objects
.
get_or_create
(
name
=
"Administrator"
,
course_id
=
course_id
)[
0
]
administrator_role
=
Role
.
objects
.
get_or_create
(
name
=
"Administrator"
,
course_id
=
course_id
)[
0
]
moderator_role
=
Role
.
objects
.
get_or_create
(
name
=
"Moderator"
,
course_id
=
course_id
)[
0
]
moderator_role
=
Role
.
objects
.
get_or_create
(
name
=
"Moderator"
,
course_id
=
course_id
)[
0
]
community_ta_role
=
Role
.
objects
.
get_or_create
(
name
=
"Community TA"
,
course_id
=
course_id
)[
0
]
student_role
=
Role
.
objects
.
get_or_create
(
name
=
"Student"
,
course_id
=
course_id
)[
0
]
student_role
=
Role
.
objects
.
get_or_create
(
name
=
"Student"
,
course_id
=
course_id
)[
0
]
for
per
in
[
"vote"
,
"update_thread"
,
"follow_thread"
,
"unfollow_thread"
,
for
per
in
[
"vote"
,
"update_thread"
,
"follow_thread"
,
"unfollow_thread"
,
...
@@ -30,4 +31,7 @@ class Command(BaseCommand):
...
@@ -30,4 +31,7 @@ class Command(BaseCommand):
moderator_role
.
inherit_permissions
(
student_role
)
moderator_role
.
inherit_permissions
(
student_role
)
# For now, Community TA == Moderator, except for the styling.
community_ta_role
.
inherit_permissions
(
moderator_role
)
administrator_role
.
inherit_permissions
(
moderator_role
)
administrator_role
.
inherit_permissions
(
moderator_role
)
lms/static/coffee/src/discussion/utils.coffee
View file @
41df538d
...
@@ -25,6 +25,10 @@ class @DiscussionUtil
...
@@ -25,6 +25,10 @@ class @DiscussionUtil
staff
=
_
.
union
(
@
roleIds
[
'Staff'
],
@
roleIds
[
'Moderator'
],
@
roleIds
[
'Administrator'
])
staff
=
_
.
union
(
@
roleIds
[
'Staff'
],
@
roleIds
[
'Moderator'
],
@
roleIds
[
'Administrator'
])
_
.
include
(
staff
,
parseInt
(
user_id
))
_
.
include
(
staff
,
parseInt
(
user_id
))
@
isTA
:
(
user_id
)
->
ta
=
_
.
union
(
@
roleIds
[
'Community TA'
])
_
.
include
(
ta
,
parseInt
(
user_id
))
@
bulkUpdateContentInfo
:
(
infos
)
->
@
bulkUpdateContentInfo
:
(
infos
)
->
for
id
,
info
of
infos
for
id
,
info
of
infos
Content
.
getContent
(
id
).
updateInfo
(
info
)
Content
.
getContent
(
id
).
updateInfo
(
info
)
...
...
lms/static/coffee/src/discussion/views/response_comment_show_view.coffee
View file @
41df538d
...
@@ -32,3 +32,5 @@ if Backbone?
...
@@ -32,3 +32,5 @@ if Backbone?
markAsStaff
:
->
markAsStaff
:
->
if
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
if
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
@
$el
.
find
(
"a.profile-link"
).
after
(
'<span class="staff-label">staff</span>'
)
@
$el
.
find
(
"a.profile-link"
).
after
(
'<span class="staff-label">staff</span>'
)
else
if
DiscussionUtil
.
isTA
(
@
model
.
get
(
"user_id"
))
@
$el
.
find
(
"a.profile-link"
).
after
(
'<span class="community-ta-label">Community TA</span>'
)
lms/static/coffee/src/discussion/views/thread_response_show_view.coffee
View file @
41df538d
...
@@ -37,6 +37,9 @@ if Backbone?
...
@@ -37,6 +37,9 @@ if Backbone?
if
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
if
DiscussionUtil
.
isStaff
(
@
model
.
get
(
"user_id"
))
@
$el
.
addClass
(
"staff"
)
@
$el
.
addClass
(
"staff"
)
@
$el
.
prepend
(
'<div class="staff-banner">staff</div>'
)
@
$el
.
prepend
(
'<div class="staff-banner">staff</div>'
)
else
if
DiscussionUtil
.
isTA
(
@
model
.
get
(
"user_id"
))
@
$el
.
addClass
(
"community-ta"
)
@
$el
.
prepend
(
'<div class="community-ta-banner">Community TA</div>'
)
toggleVote
:
(
event
)
->
toggleVote
:
(
event
)
->
event
.
preventDefault
()
event
.
preventDefault
()
...
...
lms/static/sass/_discussion.scss
View file @
41df538d
...
@@ -1376,6 +1376,11 @@ body.discussion {
...
@@ -1376,6 +1376,11 @@ body.discussion {
border-color
:
#009fe2
;
border-color
:
#009fe2
;
}
}
&
.community-ta
{
padding-top
:
38px
;
border-color
:
#449944
;
}
.staff-banner
{
.staff-banner
{
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
...
@@ -1392,6 +1397,23 @@ body.discussion {
...
@@ -1392,6 +1397,23 @@ body.discussion {
text-transform
:
uppercase
;
text-transform
:
uppercase
;
}
}
.community-ta-banner
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
14px
;
padding
:
1px
5px
;
@include
box-sizing
(
border-box
);
border-radius
:
2px
2px
0
0
;
background
:
#449944
;
font-size
:
9px
;
font-weight
:
700
;
color
:
#fff
;
text-transform
:
uppercase
;
}
&
.loading
{
&
.loading
{
height
:
0
;
height
:
0
;
margin
:
0
;
margin
:
0
;
...
@@ -1556,11 +1578,11 @@ body.discussion {
...
@@ -1556,11 +1578,11 @@ body.discussion {
}
}
}
}
.
moderator-label
{
.
community-ta-label
{
margin-left
:
2px
;
margin-left
:
2px
;
padding
:
0
4px
;
padding
:
0
4px
;
border-radius
:
2px
;
border-radius
:
2px
;
background
:
#
55dc9e
;
background
:
#
449944
;
font-size
:
9px
;
font-size
:
9px
;
font-weight
:
700
;
font-weight
:
700
;
font-style
:
normal
;
font-style
:
normal
;
...
...
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