Merge pull request #875 from MITx/feature/arjun/community_tas
styles and tiny bit of logic for community tas
This commit is contained in:
@@ -14,6 +14,7 @@ class Command(BaseCommand):
|
||||
course_id = args[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]
|
||||
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]
|
||||
|
||||
for per in ["vote", "update_thread", "follow_thread", "unfollow_thread",
|
||||
@@ -30,4 +31,7 @@ class Command(BaseCommand):
|
||||
|
||||
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)
|
||||
|
||||
@@ -25,6 +25,10 @@ class @DiscussionUtil
|
||||
staff = _.union(@roleIds['Staff'], @roleIds['Moderator'], @roleIds['Administrator'])
|
||||
_.include(staff, parseInt(user_id))
|
||||
|
||||
@isTA: (user_id) ->
|
||||
ta = _.union(@roleIds['Community TA'])
|
||||
_.include(ta, parseInt(user_id))
|
||||
|
||||
@bulkUpdateContentInfo: (infos) ->
|
||||
for id, info of infos
|
||||
Content.getContent(id).updateInfo(info)
|
||||
|
||||
@@ -32,3 +32,5 @@ if Backbone?
|
||||
markAsStaff: ->
|
||||
if DiscussionUtil.isStaff(@model.get("user_id"))
|
||||
@$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>')
|
||||
|
||||
@@ -37,6 +37,9 @@ if Backbone?
|
||||
if DiscussionUtil.isStaff(@model.get("user_id"))
|
||||
@$el.addClass("staff")
|
||||
@$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) ->
|
||||
event.preventDefault()
|
||||
|
||||
@@ -1376,6 +1376,11 @@ body.discussion {
|
||||
border-color: #009fe2;
|
||||
}
|
||||
|
||||
&.community-ta{
|
||||
padding-top: 38px;
|
||||
border-color: #449944;
|
||||
}
|
||||
|
||||
.staff-banner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@@ -1392,6 +1397,23 @@ body.discussion {
|
||||
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 {
|
||||
height: 0;
|
||||
margin: 0;
|
||||
@@ -1556,11 +1578,11 @@ body.discussion {
|
||||
}
|
||||
}
|
||||
|
||||
.moderator-label {
|
||||
.community-ta-label{
|
||||
margin-left: 2px;
|
||||
padding: 0 4px;
|
||||
border-radius: 2px;
|
||||
background: #55dc9e;
|
||||
background: #449944;
|
||||
font-size: 9px;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
|
||||
Reference in New Issue
Block a user