feat: change text xblock title to 'Text' v2 (#30578)

This commit is contained in:
Raymond Zhou
2022-06-13 11:13:08 -07:00
committed by GitHub
parent afdd7a5691
commit d1394922ae
4 changed files with 60 additions and 3 deletions

View File

@@ -427,13 +427,16 @@ def xblock_view_handler(request, usage_key_string, view_name):
# Note that the container view recursively adds headers into the preview fragment,
# so only the "Pages" view requires that this extra wrapper be included.
display_label = xblock.display_name or xblock.scope_ids.block_type
if not xblock.display_name and xblock.scope_ids.block_type == 'html':
display_label = _("Text")
if is_pages_view:
fragment.content = render_to_string('component.html', {
'xblock_context': context,
'xblock': xblock,
'locator': usage_key,
'preview': fragment.content,
'label': xblock.display_name or xblock.scope_ids.block_type,
'label': display_label,
})
else:
raise Http404