diff --git a/cms/djangoapps/contentstore/views.py b/cms/djangoapps/contentstore/views.py index 6692192590..fcc77a02c0 100644 --- a/cms/djangoapps/contentstore/views.py +++ b/cms/djangoapps/contentstore/views.py @@ -353,7 +353,7 @@ def save_item(request): if request.POST['data']: data = request.POST['data'] modulestore().update_item(item_location, data) - + if request.POST['children']: children = request.POST['children'] modulestore().update_children(item_location, children) @@ -457,8 +457,3 @@ def upload_asset(request, org, course, coursename): return HttpResponse('Upload completed') - - -class UploadFileForm(forms.Form): - title = forms.CharField(max_length=50) - file = forms.FileField() diff --git a/cms/templates/widgets/upload_assets.html b/cms/templates/widgets/upload_assets.html index 876166fdf7..75414709d1 100644 --- a/cms/templates/widgets/upload_assets.html +++ b/cms/templates/widgets/upload_assets.html @@ -6,8 +6,8 @@ -
-
+
+
0%
diff --git a/common/djangoapps/contentserver/middleware.py b/common/djangoapps/contentserver/middleware.py index f0734dd202..d30a3f7900 100644 --- a/common/djangoapps/contentserver/middleware.py +++ b/common/djangoapps/contentserver/middleware.py @@ -33,10 +33,8 @@ class StaticContentServer(object): # see if the last-modified at hasn't changed, if not return a 302 (Not Modified) - logging.debug(request.META) - # convert over the DB persistent last modified timestamp to a HTTP compatible - # timestamp + # timestamp, so we can simply compare the strings last_modified_at_str = content.last_modified_at.strftime("%a, %d-%b-%Y %H:%M:%S GMT") # see if the client has cached this content, if so then compare the diff --git a/common/lib/xmodule/xmodule/html_module.py b/common/lib/xmodule/xmodule/html_module.py index f5672ca1b8..471a1ea7fd 100644 --- a/common/lib/xmodule/xmodule/html_module.py +++ b/common/lib/xmodule/xmodule/html_module.py @@ -4,6 +4,7 @@ import logging import os import sys from lxml import etree +from lxml.html import rewrite_links from path import path from .x_module import XModule @@ -18,7 +19,9 @@ log = logging.getLogger("mitx.courseware") class HtmlModule(XModule): def get_html(self): - return self.html + # cdodge: perform link substitutions for any references to course static content (e.g. images) + return rewrite_links(self.html, self.rewrite_content_links, self) + #return self.html def __init__(self, system, location, definition, descriptor, instance_state=None, shared_state=None, **kwargs): @@ -26,6 +29,11 @@ class HtmlModule(XModule): instance_state, shared_state, **kwargs) self.html = self.definition['data'] + def rewrite_content_links(link, self): + if link.startswith('xasset:'): + logging.debug('found link: {0}'.format(link)) + return link + class HtmlDescriptor(XmlDescriptor, EditingDescriptor): """