diff --git a/cms/templates/studio_xblock_wrapper.html b/cms/templates/studio_xblock_wrapper.html index bc636190d3..f656006856 100644 --- a/cms/templates/studio_xblock_wrapper.html +++ b/cms/templates/studio_xblock_wrapper.html @@ -36,9 +36,6 @@ % endif -
  • - -
  • diff --git a/common/lib/xmodule/xmodule/vertical_module.py b/common/lib/xmodule/xmodule/vertical_module.py index 0053cb5ca1..f18153c066 100644 --- a/common/lib/xmodule/xmodule/vertical_module.py +++ b/common/lib/xmodule/xmodule/vertical_module.py @@ -17,6 +17,22 @@ class VerticalModule(VerticalFields, XModule): ''' Layout module for laying out submodules vertically.''' def student_view(self, context): + # When rendering a Studio preview, use a different template to support drag and drop. + if context and context['runtime_type'] == 'studio': + return self.studio_preview_view(context) + + return self.render_view(context, 'vert_module.html') + + def studio_preview_view(self, context): + """ + Renders the Studio preview view, which supports drag and drop. + """ + return self.render_view(context, 'vert_module_studio_view.html') + + def render_view(self, context, template_name): + """ + Helper method for rendering student_view and the Studio version. + """ fragment = Fragment() contents = [] @@ -29,7 +45,7 @@ class VerticalModule(VerticalFields, XModule): 'content': rendered_child.content }) - fragment.add_content(self.system.render_template('vert_module.html', { + fragment.add_content(self.system.render_template(template_name, { 'items': contents })) return fragment diff --git a/lms/templates/vert_module.html b/lms/templates/vert_module.html index 549ae4e032..a153773020 100644 --- a/lms/templates/vert_module.html +++ b/lms/templates/vert_module.html @@ -1,14 +1,7 @@ -<%! -from django.utils.translation import ugettext as _ -%>
    -
      - % for idx, item in enumerate(items): -
    1. -
      - ${item['content']} -
      -
    2. - % endfor -
    +% for idx, item in enumerate(items): +
    + ${item['content']} +
    +% endfor
    diff --git a/lms/templates/vert_module_studio_view.html b/lms/templates/vert_module_studio_view.html new file mode 100644 index 0000000000..b8bab17950 --- /dev/null +++ b/lms/templates/vert_module_studio_view.html @@ -0,0 +1,15 @@ +<%! +from django.utils.translation import ugettext as _ +%> +
    +
      + % for idx, item in enumerate(items): +
    1. +
      + + ${item['content']} +
      +
    2. + % endfor +
    +