OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Extract the copy to clipboard logic to a service
Dombi Attila6c73fd015350
diff --git a/app/views/repositories/_repository_header.html.erb b/app/views/repositories/_repository_header.html.erbindex 2cd08936dc1..4d56b4767d2 100644--- a/app/views/repositories/_repository_header.html.erb+++ b/app/views/repositories/_repository_header.html.erb@@ -44,9 +44,9 @@ See COPYRIGHT and LICENSE files for more details.clipboard-target="#repository-checkout-url"></copy-to-clipboard><button class="repository-checkout-copy-button toolbar-input--affix toolbar-input-group--affix -append"- title="<%= t(:label_copy_to_clipboard) %>">+ title="<%= t(:button_copy_to_clipboard) %>"><%= op_icon('icon-copy') %>- <span class="hidden-for-sighted"><%= t(:label_copy_to_clipboard) %></span>+ <span class="hidden-for-sighted"><%= t(:button_copy_to_clipboard) %></span></button></li><li class="toolbar-item -icon-only">diff --git a/config/locales/en.yml b/config/locales/en.ymlindex c47e4cabedf..256c376f8f3 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -1136,6 +1136,7 @@ en:button_configure: "Configure"button_continue: "Continue"button_copy: "Copy"+ button_copy_to_clipboard: "Copy to clipboard"button_copy_and_follow: "Copy and follow"button_create: "Create"button_create_and_continue: "Create and continue"@@ -1633,7 +1634,6 @@ en:label_contains: "contains"label_content: "Content"label_copied: "copied"- label_copy_to_clipboard: "Copy to clipboard"label_copy_same_as_target: "Same as target"label_copy_source: "Source"label_copy_target: "Target"diff --git a/config/locales/js-en.yml b/config/locales/js-en.ymlindex d4df77dd85f..63c2cad25dd 100644--- a/config/locales/js-en.yml+++ b/config/locales/js-en.yml@@ -81,6 +81,7 @@ en:button_confirm: "Confirm"button_continue: "Continue"button_copy: "Copy"+ button_copy_to_clipboard: "Copy to clipboard"button_copy_to_other_project: "Copy to other project"button_custom-fields: "Custom fields"button_delete: "Delete"diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.tsindex 12bab89882a..827a68b7047 100644--- a/frontend/src/app/app.module.ts+++ b/frontend/src/app/app.module.ts@@ -67,6 +67,7 @@ import { OpenprojectOverviewModule } from 'core-app/features/overview/openprojecimport { OpenprojectMyPageModule } from 'core-app/features/my-page/openproject-my-page.module';import { OpenprojectProjectsModule } from 'core-app/features/projects/openproject-projects.module';import { KeyboardShortcutService } from 'core-app/shared/directives/a11y/keyboard-shortcut.service';+import { CopyToClipboardService } from 'core-app/shared/components/copy-to-clipboard/copy-to-clipboard.service';import {OpenprojectMembersModule,} from 'core-app/shared/components/autocompleter/members-autocompleter/members.module';@@ -78,7 +79,6 @@ import {} from 'core-app/features/bim/revit_add_in/revit-add-in-settings-button.service';import { OpenprojectEnterpriseModule } from 'core-app/features/enterprise/openproject-enterprise.module';import { MainMenuToggleComponent } from 'core-app/core/main-menu/main-menu-toggle.component';-import { MainMenuNavigationService } from 'core-app/core/main-menu/main-menu-navigation.service';import { ConfirmDialogService } from 'core-app/shared/components/modals/confirm-dialog/confirm-dialog.service';import { ConfirmDialogModalComponent } from 'core-app/shared/components/modals/confirm-dialog/confirm-dialog.modal';import { DynamicContentModalComponent } from 'core-app/shared/components/modals/modal-wrapper/dynamic-content.modal';@@ -238,6 +238,7 @@ export function initializeServices(injector:Injector) {OpenProjectBackupService,ConfirmDialogService,RevitAddInSettingsButtonService,+ CopyToClipboardService,],declarations: [OpContextMenuTrigger,diff --git a/frontend/src/app/core/path-helper/path-helper.service.ts b/frontend/src/app/core/path-helper/path-helper.service.tsindex 33f02d6b01d..44244bc9431 100644--- a/frontend/src/app/core/path-helper/path-helper.service.ts+++ b/frontend/src/app/core/path-helper/path-helper.service.ts@@ -244,6 +244,10 @@ export class PathHelperService {return `${this.staticBase}/work_packages/${id}`;}+ public workPackageShortPath(id:string|number) {+ return `${this.staticBase}/wp/${id}`;+ }+public workPackageCopyPath(workPackageId:string|number) {return `${this.workPackagePath(workPackageId)}/copy`;}@@ -252,6 +256,20 @@ export class PathHelperService {return `${this.projectWorkPackagesPath(projectIdentifier)}/details/${workPackageId}/copy`;}+ // Work Package Bulk paths++ public workPackagesBulkEditPath() {+ return `${this.workPackagesPath()}/bulk/edit`;+ }++ public workPackagesBulkMovePath() {+ return `${this.workPackagesPath()}/move/new`;+ }++ public workPackagesBulkCopyPath() {+ return `${this.workPackagesBulkMovePath()}?copy=true`;+ }+public workPackagesBulkDeletePath() {return `${this.workPackagesPath()}/bulk`;}diff --git a/frontend/src/app/core/setup/global-dynamic-components.const.ts b/frontend/src/app/core/setup/global-dynamic-components.const.tsindex 6844163b4f8..aca0cd9a5e1 100644--- a/frontend/src/app/core/setup/global-dynamic-components.const.ts+++ b/frontend/src/app/core/setup/global-dynamic-components.const.ts@@ -74,7 +74,7 @@ import {contentTabsSelector,} from 'core-app/shared/components/tabs/content-tabs/content-tabs.component';import {- CopyToClipboardDirective,+ CopyToClipboardComponent,copyToClipboardSelector,} from 'core-app/shared/components/copy-to-clipboard/copy-to-clipboard.directive';import {@@ -254,7 +254,7 @@ export const globalDynamicComponents:OptionalBootstrapDefinition[] = [{ selector: autocompleteSelectDecorationSelector, cls: AutocompleteSelectDecorationComponent },{ selector: contentTabsSelector, cls: ContentTabsComponent },{ selector: globalSearchTitleSelector, cls: GlobalSearchTitleComponent },- { selector: copyToClipboardSelector, cls: CopyToClipboardDirective },+ { selector: copyToClipboardSelector, cls: CopyToClipboardComponent },{ selector: mainMenuResizerSelector, cls: MainMenuResizerComponent },{ selector: mainMenuToggleSelector, cls: MainMenuToggleComponent },{ selector: globalSearchSelector, cls: GlobalSearchInputComponent },diff --git a/frontend/src/app/features/work-packages/components/wp-table/context-menu-helper/wp-context-menu-helper.service.ts b/frontend/src/app/features/work-packages/components/wp-table/context-menu-helper/wp-context-menu-helper.service.tsindex f7a1185a8b9..edd69aba01e 100644--- a/frontend/src/app/features/work-packages/components/wp-table/context-menu-helper/wp-context-menu-helper.service.ts+++ b/frontend/src/app/features/work-packages/components/wp-table/context-menu-helper/wp-context-menu-helper.service.ts@@ -26,6 +26,7 @@// See COPYRIGHT and LICENSE files for more details.//++import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';+import { HalLink } from 'core-app/features/hal/hal-link/hal-link';import { Injectable } from '@angular/core';import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';import { UrlParamsHelperService } from 'core-app/features/work-packages/components/wp-query/url-params-helper';@@ -50,25 +51,25 @@ export class WorkPackageContextMenuHelperService {text: I18n.t('js.work_packages.bulk_actions.edit'),key: 'edit',link: 'update',- href: `${this.PathHelper.staticBase}/work_packages/bulk/edit`,+ href: this.PathHelper.workPackagesBulkEditPath(),},{text: I18n.t('js.work_packages.bulk_actions.move'),key: 'move',link: 'move',- href: `${this.PathHelper.staticBase}/work_packages/move/new`,+ href: this.PathHelper.workPackagesBulkMovePath(),},{text: I18n.t('js.work_packages.bulk_actions.copy'),key: 'copy',link: 'copy',- href: `${this.PathHelper.staticBase}/work_packages/move/new?copy=true`,+ href: this.PathHelper.workPackagesBulkCopyPath(),},{text: I18n.t('js.work_packages.bulk_actions.delete'),key: 'delete',link: 'delete',- href: `${this.PathHelper.staticBase}/work_packages/bulk?_method=delete`,+ href: this.PathHelper.workPackagesBulkDeletePath(),},];@@ -94,13 +95,26 @@ export class WorkPackageContextMenuHelperService {key: allowedAction.key,text: allowedAction.text,icon: allowedAction.icon,- link: allowedAction.link ? workPackage[allowedAction.link].href : undefined,+ link: this.linkForAction(workPackage, allowedAction),});});return singularPermittedActions;}+ public linkForAction(workPackage:WorkPackageResource, action:WorkPackageAction):string|undefined {+ let link:string|undefined;+ switch (action.key) {+ case 'copy_to_clipboard':+ link = this.PathHelper.workPackageShortPath(workPackage.id as string);+ break;+ default:+ link = action.link ? (workPackage[action.link as string] as HalLink).href as string : undefined;+ }++ return link;+ }+public getIntersectOfPermittedActions(workPackages:any) {const bulkPermittedActions:any = [];const possibleActions = this.BULK_ACTIONS.concat(this.HookService.call('workPackageBulkContextMenu'));@@ -139,14 +153,14 @@ export class WorkPackageContextMenuHelperService {const allowedActions:WorkPackageAction[] = [];_.each(actions, (action) => {- if (action.link && workPackage.hasOwnProperty(action.link)) {+ if (action.link && workPackage[action.link as string] !== undefined) {action.text = action.text || I18n.t(`js.button_${action.key}`);allowedActions.push(action);}});_.each(this.HookService.call('workPackageTableContextMenu'), (action) => {- if (workPackage.hasOwnProperty(action.link)) {+ if (workPackage[action.link as string] !== undefined) {const index = action.indexBy ? action.indexBy(allowedActions) : allowedActions.length;allowedActions.splice(index, 0, action);}diff --git a/frontend/src/app/features/work-packages/services/work-package-authorization.service.ts b/frontend/src/app/features/work-packages/services/work-package-authorization.service.tsindex 9240f520055..8844752d1d9 100644--- a/frontend/src/app/features/work-packages/services/work-package-authorization.service.ts+++ b/frontend/src/app/features/work-packages/services/work-package-authorization.service.ts@@ -48,6 +48,9 @@ export class WorkPackageAuthorization {case 'copy':link = this.copyLink();break;+ case 'copy_to_clipboard':+ link = this.shortLink();+ break;case 'copy_to_other_project':link = this.bulkCopyLink();break;@@ -82,6 +85,10 @@ export class WorkPackageAuthorization {return this.PathHelper.workPackageCopyPath(this.workPackage.id as string);}+ private shortLink() {+ return this.PathHelper.workPackageShortPath(this.workPackage.id as string);+ }+private bulkCopyLink():string {return `${this.PathHelper.staticBase}/work_packages/move/new?copy=true&ids[]=${this.workPackage.id as string}`;}diff --git a/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.directive.ts b/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.directive.tsindex d88b869bb3a..0d9c88cd84b 100644--- a/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.directive.ts+++ b/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.directive.ts@@ -26,18 +26,26 @@// See COPYRIGHT and LICENSE files for more details.//++-import { Component, ElementRef, OnInit } from '@angular/core';+import {+ Component,+ ChangeDetectionStrategy,+ ElementRef,+ OnInit,+} from '@angular/core';import { ToastService } from 'core-app/shared/components/toaster/toast.service';-import { ConfigurationService } from 'core-app/core/config/configuration.service';import { I18nService } from 'core-app/core/i18n/i18n.service';+import { CopyToClipboardService } from './copy-to-clipboard.service';+export const copyToClipboardSelector = 'copy-to-clipboard';@Component({template: '',selector: copyToClipboardSelector,+ changeDetection: ChangeDetectionStrategy.OnPush,})-export class CopyToClipboardDirective implements OnInit {++export class CopyToClipboardComponent implements OnInit {public clickTarget:string;public clipboardTarget:string;@@ -48,7 +56,7 @@ export class CopyToClipboardDirective implements OnInit {readonly toastService:ToastService,readonly elementRef:ElementRef,readonly I18n:I18nService,- readonly ConfigurationService:ConfigurationService,+ protected copyToClipboardService:CopyToClipboardService,) { }ngOnInit() {@@ -63,35 +71,8 @@ export class CopyToClipboardDirective implements OnInit {this.target = jQuery(this.clipboardTarget ? this.clipboardTarget : element);}- addNotification(type:'addSuccess'|'addError', message:string) {- const notification = this.toastService[type](message);-- // Remove the notification some time later- setTimeout(() => this.toastService.remove(notification), 5000);- }-onClick($event:JQuery.TriggeredEvent) {- const supported = (document.queryCommandSupported && document.queryCommandSupported('copy'));$event.preventDefault();-- // At least select the input for the user- // even when clipboard API not supported- this.target.select().focus();-- if (supported) {- try {- // Copy it to the clipboard- if (document.execCommand('copy')) {- this.addNotification('addSuccess', this.I18n.t('js.clipboard.copied_successful'));- return;- }- } catch (e) {- console.log(- `Your browser seems to support the clipboard API, but copying failed: ${e}`,- );- }- }-- this.addNotification('addError', this.I18n.t('js.clipboard.browser_error'));+ this.copyToClipboardService.copy(this.target.val()!.toString());}}diff --git a/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.service.ts b/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.service.tsnew file mode 100644index 00000000000..c8fcd3af37b--- /dev/null+++ b/frontend/src/app/shared/components/copy-to-clipboard/copy-to-clipboard.service.ts@@ -0,0 +1,88 @@+// -- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2023 the OpenProject GmbH+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License version 3.+//+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+// Copyright (C) 2006-2013 Jean-Philippe Lang+// Copyright (C) 2010-2013 the ChiliProject Team+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License+// as published by the Free Software Foundation; either version 2+// of the License, or (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+//+// See COPYRIGHT and LICENSE files for more details.+//++++import { Injectable, Renderer2, RendererFactory2 } from '@angular/core';+import { ToastService } from 'core-app/shared/components/toaster/toast.service';+import { I18nService } from 'core-app/core/i18n/i18n.service';++@Injectable({+ providedIn: 'root',+})++export class CopyToClipboardService {++ private renderer: Renderer2;++ constructor(+ readonly toastService:ToastService,+ readonly I18n:I18nService,+ readonly rendererFactory:RendererFactory2,+ ) {+ this.renderer = rendererFactory.createRenderer(null, null);+ }++ copy(content:string) {+ const supported = (document.queryCommandSupported && document.queryCommandSupported('copy'));+ const contentEl = this.appendContentEl(content);++ // At least select the input for the user+ // even when clipboard API not supported+ contentEl.select();+ contentEl.focus();+ if (supported) {+ try {+ // Copy it to the clipboard and remove the hidden input+ if (document.execCommand('copy')) {+ this.renderer.removeChild(document.body, contentEl);+ this.addNotification('addSuccess', this.I18n.t('js.clipboard.copied_successful'));+ return;+ }+ } catch (e) {+ console.log(+ `Your browser seems to support the clipboard API, but copying failed: ${e}`,+ );+ }+ }++ this.addNotification('addError', this.I18n.t('js.clipboard.browser_error'));+ }++ appendContentEl(value:string):JQuery<HTMLElement> {+ const contentEl = this.renderer.createElement('input');+ this.renderer.setAttribute(contentEl, 'value', value);+ this.renderer.appendChild(document.body, contentEl);+ return contentEl;+ }++ addNotification(type:'addSuccess'|'addError', message:string) {+ const notification = this.toastService[type](message);++ // Remove the notification some time later+ setTimeout(() => this.toastService.remove(notification), 5000);+ }+}diff --git a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-single-context-menu.tsindex 408a82c1e73..046757513d9 100644--- a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts+++ b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-single-context-menu.ts@@ -12,6 +12,7 @@ import { OPContextMenuService } from 'core-app/shared/components/op-context-menuimport { OpContextMenuItem } from 'core-app/shared/components/op-context-menu/op-context-menu.types';import { PERMITTED_CONTEXT_MENU_ACTIONS } from 'core-app/shared/components/op-context-menu/wp-context-menu/wp-static-context-menu-actions';import { OpModalService } from 'core-app/shared/components/modal/modal.service';+import { CopyToClipboardService } from 'core-app/shared/components/copy-to-clipboard/copy-to-clipboard.service';import { WorkPackageAction } from 'core-app/features/work-packages/components/wp-table/context-menu-helper/wp-context-menu-helper.service';import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';import { TimeEntryCreateService } from 'core-app/shared/components/time_entries/create/create.service';@@ -34,7 +35,9 @@ export class WorkPackageSingleContextMenuDirective extends OpContextMenuTriggerreadonly elementRef:ElementRef,readonly opModalService:OpModalService,readonly opContextMenuService:OPContextMenuService,- readonly authorisationService:AuthorisationService) {+ readonly authorisationService:AuthorisationService,+ protected copyToClipboardService:CopyToClipboardService+ ) {super(elementRef, opContextMenuService);}@@ -71,7 +74,10 @@ export class WorkPackageSingleContextMenuDirective extends OpContextMenuTrigger// do nothing, the user closed without changes});break;-+ case 'copy_to_clipboard':+ const url = new URL(link!, window.location.origin);+ this.copyToClipboardService.copy(url.toString());+ break;default:window.location.href = link!;break;diff --git a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-static-context-menu-actions.ts b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-static-context-menu-actions.tsindex eb42bb066de..5ae37beacbe 100644--- a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-static-context-menu-actions.ts+++ b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-static-context-menu-actions.ts@@ -14,6 +14,11 @@ export const PERMITTED_CONTEXT_MENU_ACTIONS:WorkPackageAction[] = [key: 'copy',link: 'copy',},+ {+ key: 'copy_to_clipboard',+ icon: 'icon-link',+ link: 'id'+ },{key: 'copy_to_other_project',link: 'copy',diff --git a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.tsindex 9ba0f9ed536..2ecb67b980e 100644--- a/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts+++ b/frontend/src/app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts@@ -17,6 +17,7 @@ import { PERMITTED_CONTEXT_MENU_ACTIONS } from 'core-app/shared/components/op-coimport { OpModalService } from 'core-app/shared/components/modal/modal.service';import { StateService } from '@uirouter/core';import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';+import { CopyToClipboardService } from 'core-app/shared/components/copy-to-clipboard/copy-to-clipboard.service';import { TimeEntryCreateService } from 'core-app/shared/components/time_entries/create/create.service';import { splitViewRoute } from 'core-app/features/work-packages/routing/split-view-routes.helper';import { WpDestroyModalComponent } from 'core-app/shared/components/modals/wp-destroy-modal/wp-destroy.modal';@@ -56,12 +57,15 @@ export class WorkPackageViewContextMenu extends OpContextMenuHandler {protected items = this.buildItems();+ private copyToClipboardService:CopyToClipboardService;+constructor(public injector:Injector,protected workPackageId:string,protected $element:JQuery,protected additionalPositionArgs:any = {},protected allowSplitScreenActions:boolean = true) {super(injector.get(OPContextMenuService));+ this.copyToClipboardService = injector.get(CopyToClipboardService);}public get locals():OpContextMenuLocalsMap {@@ -92,6 +96,11 @@ export class WorkPackageViewContextMenu extends OpContextMenuHandler {this.copySelectedWorkPackages(link!);break;+ case 'copy_to_clipboard':+ const url = new URL(link!, window.location.origin);+ this.copyToClipboardService.copy(url.toString());+ break;+case 'copy_to_other_project':window.location.href = `${this.pathHelper.staticBase}/work_packages/move/new?copy=true&ids[]=${id}`;break;diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.tsindex 02c29380b37..ac924d4e47f 100644--- a/frontend/src/app/shared/shared.module.ts+++ b/frontend/src/app/shared/shared.module.ts@@ -65,7 +65,7 @@ import {OpHighlightColDirective,} from './directives/highlight-col/highlight-col.directive';-import { CopyToClipboardDirective } from './components/copy-to-clipboard/copy-to-clipboard.directive';+import { CopyToClipboardService } from './components/copy-to-clipboard/copy-to-clipboard.service';import { OpDateTimeComponent } from './components/date/op-date-time.component';import { ToastComponent } from './components/toaster/toast.component';@@ -214,6 +214,7 @@ export function bootstrapModule(injector:Injector):void {OpNonWorkingDaysListComponent,],providers: [+ CopyToClipboardService,StaticQueriesService,ViewsResourceService,],@@ -232,10 +233,8 @@ export function bootstrapModule(injector:Injector):void {OpHighlightColDirective,// Add functionality to rails rendered templates- CopyToClipboardDirective,CollapsibleSectionComponent,- CopyToClipboardDirective,ResizerComponent,TablePaginationComponent,diff --git a/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb b/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erbindex d6f83b2f890..a11ec963120 100644--- a/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb+++ b/modules/storages/app/views/storages/admin/storages/show_oauth_application.html.erb@@ -45,9 +45,9 @@clipboard-target="#client_id"></copy-to-clipboard><button class="client-id-copy-button button -without-button-styling"- title="<%= t(:label_copy_to_clipboard) %>">+ title="<%= t(:button_copy_to_clipboard) %>"><%= op_icon('icon-copy') %>- <span class="hidden-for-sighted"><%= t(:label_copy_to_clipboard) %></span>+ <span class="hidden-for-sighted"><%= t(:button_copy_to_clipboard) %></span></button></div></div>