fix: refactor MakoService to allow specifying namespace per template (#33061)
This commit is contained in:
@@ -186,7 +186,7 @@ class PureXBlock(XBlock):
|
||||
Renders the output that a student will see.
|
||||
"""
|
||||
fragment = Fragment()
|
||||
fragment.add_content(self.runtime.service(self, 'mako').render_template('edxmako.html', context))
|
||||
fragment.add_content(self.runtime.service(self, 'mako').render_lms_template('edxmako.html', context))
|
||||
return fragment
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class AuthoringMixin(XBlockMixin):
|
||||
"""
|
||||
fragment = Fragment()
|
||||
from cms.djangoapps.contentstore.utils import reverse_course_url
|
||||
fragment.add_content(self.runtime.service(self, 'mako').render_template('visibility_editor.html', {
|
||||
fragment.add_content(self.runtime.service(self, 'mako').render_cms_template('visibility_editor.html', {
|
||||
'xblock': self,
|
||||
'manage_groups_url': reverse_course_url('group_configurations_list_handler', self.location.course_key),
|
||||
}))
|
||||
|
||||
15
cms/templates/library-block-author-preview-header.html
Normal file
15
cms/templates/library-block-author-preview-header.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<%page expression_filter="h"/>
|
||||
<%! from django.utils.translation import ngettext %>
|
||||
<div class="wrapper-xblock-message">
|
||||
<div class="xblock-message information">
|
||||
<p>
|
||||
<span class="message-text">
|
||||
${ngettext(
|
||||
'Showing all matching content eligible to be added into {display_name}. Each student will be assigned {max_count} component drawn randomly from this list.',
|
||||
'Showing all matching content eligible to be added into {display_name}. Each student will be assigned {max_count} components drawn randomly from this list.',
|
||||
max_count
|
||||
).format(max_count=max_count, display_name=display_name)}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user