Skip to content

Commit

Permalink
Use render_django_template, and pass in i18n_service
Browse files Browse the repository at this point in the history
Dependent on version bump for xblock-utils
  • Loading branch information
pomegranited committed Mar 15, 2018
1 parent a4acc30 commit c9dbe04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions drag_and_drop_v2/drag_and_drop_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ def student_view(self, context):
"""

fragment = Fragment()
fragment.add_content(loader.render_template('/templates/html/drag_and_drop.html'))
fragment.add_content(loader.render_django_template('/templates/html/drag_and_drop.html',
i18n_service=self.i18n_service))
css_urls = (
'public/css/drag_and_drop.css',
)
Expand Down Expand Up @@ -342,19 +343,18 @@ def studio_view(self, context):
# connect 'for' and 'aria-describedby' attributes to the associated elements.
id_suffix = self._get_block_id()
js_templates = js_templates.replace('{{id_suffix}}', id_suffix)
if context is None:
context = {}
context.update({
context = {
'js_templates': js_templates,
'id_suffix': id_suffix,
'fields': self.fields,
'self': self,
'data': urllib.quote(json.dumps(self.data)),
})
}

fragment = Fragment()
fragment.add_content(loader.render_template('/templates/html/drag_and_drop_edit.html', context))

fragment.add_content(loader.render_django_template('/templates/html/drag_and_drop_edit.html',
context=context,
i18n_service=self.i18n_service))
css_urls = (
'public/css/drag_and_drop_edit.css',
)
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
git+https://github.com/edx/xblock-utils.git@v1.0.4#egg=xblock-utils==1.0.4
# FIXME -- bump version to 1.1.0 when https://github.com/edx/xblock-utils/pull/48 merges
git+https://github.com/open-craft/xblock-utils.git@MCKIN-7023-template-i18n#egg=xblock-utils==1.1.0
git+https://github.com/edx/XBlock.git@xblock-0.5.0#egg=XBlock==0.5.0
-e .

0 comments on commit c9dbe04

Please sign in to comment.