Book module works
--HG-- branch : pmitros-mod-template
This commit is contained in:
@@ -92,7 +92,8 @@ def id_tag(course):
|
||||
'html':'filename',
|
||||
'vertical':'id',
|
||||
'tab':'id',
|
||||
'schematic':'id'}
|
||||
'schematic':'id',
|
||||
'book' : 'id'}
|
||||
|
||||
# Tag elements with unique IDs
|
||||
elements = course.xpath("|".join(['//'+c for c in default_ids]))
|
||||
@@ -143,7 +144,7 @@ def course_file(user):
|
||||
filename = UserProfile.objects.get(user=user).courseware
|
||||
data_template = template_lookup.get_template(filename)
|
||||
|
||||
options = {'dev_content':True}
|
||||
options = {'dev_content':settings.DEV_CONTENT}
|
||||
|
||||
tree = etree.XML(data_template.render(**options))
|
||||
id_tag(tree)
|
||||
|
||||
@@ -41,6 +41,7 @@ class Command(BaseCommand):
|
||||
if os.path.exists(sections_dir):
|
||||
print "Checking all section includes are valid XML"
|
||||
for f in os.listdir(sections_dir):
|
||||
print f
|
||||
etree.parse(sections_dir+'/'+f)
|
||||
else:
|
||||
print "Skipping check of include files -- no section includes dir ("+sections_dir+")"
|
||||
|
||||
@@ -30,6 +30,7 @@ import courseware.modules.capa_module
|
||||
import courseware.modules.html_module
|
||||
import courseware.modules.schematic_module
|
||||
import courseware.modules.seq_module
|
||||
import courseware.modules.template_module
|
||||
import courseware.modules.vertical_module
|
||||
import courseware.modules.video_module
|
||||
|
||||
@@ -44,6 +45,9 @@ modx_modules={'problem':courseware.modules.capa_module.LoncapaModule,
|
||||
'tab':courseware.modules.seq_module.SequentialModule,
|
||||
'schematic':courseware.modules.schematic_module.SchematicModule}
|
||||
|
||||
for f in os.listdir(settings.DATA_DIR+'/custom_tags'):
|
||||
modx_modules[f] = courseware.modules.template_module.TemplateModule
|
||||
|
||||
def object_cache(cache, user, module_type, module_id):
|
||||
# We don't look up on user -- all queries include user
|
||||
# Additional lookup would require a DB hit the way Django
|
||||
|
||||
Reference in New Issue
Block a user