Merge branch 'course-info' into feature/dhm/cms-settings

Conflicts:
	cms/djangoapps/contentstore/views.py
This commit is contained in:
Don Mitchell
2012-11-19 16:00:27 -05:00
11 changed files with 61 additions and 17 deletions

View File

@@ -1,5 +1,6 @@
from .utils import get_course_location_for_item, get_lms_link_for_item, \
compute_unit_state, get_date_display, UnitState
# to install PIL on MacOSX: 'easy_install http://dist.repoze.org/PIL-1.1.6.tar.gz'
from PIL import Image
from auth.authz import INSTRUCTOR_ROLE_NAME, STAFF_ROLE_NAME, \
create_all_course_groups, get_user_by_email, add_user_to_course_group, \
@@ -42,8 +43,7 @@ import shutil
import sys
import tarfile
import time
from contentstore.course_info_model import get_course_updates,\
update_course_updates, delete_course_update
from contentstore import course_info_model
# to install PIL on MacOSX: 'easy_install http://dist.repoze.org/PIL-1.1.6.tar.gz'
@@ -924,7 +924,7 @@ def course_info(request, org, course, name, provided_id=None):
'active_tab': 'courseinfo-tab',
'context_course': course_module,
'url_base' : "/" + org + "/" + course + "/",
'course_updates' : json.dumps(get_course_updates(location))
'course_updates' : json.dumps(course_info_model.get_course_updates(location))
})
@expect_json
@@ -947,14 +947,14 @@ def course_info_updates(request, org, course, provided_id=None):
real_method = request.method
if request.method == 'GET':
return HttpResponse(json.dumps(get_course_updates(location)), mimetype="application/json")
return HttpResponse(json.dumps(course_info_model.get_course_updates(location)), mimetype="application/json")
elif real_method == 'POST':
# new instance (unless django makes PUT a POST): updates are coming as POST. Not sure why.
return HttpResponse(json.dumps(update_course_updates(location, request.POST, provided_id)), mimetype="application/json")
return HttpResponse(json.dumps(course_info_model.update_course_updates(location, request.POST, provided_id)), mimetype="application/json")
elif real_method == 'PUT':
return HttpResponse(json.dumps(update_course_updates(location, request.POST, provided_id)), mimetype="application/json")
return HttpResponse(json.dumps(course_info_model.update_course_updates(location, request.POST, provided_id)), mimetype="application/json")
elif real_method == 'DELETE': # coming as POST need to pull from Request Header X-HTTP-Method-Override DELETE
return HttpResponse(json.dumps(delete_course_update(location, request.POST, provided_id)), mimetype="application/json")
return HttpResponse(json.dumps(course_info_model.delete_course_update(location, request.POST, provided_id)), mimetype="application/json")
@login_required
@ensure_csrf_cookie

View File

@@ -1 +0,0 @@
../../../common/static/sass/_mixins.scss

View File

@@ -0,0 +1,24 @@
@function em($pxval, $base: 16) {
@return #{$pxval / $base}em;
}
// Line-height
@function lh($amount: 1) {
@return $body-line-height * $amount;
}
@mixin hide-text(){
text-indent: -9999px;
overflow: hidden;
display: block;
}
@mixin vertically-and-horizontally-centered ( $height, $width ) {
left: 50%;
margin-left: -$width / 2;
//margin-top: -$height / 2;
min-height: $height;
min-width: $width;
position: absolute;
top: 150px;
}

View File

@@ -1 +0,0 @@
../../../common/static/sass/bourbon/

View File

@@ -35,9 +35,9 @@ urlpatterns = ('',
url(r'^(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<name>[^/]+)/remove_user$',
'contentstore.views.remove_user', name='remove_user'),
url(r'^(?P<org>[^/]+)/(?P<course>[^/]+)/info/(?P<name>[^/]+)$', 'contentstore.views.course_info', name='course_info'),
# ??? Is the following necessary or will the one below work w/ id=None if not sent?
# url(r'^(?P<org>[^/]+)/(?P<course>[^/]+)/course_info/updates$', 'contentstore.views.course_info_updates', name='course_info'),
url(r'^(?P<org>[^/]+)/(?P<course>[^/]+)/course_info/updates/(?P<provided_id>.*)$', 'contentstore.views.course_info_updates', name='course_info'),
url(r'^(?P<org>[^/]+)/(?P<course>[^/]+)/settings/(?P<name>[^/]+)$', 'contentstore.views.course_settings', name='course_settings'),
url(r'^(?P<org>[^/]+)/(?P<course>[^/]+)/course_settings/updates/(?P<provided_id>.*)$', 'contentstore.views.course_settings_updates', name='course_settings'),
url(r'^pages/(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<coursename>[^/]+)$', 'contentstore.views.static_pages',
name='static_pages'),
url(r'^edit_static/(?P<org>[^/]+)/(?P<course>[^/]+)/course/(?P<coursename>[^/]+)$', 'contentstore.views.edit_static', name='edit_static'),

View File

@@ -1 +0,0 @@
roots/2012_Fall.xml

View File

@@ -0,0 +1 @@
<course org="edX" course="graded" url_name="2012_Fall"/>

View File

@@ -1 +0,0 @@
roots/2012_Fall.xml

View File

@@ -0,0 +1 @@
<course org="edX" course="sa_test" url_name="2012_Fall"/>

View File

@@ -1 +0,0 @@
roots/2012_Fall.xml

View File

@@ -0,0 +1 @@
<course org="edX" course="test_start_date" url_name="2012_Fall"/>

View File

@@ -1 +0,0 @@
roots/2012_Fall.xml

View File

@@ -0,0 +1 @@
<course org="edX" course="toy" url_name="2012_Fall"/>

View File

@@ -1 +0,0 @@
../../../common/static/images/edge-logo-small.png

Before

Width:  |  Height:  |  Size: 49 B

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 B

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -1 +0,0 @@
../../../../common/static/sass/_mixins.scss

View File

@@ -0,0 +1,24 @@
@function em($pxval, $base: 16) {
@return #{$pxval / $base}em;
}
// Line-height
@function lh($amount: 1) {
@return $body-line-height * $amount;
}
@mixin hide-text(){
text-indent: -9999px;
overflow: hidden;
display: block;
}
@mixin vertically-and-horizontally-centered ( $height, $width ) {
left: 50%;
margin-left: -$width / 2;
//margin-top: -$height / 2;
min-height: $height;
min-width: $width;
position: absolute;
top: 150px;
}

View File

@@ -1 +0,0 @@
../../../common/static/sass/bourbon/