closes #21 feat: add calendar stream URL to meetups

This commit adds a calendar stream URL to each meetup. The URL is copied to
the clipboard when the user clicks on a new button added to the UI. The copied
URL can be pasted into a compatible calendar app, allowing the user to easily
add the meetup to their calendar. This feature was added to several views
including 'profile/meetups', 'meetup/landing-page', and
'meetup/landing-page-event'. The associated controller 'DownloadMeetupCalendar'
and livewire components were also updated accordingly.
This commit is contained in:
HolgerHatGarKeineNode
2024-01-07 10:31:39 +01:00
parent 93d3858f30
commit 7b8d32807c
6 changed files with 127 additions and 56 deletions

View File

@@ -13,6 +13,19 @@
{{ __('Select one or more meetup groups so that you can get access to these groups in the backend.') }}
</p>
</div>
<div class="flex flex-col space-y-2">
@if(auth()->check() && auth()->user()->meetups->count() > 0)
<x-button
x-data="{
textToCopy: '{{ route('meetup.ics', ['country' => 'de', 'my' => auth()->user()->meetups->pluck('id')->toArray()]) }}',
}"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'{{ __('Calendar Stream Url copied!') }}',description:'{{ __('Paste the calendar stream link into a compatible calendar app.') }}',icon:'success'});"
black>
<i class="fa fa-thin fa-calendar-heart mr-2"></i>
{{ __('Calendar Stream-Url for my meetups only') }}
</x-button>
@endif
</div>
</div>
</section>
@@ -24,11 +37,24 @@
</p>
<div class="grid grid-cols-1 gap-2">
@foreach($myMeetupNames as $myMeetup)
<a href="{{ $myMeetup['link'] }}">
<x-badge
class="whitespace-nowrap" lg outline white
label="{{ $myMeetup['name'] }}"/>
</a>
<div class="flex items-center space-x-2">
<div>
<a href="{{ $myMeetup['link'] }}">
<x-badge
class="whitespace-nowrap" lg outline white
label="{{ $myMeetup['name'] }}"/>
</a>
</div>
<div>
<x-badge
x-data="{}"
@click.prevent="window.navigator.clipboard.writeText('{{ $myMeetup['ics'] }}');window.$wireui.notify({title:'{{ __('Calendar Stream Url copied!') }}',description:'{{ __('Paste the calendar stream link into a compatible calendar app.') }}',icon:'success'});"
primary lg class="whitespace-nowrap cursor-pointer">
<i class="fa fa-thin fa-calendar-circle-exclamation mr-2"></i>
{{ __('Calendar') }}
</x-badge>
</div>
</div>
@endforeach
</div>
</div>