feat: itembank green button (#35706)

Adds Problem Bank to the main New Components buttons.

For the Libraries Relaunch Beta [FC-0062]

Part of: https://github.com/openedx/frontend-app-authoring/issues/1415

Co-authored-by: Jillian Vogel <jill@opencraft.com>
This commit is contained in:
Daniel Valenzuela
2024-10-23 09:33:05 -03:00
committed by GitHub
parent af21100939
commit 085b15a014
4 changed files with 12 additions and 0 deletions

View File

@@ -192,6 +192,8 @@ def xblock_type_display_name(xblock, default_display_name=None):
return _('Problem')
elif category == 'library_v2':
return _('Library Content')
elif category == 'itembank':
return _('Problem Bank')
component_class = XBlock.load_class(category)
if hasattr(component_class, 'display_name') and component_class.display_name.default:
return _(component_class.display_name.default) # lint-amnesty, pylint: disable=translation-of-non-string

View File

@@ -47,6 +47,7 @@ COMPONENT_TYPES = [
'discussion',
'library',
'library_v2', # Not an XBlock
'itembank',
'html',
'openassessment',
'problem',
@@ -262,6 +263,7 @@ def get_component_templates(courselike, library=False): # lint-amnesty, pylint:
'openassessment': _("Open Response"),
'library': _("Legacy Library"),
'library_v2': _("Library Content"),
'itembank': _("Problem Bank"),
'drag-and-drop-v2': _("Drag and Drop"),
}
@@ -488,6 +490,7 @@ def _filter_disabled_blocks(all_blocks):
disabled_block_names = [block.name for block in disabled_xblocks()]
if not libraries_v2_enabled():
disabled_block_names.append('library_v2')
disabled_block_names.append('itembank')
return [block_name for block_name in all_blocks if block_name not in disabled_block_names]

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

View File

@@ -73,3 +73,10 @@
height: ($baseline*3);
background: url('#{$static-path}/images/large-library_v2-icon.png') center no-repeat;
}
.large-itembank-icon {
display: inline-block;
width: ($baseline*3);
height: ($baseline*3);
background: url('#{$static-path}/images/large-itembank-icon.png') center no-repeat;
}