Commit 52b5da3e by cahrens

Merge branch 'talbs/studio-authorship' of github.com:edx/edx-platform into talbs/studio-authorship

Conflicts:
	cms/djangoapps/contentstore/views/user.py
	cms/templates/index.html
parents 3715d6c4 aaa67b28
...@@ -39,7 +39,7 @@ class CourseCreator(models.Model): ...@@ -39,7 +39,7 @@ class CourseCreator(models.Model):
"why course creation access was denied)")) "why course creation access was denied)"))
def __unicode__(self): def __unicode__(self):
return u'%str | %str [%str] | %str' % (self.user, self.state, self.state_changed, self.note) return u'%s | %s [%s]' % (self.user, self.state, self.state_changed)
@receiver(post_init, sender=CourseCreator) @receiver(post_init, sender=CourseCreator)
......
...@@ -2,19 +2,18 @@ ...@@ -2,19 +2,18 @@
Methods for interacting programmatically with the user creator table. Methods for interacting programmatically with the user creator table.
""" """
from course_creators.models import CourseCreator from course_creators.models import CourseCreator
from django.core.exceptions import PermissionDenied
from auth.authz import add_user_to_creator_group, remove_user_from_creator_group from auth.authz import add_user_to_creator_group, remove_user_from_creator_group
def add_user_with_status_unrequested(caller, user): def add_user_with_status_unrequested(user):
""" """
Adds a user to the course creator table with status 'unrequested'. Adds a user to the course creator table with status 'unrequested'.
If the user is already in the table, this method is a no-op If the user is already in the table, this method is a no-op
(state will not be changed). Caller must have staff permissions. (state will not be changed).
""" """
_add_user(caller, user, CourseCreator.UNREQUESTED) _add_user(user, CourseCreator.UNREQUESTED)
def add_user_with_status_granted(caller, user): def add_user_with_status_granted(caller, user):
...@@ -26,7 +25,7 @@ def add_user_with_status_granted(caller, user): ...@@ -26,7 +25,7 @@ def add_user_with_status_granted(caller, user):
This method also adds the user to the course creator group maintained by authz.py. This method also adds the user to the course creator group maintained by authz.py.
""" """
_add_user(caller, user, CourseCreator.GRANTED) _add_user(user, CourseCreator.GRANTED)
update_course_creator_group(caller, user, True) update_course_creator_group(caller, user, True)
...@@ -61,16 +60,13 @@ def get_course_creator_status(user): ...@@ -61,16 +60,13 @@ def get_course_creator_status(user):
return user[0].state return user[0].state
def _add_user(caller, user, state): def _add_user(user, state):
""" """
Adds a user to the course creator table with the specified state. Adds a user to the course creator table with the specified state.
If the user is already in the table, this method is a no-op If the user is already in the table, this method is a no-op
(state will not be changed). (state will not be changed).
""" """
if not caller.is_active or not caller.is_authenticated or not caller.is_staff:
raise PermissionDenied
if CourseCreator.objects.filter(user=user).count() == 0: if CourseCreator.objects.filter(user=user).count() == 0:
entry = CourseCreator(user=user, state=state) entry = CourseCreator(user=user, state=state)
entry.save() entry.save()
...@@ -446,6 +446,24 @@ p, ul, ol, dl { ...@@ -446,6 +446,24 @@ p, ul, ol, dl {
} }
} }
// actions
.list-actions {
@extend .no-list;
.action-item {
margin-bottom: ($baseline/4);
border-bottom: 1px dotted $gray-l4;
padding-bottom: ($baseline/4);
&:last-child {
margin-bottom: 0;
border: none;
padding-bottom: 0;
}
}
}
// navigation // navigation
.nav-related, .nav-page { .nav-related, .nav-page {
......
...@@ -104,6 +104,22 @@ ...@@ -104,6 +104,22 @@
} }
} }
} }
// list of notices all in one
&.list-notices {
.notice-item {
margin-bottom: $baseline;
border-bottom: 1px solid $gray-l3;
padding-bottom: $baseline;
&:last-child {
margin-bottom: 0;
border: none;
padding-bottom: 0;
}
}
}
} }
// particular notice - warnings around a workflow for something // particular notice - warnings around a workflow for something
...@@ -128,11 +144,11 @@ ...@@ -128,11 +144,11 @@
background-color: $gray-l4; background-color: $gray-l4;
.title { .title {
color: $gray-d1; color: $gray-d3;
} }
.copy { .copy {
color: $gray; color: $gray-d2;
} }
&.has-actions { &.has-actions {
......
...@@ -36,7 +36,7 @@ body.dashboard { ...@@ -36,7 +36,7 @@ body.dashboard {
width: flexgrid(9, 9); width: flexgrid(9, 9);
// CASE: notice has actions { // CASE: notice has actions {
&.has-actions { &.has-actions, &.list-notices .notice-item.has-actions {
.msg, .list-actions { .msg, .list-actions {
display: inline-block; display: inline-block;
...@@ -59,6 +59,7 @@ body.dashboard { ...@@ -59,6 +59,7 @@ body.dashboard {
.action-create-course { .action-create-course {
@extend .btn-primary-green; @extend .btn-primary-green;
@extend .t-action3;
} }
} }
} }
...@@ -66,8 +67,8 @@ body.dashboard { ...@@ -66,8 +67,8 @@ body.dashboard {
// elements - authorship controls // elements - course creation rights controls
.wrapper-authorshiprights { .wrapper-creationrights {
overflow: hidden; overflow: hidden;
.ui-toggle-control { .ui-toggle-control {
...@@ -129,8 +130,8 @@ body.dashboard { ...@@ -129,8 +130,8 @@ body.dashboard {
} }
// elements - authorship controls // elements - course creation rights controls
.status-authorship { .status-creationrights {
margin-top: $baseline; margin-top: $baseline;
.title { .title {
...@@ -144,7 +145,7 @@ body.dashboard { ...@@ -144,7 +145,7 @@ body.dashboard {
} }
.list-actions { .list-actions, .form-actions {
margin-top: ($baseline*0.75); margin-top: ($baseline*0.75);
.action-item { .action-item {
...@@ -253,10 +254,10 @@ body.dashboard { ...@@ -253,10 +254,10 @@ body.dashboard {
} }
.class-list { .class-list {
margin-top: 20px; margin-top: $baseline;
border-radius: 3px; border-radius: 3px;
border: 1px solid $darkGrey; border: 1px solid $gray-d2;
background: #fff; background: $white;
box-shadow: 0 1px 2px rgba(0, 0, 0, .1); box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
li { li {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment