fix: Update text of new clipboard menu, hide it in libraries (#32339)

* fix: Use clearer name for the new "Copy" action ("Copy to Clipboard")

* fix: Don't show the new copy menu in content libraries (not yet supported)
This commit is contained in:
Braden MacDonald
2023-06-01 11:36:53 -07:00
committed by GitHub
parent 25139a08bd
commit b70252db94
2 changed files with 6 additions and 4 deletions

View File

@@ -305,8 +305,10 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False):
selected_groups_label = _('Access restricted to: {list_of_groups}').format(list_of_groups=selected_groups_label) # lint-amnesty, pylint: disable=line-too-long
course = modulestore().get_course(xblock.location.course_key)
can_edit = context.get('can_edit', True)
# Is this a course or a library?
is_course = xblock.scope_ids.usage_id.context_key.is_course
# Copy-paste is a new feature; while we are beta-testing it, only beta users with the Waffle flag enabled see it
enable_copy_paste = can_edit and ENABLE_COPY_PASTE_FEATURE.is_enabled()
enable_copy_paste = can_edit and is_course and ENABLE_COPY_PASTE_FEATURE.is_enabled()
template_context = {
'xblock_context': context,
'xblock': xblock,
@@ -316,10 +318,10 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False):
'is_reorderable': is_reorderable,
'can_edit': can_edit,
'enable_copy_paste': enable_copy_paste,
'can_edit_visibility': context.get('can_edit_visibility', xblock.scope_ids.usage_id.context_key.is_course),
'can_edit_visibility': context.get('can_edit_visibility', is_course),
'selected_groups_label': selected_groups_label,
'can_add': context.get('can_add', True),
'can_move': context.get('can_move', xblock.scope_ids.usage_id.context_key.is_course),
'can_move': context.get('can_move', is_course),
'language': getattr(course, 'language', None)
}

View File

@@ -147,7 +147,7 @@ block_is_unit = is_unit(xblock)
<ul>
% if not show_inline:
<li class="nav-item">
<a class="copy-button" href="#" role="button">${_("Copy")}</a>
<a class="copy-button" href="#" role="button">${_("Copy to Clipboard")}</a>
</li>
% if can_add:
<li class="nav-item">