Commit 39e64c1e by Chris Dodge

work in progress. Need to commit before rebasing to master

parent 7bf7eab6
......@@ -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()
......@@ -6,8 +6,8 @@
<input type="submit" value="Upload File">
</form>
</div>
<div class="asset-upload-progress">
<div class="bar"></div>
<div class="asset-upload-progress" style="position:relative; width:400px; border: 1px solid #ddd; padding: 1px; border-radius: 3px;">
<div class="bar" style="background-color: #B4F5B4; width:0%; height:20px; border-radius: 3px;"></div>
<div class="percent">0%</div>
</div>
......
......@@ -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
......
......@@ -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):
"""
......
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