mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
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:
@@ -19,7 +19,7 @@ class DownloadMeetupCalendar extends Controller
|
|||||||
if ($request->has('meetup')) {
|
if ($request->has('meetup')) {
|
||||||
$meetup = Meetup::query()
|
$meetup = Meetup::query()
|
||||||
->with([
|
->with([
|
||||||
'meetupEvents',
|
'meetupEvents.meetup',
|
||||||
])
|
])
|
||||||
->findOrFail($request->input('meetup'));
|
->findOrFail($request->input('meetup'));
|
||||||
$events = $meetup->meetupEvents;
|
$events = $meetup->meetupEvents;
|
||||||
|
|||||||
@@ -20,7 +20,11 @@ class LandingPage extends Component
|
|||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
$this->meetup->load([
|
$this->meetup
|
||||||
|
->loadCount([
|
||||||
|
'meetupEvents'
|
||||||
|
])
|
||||||
|
->load([
|
||||||
'media',
|
'media',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,11 @@ class Meetups extends Component
|
|||||||
'link' => route('meetup.landing', [
|
'link' => route('meetup.landing', [
|
||||||
'country' => $meetup->city->country->code,
|
'country' => $meetup->city->country->code,
|
||||||
'meetup' => $meetup,
|
'meetup' => $meetup,
|
||||||
])
|
]),
|
||||||
|
'ics' => route('meetup.ics', [
|
||||||
|
'country' => $meetup->city->country->code,
|
||||||
|
'meetup' => $meetup,
|
||||||
|
]),
|
||||||
])
|
])
|
||||||
->toArray();
|
->toArray();
|
||||||
if (count($this->myMeetups) > 0) {
|
if (count($this->myMeetups) > 0) {
|
||||||
@@ -121,7 +125,11 @@ class Meetups extends Component
|
|||||||
'link' => route('meetup.landing', [
|
'link' => route('meetup.landing', [
|
||||||
'country' => $meetup->city->country->code,
|
'country' => $meetup->city->country->code,
|
||||||
'meetup' => $meetup,
|
'meetup' => $meetup,
|
||||||
])
|
]),
|
||||||
|
'ics' => route('meetup.ics', [
|
||||||
|
'country' => $meetup->city->country->code,
|
||||||
|
'meetup' => $meetup,
|
||||||
|
]),
|
||||||
])
|
])
|
||||||
->toArray();
|
->toArray();
|
||||||
$this->notification()
|
$this->notification()
|
||||||
|
|||||||
@@ -269,6 +269,27 @@
|
|||||||
</div>
|
</div>
|
||||||
@endauth
|
@endauth
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col space-y-2">
|
||||||
|
<x-button
|
||||||
|
x-data="{}"
|
||||||
|
@click.prevent="window.navigator.clipboard.writeText('{{ route('meetup.ics', ['country' => $this->country ?? $meetup->city->country->code, 'meetup' => $meetup]) }}');window.$wireui.notify({title:'{{ __('Calendar Stream Url copied!') }}',description:'{{ __('Paste the calendar stream link into a compatible calendar app.') }}',icon:'success'});"
|
||||||
|
primary class="mt-4 whitespace-nowrap">
|
||||||
|
<i class="fa fa-thin fa-calendar-circle-exclamation mr-2"></i>
|
||||||
|
{{ __('Calendar Stream-Url') }} {{ $meetup->name }}
|
||||||
|
</x-button>
|
||||||
|
@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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -73,11 +73,20 @@
|
|||||||
|
|
||||||
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4">
|
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4">
|
||||||
|
|
||||||
<section class="h-auto px-10 py-16">
|
<section class="h-auto py-16">
|
||||||
<div class="max-w-3xl mx-auto space-y-4 sm:text-center">
|
<div class="mx-auto space-y-4 sm:text-center">
|
||||||
<h2 class="text-4xl sm:text-5xl font-semibold text-white">
|
<div class="flex space-x-4 items-baseline">
|
||||||
{{ __('Events') }}
|
<div class="text-4xl sm:text-5xl font-semibold text-white">{{ __('Events') }}</div>
|
||||||
</h2>
|
<div>
|
||||||
|
<x-button
|
||||||
|
x-data="{}"
|
||||||
|
@click.prevent="window.navigator.clipboard.writeText('{{ route('meetup.ics', ['country' => $this->country ?? $meetup->city->country->code, 'meetup' => $meetup]) }}');window.$wireui.notify({title:'{{ __('Calendar Stream Url copied!') }}',description:'{{ __('Paste the calendar stream link into a compatible calendar app.') }}',icon:'success'});"
|
||||||
|
primary lg class="mt-4 whitespace-nowrap">
|
||||||
|
<i class="fa fa-thin fa-calendar-circle-exclamation mr-2"></i>
|
||||||
|
{{ __('Calendar Stream-Url') }}
|
||||||
|
</x-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -86,7 +95,8 @@
|
|||||||
@php
|
@php
|
||||||
$activeClass = $activeEvent === $meetupEvent->id ? 'bg-gradient-to-r from-amber-800 via-amber-600 to-amber-500' : 'bg-amber-500';
|
$activeClass = $activeEvent === $meetupEvent->id ? 'bg-gradient-to-r from-amber-800 via-amber-600 to-amber-500' : 'bg-amber-500';
|
||||||
@endphp
|
@endphp
|
||||||
<li id="meetupEventId_{{ $meetupEvent->id }}" class="{{ $activeClass }} col-span-1 flex flex-col divide-y divide-gray-200 rounded-lg text-center shadow-2xl">
|
<li id="meetupEventId_{{ $meetupEvent->id }}"
|
||||||
|
class="{{ $activeClass }} col-span-1 flex flex-col divide-y divide-gray-200 rounded-lg text-center shadow-2xl">
|
||||||
<div class="flex flex-1 flex-col p-8">
|
<div class="flex flex-1 flex-col p-8">
|
||||||
{{--<img class="mx-auto h-32 w-32 object-contain flex-shrink-0 rounded"
|
{{--<img class="mx-auto h-32 w-32 object-contain flex-shrink-0 rounded"
|
||||||
src="{{ $meetupEvent->meetup->getFirstMediaUrl('logo') }}"
|
src="{{ $meetupEvent->meetup->getFirstMediaUrl('logo') }}"
|
||||||
@@ -117,7 +127,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
<div x-show="expanded" x-collapse>
|
<div x-show="expanded" x-collapse>
|
||||||
<div class="px-6 pb-4 text-left">{!! nl2br($meetupEvent->description) !!}</div>
|
<div
|
||||||
|
class="px-6 pb-4 text-left">{!! nl2br($meetupEvent->description) !!}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -126,7 +137,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="-mt-px flex divide-x divide-gray-200">
|
<div class="-mt-px flex divide-x divide-gray-200">
|
||||||
<div class="-ml-px flex w-0 flex-1">
|
<div class="-ml-px flex w-0 flex-1">
|
||||||
<a target="_blank" href="{{ route('meetup.event.landing', ['country' => $country, 'meetupEvent' => $meetupEvent]) }}"
|
<a target="_blank"
|
||||||
|
href="{{ route('meetup.event.landing', ['country' => $country, 'meetupEvent' => $meetupEvent]) }}"
|
||||||
class="relative inline-flex w-0 flex-1 items-center justify-center rounded-br-lg border border-transparent py-4 text-sm font-medium text-gray-700 hover:text-gray-500">
|
class="relative inline-flex w-0 flex-1 items-center justify-center rounded-br-lg border border-transparent py-4 text-sm font-medium text-gray-700 hover:text-gray-500">
|
||||||
<i class="text-gray-100 text-2xl fa-thin fa-right-to-bracket"></i>
|
<i class="text-gray-100 text-2xl fa-thin fa-right-to-bracket"></i>
|
||||||
<span class="ml-3 text-gray-100 text-2xl">{{ __('Link to participate') }}</span>
|
<span class="ml-3 text-gray-100 text-2xl">{{ __('Link to participate') }}</span>
|
||||||
|
|||||||
@@ -13,6 +13,19 @@
|
|||||||
{{ __('Select one or more meetup groups so that you can get access to these groups in the backend.') }}
|
{{ __('Select one or more meetup groups so that you can get access to these groups in the backend.') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -24,11 +37,24 @@
|
|||||||
</p>
|
</p>
|
||||||
<div class="grid grid-cols-1 gap-2">
|
<div class="grid grid-cols-1 gap-2">
|
||||||
@foreach($myMeetupNames as $myMeetup)
|
@foreach($myMeetupNames as $myMeetup)
|
||||||
|
<div class="flex items-center space-x-2">
|
||||||
|
<div>
|
||||||
<a href="{{ $myMeetup['link'] }}">
|
<a href="{{ $myMeetup['link'] }}">
|
||||||
<x-badge
|
<x-badge
|
||||||
class="whitespace-nowrap" lg outline white
|
class="whitespace-nowrap" lg outline white
|
||||||
label="{{ $myMeetup['name'] }}"/>
|
label="{{ $myMeetup['name'] }}"/>
|
||||||
</a>
|
</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
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user