Merge pull request #14335 from mauro-miatello/develop
Copy encrypted custom fields
This commit is contained in:
commit
fcb2bf7fea
2 changed files with 22 additions and 11 deletions
|
@ -415,6 +415,7 @@
|
||||||
|
|
||||||
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
|
@if ($field->isFieldDecryptable($asset->{$field->db_column_name()} ))
|
||||||
@can('assets.view.encrypted_custom_fields')
|
@can('assets.view.encrypted_custom_fields')
|
||||||
|
<span class="js-copy-{{ $field->id }}">
|
||||||
@if (($field->format=='URL') && ($asset->{$field->db_column_name()}!=''))
|
@if (($field->format=='URL') && ($asset->{$field->db_column_name()}!=''))
|
||||||
<a href="{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}" target="_new">{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}</a>
|
<a href="{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}" target="_new">{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}</a>
|
||||||
@elseif (($field->format=='DATE') && ($asset->{$field->db_column_name()}!=''))
|
@elseif (($field->format=='DATE') && ($asset->{$field->db_column_name()}!=''))
|
||||||
|
@ -422,6 +423,10 @@
|
||||||
@else
|
@else
|
||||||
{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}
|
{{ Helper::gracefulDecrypt($field, $asset->{$field->db_column_name()}) }}
|
||||||
@endif
|
@endif
|
||||||
|
</span>
|
||||||
|
<i class="fa-regular fa-clipboard js-copy-link" data-clipboard-target=".js-copy-{{ $field->id }}" aria-hidden="true" data-tooltip="true" data-placement="top" title="{{ trans('general.copy_to_clipboard') }}">
|
||||||
|
<span class="sr-only">{{ trans('general.copy_to_clipboard') }}</span>
|
||||||
|
</i>
|
||||||
@else
|
@else
|
||||||
{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}
|
{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}
|
||||||
@endcan
|
@endcan
|
||||||
|
|
|
@ -960,7 +960,13 @@
|
||||||
var clipboard = new ClipboardJS('.js-copy-link');
|
var clipboard = new ClipboardJS('.js-copy-link');
|
||||||
|
|
||||||
clipboard.on('success', function(e) {
|
clipboard.on('success', function(e) {
|
||||||
$('.js-copy-link').tooltip('hide').attr('data-original-title', '{{ trans('general.copied') }}').tooltip('show');
|
// Get the clicked element
|
||||||
|
var clickedElement = $(e.trigger);
|
||||||
|
// Get the target element selector from data attribute
|
||||||
|
var targetSelector = clickedElement.data('data-clipboard-target');
|
||||||
|
// Find the target element
|
||||||
|
var targetEl = $(targetSelector);
|
||||||
|
clickedElement.tooltip('hide').attr('data-original-title', '{{ trans('general.copied') }}').tooltip('show');
|
||||||
});
|
});
|
||||||
|
|
||||||
// ignore: 'input[type=hidden]' is required here to validate the select2 lists
|
// ignore: 'input[type=hidden]' is required here to validate the select2 lists
|
||||||
|
|
Loading…
Add table
Reference in a new issue