all meetups

This commit is contained in:
Benjamin Takats
2023-01-17 19:54:32 +01:00
parent b7e0b64ebe
commit 42a8f4b65b
4 changed files with 12 additions and 4 deletions

View File

@@ -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;

View File

@@ -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()),

View File

@@ -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') }}

View File

@@ -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>