share url

This commit is contained in:
Benjamin Takats
2023-01-16 18:13:35 +01:00
parent fa8875b949
commit e4d03510f7
3 changed files with 19 additions and 5 deletions

View File

@@ -1,20 +1,30 @@
<div>
@if(str($row->value)->contains('http'))
<x-button amber :href="$row->value" target="_blank">
<x-button xs amber :href="$row->value" target="_blank">
<i class="fa fa-thin fa-book-open mr-2"></i>
{{ __('Open') }}
</x-button>
@endif
@if($row->type === 'downloadable_file')
<x-button amber :href="$row->getFirstMediaUrl('single_file')" target="_blank">
<x-button xs amber :href="$row->getFirstMediaUrl('single_file')" target="_blank">
<i class="fa fa-thin fa-download mr-2"></i>
{{ __('Download') }}
</x-button>
@endif
@if($row->type === 'podcast_episode')
<x-button amber :href="$row->episode->data['enclosureUrl']" target="_blank">
<x-button xs amber :href="$row->episode->data['enclosureUrl']" target="_blank">
<i class="fa fa-thin fa-headphones mr-2"></i>
{{ __('Listen') }}
</x-button>
@endif
<x-button
x-data="{
textToCopy: '{{ url()->route('library.table.libraryItems', ['country' => 'de', 'table' => ['filters' => ['id' => $row->id]]]) }}',
}"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'{{ __('Share url copied!') }}',icon:'success'});"
xs black>
<i class="fa fa-thin fa-copy mr-2"></i>
{{ __('Share link') }}
</x-button>
</div>