mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
only my meetups events calendar stream url added
This commit is contained in:
@@ -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([
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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'])
|
||||
|
||||
15
app/Traits/HasMapEmbedCodeTrait.php
Normal file
15
app/Traits/HasMapEmbedCodeTrait.php
Normal 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>';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
<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">
|
||||
<div class="flex flex-col space-y-2">
|
||||
<x-button
|
||||
x-data="{
|
||||
textToCopy: '{{ route('meetup.ics', ['country' => $country]) }}',
|
||||
@@ -15,6 +16,27 @@
|
||||
<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;
|
||||
|
||||
@@ -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 }}',
|
||||
|
||||
Reference in New Issue
Block a user