Remove state summary from the unit author page until SOL-192
This commit is contained in:
committed by
E. Kolpakov
parent
376e698764
commit
5f5b41d03f
@@ -263,21 +263,8 @@ class LibraryContentModule(LibraryContentFields, XModule, StudioEditableModule):
|
||||
'display_name': self.display_name or self.url_name,
|
||||
}))
|
||||
self.render_children(context, fragment, can_reorder=False, can_add=False)
|
||||
else:
|
||||
# When shown on a unit page, don't show any sort of preview - just the status of this block.
|
||||
library_names = []
|
||||
lib_tools = self.runtime.service(self, 'library_tools')
|
||||
for library_key, version in self.source_libraries: # pylint: disable=unused-variable
|
||||
lib_name = lib_tools.get_library_display_name(library_key)
|
||||
if lib_name is not None:
|
||||
library_names.append(lib_name)
|
||||
# else: When shown on a unit page, don't show any sort of preview - just the status of this block in the validation area.
|
||||
|
||||
if library_names:
|
||||
fragment.add_content(self.system.render_template('library-block-author-view.html', {
|
||||
'library_names': library_names,
|
||||
'max_count': self.max_count,
|
||||
'num_children': len(self.children), # pylint: disable=no-member
|
||||
}))
|
||||
# The following JS is used to make the "Update now" button work on the unit page and the container view:
|
||||
fragment.add_javascript_url(self.runtime.local_resource_url(self, 'public/js/library_content_edit.js'))
|
||||
fragment.initialize_js('LibraryContentAuthorView')
|
||||
|
||||
@@ -146,7 +146,7 @@ class StudioLibraryContainerTest(ContainerBase, StudioLibraryTest):
|
||||
library_block = self._get_library_xblock_wrapper(self.unit_page.xblocks[0])
|
||||
|
||||
self.assertFalse(library_block.has_validation_warning)
|
||||
self.assertIn("3 matching components", library_block.author_content)
|
||||
#self.assertIn("3 matching components", library_block.author_content) # Removed this assert until a summary message is added back to the author view (SOL-192)
|
||||
|
||||
self.library_fixture.create_xblock(self.library_fixture.library_location, XBlockFixtureDesc("html", "Html4"))
|
||||
|
||||
@@ -161,4 +161,4 @@ class StudioLibraryContainerTest(ContainerBase, StudioLibraryTest):
|
||||
library_block = self._get_library_xblock_wrapper(self.unit_page.xblocks[0])
|
||||
|
||||
self.assertFalse(library_block.has_validation_message)
|
||||
self.assertIn("4 matching components", library_block.author_content)
|
||||
#self.assertIn("4 matching components", library_block.author_content) # Removed this assert until a summary message is added back to the author view (SOL-192)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<%!
|
||||
from django.utils.translation import ungettext
|
||||
%>
|
||||
<div class="xblock-header-secondary">
|
||||
<p>${ungettext(
|
||||
'This component will be replaced by {max_count} component randomly chosen from the {num_children} matching components in {lib_names}.',
|
||||
'This component will be replaced by {max_count} components randomly chosen from the {num_children} matching components in {lib_names}.',
|
||||
max_count
|
||||
).format(max_count=max_count, num_children=num_children, lib_names=', '.join(library_names))}</p>
|
||||
</div>
|
||||
Reference in New Issue
Block a user