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\Country;
|
||||||
use App\Models\Meetup;
|
use App\Models\Meetup;
|
||||||
|
use App\Models\MeetupEvent;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ use Rappasoft\LaravelLivewireTables\Views\Filters\TextFilter;
|
|||||||
|
|
||||||
class MeetupTable extends DataTableComponent
|
class MeetupTable extends DataTableComponent
|
||||||
{
|
{
|
||||||
public string $country;
|
public ?string $country = null;
|
||||||
|
|
||||||
protected $model = Meetup::class;
|
protected $model = Meetup::class;
|
||||||
|
|
||||||
@@ -69,7 +69,8 @@ class MeetupTable extends DataTableComponent
|
|||||||
public function builder(): Builder
|
public function builder(): Builder
|
||||||
{
|
{
|
||||||
return Meetup::query()
|
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([
|
->withCount([
|
||||||
'users',
|
'users',
|
||||||
'meetupEvents' => fn($query) => $query->where('start', '>=', now()),
|
'meetupEvents' => fn($query) => $query->where('start', '>=', now()),
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
xs
|
xs
|
||||||
black
|
black
|
||||||
x-data="{
|
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'});"
|
@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
|
<x-button
|
||||||
black
|
black
|
||||||
xs
|
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>
|
<i class="fa fa-thin fa-browser mr-2"></i>
|
||||||
{{ __('Show landing page') }}
|
{{ __('Show landing page') }}
|
||||||
|
|||||||
@@ -53,6 +53,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</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 --}}
|
{{-- FOOTER --}}
|
||||||
<livewire:frontend.footer/>
|
<livewire:frontend.footer/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user