only my meetups events calendar stream url added

This commit is contained in:
HolgerHatGarKeineNode
2023-03-16 15:43:58 +01:00
parent 6604b4c806
commit 4066b9fca2
17 changed files with 100 additions and 26 deletions

View File

@@ -24,6 +24,15 @@ class DownloadMeetupCalendar extends Controller
->findOrFail($request->input('meetup'));
$events = $meetup->meetupEvents;
$image = $meetup->getFirstMediaUrl('logo');
} elseif ($request->has('my')) {
$ids = auth()->user()->meetups->pluck('id')->toArray();
$events = MeetupEvent::query()
->with([
'meetup',
])
->whereHas('meetup', fn($query) => $query->whereIn('meetups.id', $ids))
->get();
$image = asset('img/einundzwanzig-horizontal.png');
} else {
$events = MeetupEvent::query()
->with([

View File

@@ -4,6 +4,7 @@ namespace App\Http\Livewire\Meetup;
use App\Models\Country;
use App\Models\MeetupEvent;
use App\Traits\HasMapEmbedCodeTrait;
use Livewire\Component;
use RalphJSmit\Laravel\SEO\Support\SEOData;
use WireUi\Traits\Actions;
@@ -11,6 +12,7 @@ use WireUi\Traits\Actions;
class MeetupEventTable extends Component
{
use Actions;
use HasMapEmbedCodeTrait;
public Country $country;

View File

@@ -4,21 +4,16 @@ namespace App\Http\Livewire\Meetup;
use App\Models\Country;
use App\Models\Meetup;
use App\Traits\HasMapEmbedCodeTrait;
use Livewire\Component;
use RalphJSmit\Laravel\SEO\Support\SEOData;
class MeetupTable extends Component
{
use HasMapEmbedCodeTrait;
public Country $country;
public string $mapEmbedCode = '';
public function mount()
{
$this->mapEmbedCode = '<iframe src="'.url()->route('meetup.embed.countryMap',
['country' => $this->country->code]).'" width="100%" height="500" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>';
}
public function filterByMarker($id)
{
$meetup = Meetup::with(['city.country'])

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Traits;
trait HasMapEmbedCodeTrait
{
public string $mapEmbedCode = '';
public function mountHasMapEmbedCodeTrait()
{
$this->mapEmbedCode = '<iframe src="'.url()->route('meetup.embed.countryMap',
['country' => $this->country->code]).'" width="100%" height="500" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>';
}
}

View File

@@ -856,5 +856,6 @@
"Click on any of the authors to see their articles.": "Klicke auf einen der Autoren, um die Artikel zu lesen.",
"articles": "Artikel",
"Participation confirmed": "Teilnahme bestätigt",
"There was an error on row :row. :message": "Es gab einen Fehler in Zeile :row. :message"
"There was an error on row :row. :message": "Es gab einen Fehler in Zeile :row. :message",
"Calendar Stream-Url for my meetups only": "Calendar Stream-Url nur für meine Meetups"
}

View File

@@ -855,5 +855,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -855,5 +855,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -856,5 +856,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -856,5 +856,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -856,5 +856,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -856,5 +856,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -856,5 +856,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -856,5 +856,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -818,5 +818,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -830,5 +830,7 @@
"articles": "",
"Participation confirmed": "",
"Perhabs": "",
"There was an error on row :row. :message": ""
"There was an error on row :row. :message": "",
"Calendar Stream-Url for my meetups only": "",
"Calendar Stream-Url for my meetups": ""
}

View File

@@ -6,15 +6,37 @@
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4" id="table">
<div>
<div class="w-full flex justify-end my-2">
<x-button
x-data="{
<div class="flex flex-col space-y-2">
<x-button
x-data="{
textToCopy: '{{ route('meetup.ics', ['country' => $country]) }}',
}"
@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'});"
amber>
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
{{ __('Calendar Stream-Url for all meetup events') }}
</x-button>
@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'});"
amber>
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
{{ __('Calendar Stream-Url for all meetup events') }}
</x-button>
<x-button
x-data="{
textToCopy: '{{ route('meetup.ics', ['country' => $country, 'my' => true]) }}',
}"
@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>
<x-button
x-data="{
textToCopy: '{{ $mapEmbedCode }}',
}"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'{{ __('Embed code for the map copied!') }}',icon:'success'});"
amber>
<i class="fa fa-thin fa-code mr-2"></i>
{{ __('Copy embed code for the map') }} <img class="h-6 rounded"
src="{{ asset('vendor/blade-country-flags/4x3-'. $country->code .'.svg') }}"
alt="{{ $country->code }}">
</x-button>
</div>
</div>
<div class="flex items-start">
<div class="w-full sm:w-1/2">
@@ -32,6 +54,7 @@
.calendar {
max-height: 280px;
}
.calendar .calendar-header {
background-color: #F7931A;
color: white;

View File

@@ -15,6 +15,15 @@
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
{{ __('Calendar Stream-Url for all meetup events') }}
</x-button>
<x-button
x-data="{
textToCopy: '{{ route('meetup.ics', ['country' => $country, 'my' => true]) }}',
}"
@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>
<x-button
x-data="{
textToCopy: '{{ $mapEmbedCode }}',