Support editing of metadata on Sequences

This commit is contained in:
Chris Dodge
2012-09-21 13:56:53 -04:00
parent d51f127afa
commit 4b6eabec5f
3 changed files with 7 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
% if metadata:
<section class="metadata_edit"> <section class="metadata_edit">
<h3>Metadata</h3> <h3>Metadata</h3>
<ul> <ul>
@@ -6,3 +7,4 @@
% endfor % endfor
</ul> </ul>
</section> </section>
% endif

View File

@@ -29,6 +29,7 @@
</ul> </ul>
</section> </section>
<%include file="metadata-edit.html" />
<div class="content"> <div class="content">
<section class="modules"> <section class="modules">
<ol> <ol>

View File

@@ -9,6 +9,7 @@ from xmodule.x_module import XModule
from xmodule.progress import Progress from xmodule.progress import Progress
from xmodule.exceptions import NotFoundError from xmodule.exceptions import NotFoundError
from pkg_resources import resource_string from pkg_resources import resource_string
from .editing_module import EditingDescriptor
log = logging.getLogger("mitx.common.lib.seq_module") log = logging.getLogger("mitx.common.lib.seq_module")
@@ -95,7 +96,8 @@ class SequenceModule(XModule):
'element_id': self.location.html_id(), 'element_id': self.location.html_id(),
'item_id': self.id, 'item_id': self.id,
'position': self.position, 'position': self.position,
'tag': self.location.category} 'tag': self.location.category
}
self.content = self.system.render_template('seq_module.html', params) self.content = self.system.render_template('seq_module.html', params)
self.rendered = True self.rendered = True
@@ -110,7 +112,7 @@ class SequenceModule(XModule):
return new_class return new_class
class SequenceDescriptor(MakoModuleDescriptor, XmlDescriptor): class SequenceDescriptor(EditingDescriptor, XmlDescriptor):
mako_template = 'widgets/sequence-edit.html' mako_template = 'widgets/sequence-edit.html'
module_class = SequenceModule module_class = SequenceModule