Merge pull request #11697 from open-craft/agaylard/TNL-3429-D
TNL-3429: implement display_name_with_default for studio text sanitation
This commit is contained in:
@@ -886,7 +886,7 @@ def create_xblock_info(xblock, data=None, metadata=None, include_ancestor_info=F
|
||||
|
||||
xblock_info = {
|
||||
"id": unicode(xblock.location),
|
||||
"display_name": xblock.display_name_with_default_escaped,
|
||||
"display_name": xblock.display_name_with_default,
|
||||
"category": xblock.category,
|
||||
"edited_on": get_default_time_display(xblock.subtree_edited_on) if xblock.subtree_edited_on else None,
|
||||
"published": published,
|
||||
@@ -1158,4 +1158,4 @@ def _xblock_type_and_display_name(xblock):
|
||||
"""
|
||||
return _('{section_or_subsection} "{display_name}"').format(
|
||||
section_or_subsection=xblock_type_display_name(xblock),
|
||||
display_name=xblock.display_name_with_default_escaped)
|
||||
display_name=xblock.display_name_with_default)
|
||||
|
||||
@@ -85,11 +85,11 @@ if (is_proctored_exam) {
|
||||
<% } %>
|
||||
<% if (xblockInfo.isVertical()) { %>
|
||||
<span class="unit-title item-title">
|
||||
<a href="<%= xblockInfo.get('studio_url') %>"><%= xblockInfo.get('display_name') %></a>
|
||||
<a href="<%= xblockInfo.get('studio_url') %>"><%- xblockInfo.get('display_name') %></a>
|
||||
</span>
|
||||
<% } else { %>
|
||||
<span class="wrapper-<%= xblockType %>-title wrapper-xblock-field incontext-editor is-editable" data-field="display_name" data-field-display-name="<%= gettext("Display Name") %>">
|
||||
<span class="<%= xblockType %>-title item-title xblock-field-value incontext-editor-value"><%= xblockInfo.get('display_name') %></span>
|
||||
<span class="<%= xblockType %>-title item-title xblock-field-value incontext-editor-value"><%- xblockInfo.get('display_name') %></span>
|
||||
</span>
|
||||
<% } %>
|
||||
</h3>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="<%= xblockType %>-header">
|
||||
<h3 class="<%= xblockType %>-header-details">
|
||||
<span class="<%= xblockType %>-title item-title">
|
||||
<a href="<%= xblockInfo.get('studio_url') %>"><%= xblockInfo.get('display_name') %></a>
|
||||
<a href="<%= xblockInfo.get('studio_url') %>"><%- xblockInfo.get('display_name') %></a>
|
||||
</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
<% } %>
|
||||
|
||||
<% if (xblockInfo.get('studio_url') && xblockInfo.get('category') !== 'chapter') { %>
|
||||
<a href="<%= xblockInfo.get('studio_url') %>"><%= xblockInfo.get('display_name') %></a>
|
||||
<a href="<%= xblockInfo.get('studio_url') %>"><%- xblockInfo.get('display_name') %></a>
|
||||
<% } else { %>
|
||||
<span class="wrapper-xblock-field is-editable" data-field="display_name">
|
||||
<span class="xblock-field-value"><%= xblockInfo.get('display_name') %></span>
|
||||
<span class="xblock-field-value"><%- xblockInfo.get('display_name') %></span>
|
||||
</span>
|
||||
<% } %>
|
||||
</h3>
|
||||
|
||||
@@ -11,7 +11,7 @@ xblock_url = xblock_studio_url(xblock)
|
||||
show_inline = xblock.has_children and not xblock_url
|
||||
section_class = "level-nesting" if show_inline else "level-element"
|
||||
collapsible_class = "is-collapsible" if xblock.has_children else ""
|
||||
label = xblock.display_name_with_default_escaped or xblock.scope_ids.block_type
|
||||
label = xblock.display_name_with_default or xblock.scope_ids.block_type
|
||||
messages = xblock.validate().to_json()
|
||||
%>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user