Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: itembank green button #35706

Merged
merged 3 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cms/djangoapps/contentstore/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion cms/djangoapps/contentstore/views/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
'discussion',
'library',
'library_v2', # Not an XBlock
'itembank',
'html',
'openassessment',
'problem',
Expand Down Expand Up @@ -107,7 +108,7 @@ def _load_mixed_class(category):
Load an XBlock by category name, and apply all defined mixins
"""
# Libraries v2 content doesn't have an XBlock.
if category == 'library_v2':
if category in ('library_v2', 'itembank'):
return None
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is the case for itembank too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DanielVZ96 unlike library_v2, itembank is actually a real XBlock tag (the class is ItemBankBlock), so it'd be fine to let this function return the mixed class.

(The only thing that this function's return value is used for is templates, which ItemBankBlock doesn't currently use, so you're change here technically isn't breaking anything. Still, I'd rather you revert this line so that we can minimize the number of special cases.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed with 7127d43


component_class = XBlock.load_class(category)
Expand Down Expand Up @@ -262,6 +263,7 @@ def create_support_legend_dict():
'openassessment': _("Open Response"),
'library': _("Legacy Library"),
'library_v2': _("Library Content"),
'itembank': _("Problem Bank"),
'drag-and-drop-v2': _("Drag and Drop"),
}

Expand Down Expand Up @@ -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]


Expand Down
Binary file added cms/static/images/large-itembank-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions cms/static/sass/assets/_graphics.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Loading