mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
all meetups
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Http\Livewire\Meetup;
|
||||
|
||||
use App\Models\Country;
|
||||
use App\Models\Meetup;
|
||||
use App\Models\MeetupEvent;
|
||||
use Livewire\Component;
|
||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use Rappasoft\LaravelLivewireTables\Views\Filters\TextFilter;
|
||||
|
||||
class MeetupTable extends DataTableComponent
|
||||
{
|
||||
public string $country;
|
||||
public ?string $country = null;
|
||||
|
||||
protected $model = Meetup::class;
|
||||
|
||||
@@ -69,7 +69,8 @@ class MeetupTable extends DataTableComponent
|
||||
public function builder(): Builder
|
||||
{
|
||||
return Meetup::query()
|
||||
->whereHas('city.country', fn($query) => $query->where('code', $this->country))
|
||||
->when($this->country, fn($query, $country) => $query->whereHas('city.country',
|
||||
fn($query) => $query->where('code', $this->country)))
|
||||
->withCount([
|
||||
'users',
|
||||
'meetupEvents' => fn($query) => $query->where('start', '>=', now()),
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
xs
|
||||
black
|
||||
x-data="{
|
||||
textToCopy: '{{ route('meetup.ics', ['country' => $country, 'meetup' => $row->id]) }}',
|
||||
textToCopy: '{{ route('meetup.ics', ['country' => $country ?? $row->city->country->code, 'meetup' => $row->id]) }}',
|
||||
}"
|
||||
@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'});"
|
||||
>
|
||||
@@ -31,7 +31,7 @@
|
||||
<x-button
|
||||
black
|
||||
xs
|
||||
:href="route('meetup.landing', ['country' => $country, 'meetup' => $row->slug])"
|
||||
:href="route('meetup.landing', ['country' => $country ?? $row->city->country->code, 'meetup' => $row->slug])"
|
||||
>
|
||||
<i class="fa fa-thin fa-browser mr-2"></i>
|
||||
{{ __('Show landing page') }}
|
||||
|
||||
@@ -53,6 +53,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="w-full">
|
||||
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4" id="table">
|
||||
<livewire:tables.meetup-table :country="null"/>
|
||||
</div>
|
||||
</div>
|
||||
{{-- FOOTER --}}
|
||||
<livewire:frontend.footer/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user