mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
add visible_on_map field to meetups table
This commit is contained in:
@@ -22,7 +22,7 @@ class MeetupEventTable extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (! $this->year) {
|
||||
if (!$this->year) {
|
||||
$this->year = now()->year;
|
||||
}
|
||||
}
|
||||
@@ -31,16 +31,17 @@ class MeetupEventTable extends Component
|
||||
{
|
||||
return view('livewire.meetup.meetup-event-table', [
|
||||
'markers' => MeetupEvent::query()
|
||||
->where('visible_on_map', true)
|
||||
->with([
|
||||
'meetup.city.country',
|
||||
])
|
||||
->where('meetup_events.start', '>=', now()->subDay())
|
||||
->whereHas('meetup.city.country',
|
||||
fn ($query) => $query->where('countries.code', $this->country->code))
|
||||
fn($query) => $query->where('countries.code', $this->country->code))
|
||||
->get()
|
||||
->map(fn ($event) => [
|
||||
->map(fn($event) => [
|
||||
'id' => $event->id,
|
||||
'name' => $event->meetup->name.': '.$event->location,
|
||||
'name' => $event->meetup->name . ': ' . $event->location,
|
||||
'coords' => [$event->meetup->city->latitude, $event->meetup->city->longitude],
|
||||
]),
|
||||
'events' => MeetupEvent::query()
|
||||
@@ -49,9 +50,9 @@ class MeetupEventTable extends Component
|
||||
])
|
||||
->where('meetup_events.start', '>=', now()->subDay())
|
||||
->whereHas('meetup.city.country',
|
||||
fn ($query) => $query->where('countries.code', $this->country->code))
|
||||
fn($query) => $query->where('countries.code', $this->country->code))
|
||||
->get()
|
||||
->map(fn ($event) => [
|
||||
->map(fn($event) => [
|
||||
'id' => $event->id,
|
||||
'startDate' => $event->start,
|
||||
'endDate' => $event->start->addHours(1),
|
||||
|
||||
@@ -31,6 +31,7 @@ class MeetupTable extends Component
|
||||
|
||||
return view('livewire.meetup.meetup-table', [
|
||||
'markers' => Meetup::query()
|
||||
->where('visible_on_map', true)
|
||||
->with([
|
||||
'city.country',
|
||||
])
|
||||
|
||||
@@ -26,11 +26,12 @@ class WorldMap extends Component
|
||||
{
|
||||
return view('livewire.meetup.world-map', [
|
||||
'allMarkers' => Meetup::query()
|
||||
->where('visible_on_map', true)
|
||||
->with([
|
||||
'city.country',
|
||||
])
|
||||
->get()
|
||||
->map(fn ($meetup) => [
|
||||
->map(fn($meetup) => [
|
||||
'id' => $meetup->id,
|
||||
'name' => $meetup->name,
|
||||
'coords' => [$meetup->city->latitude, $meetup->city->longitude],
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('meetups', function (Blueprint $table) {
|
||||
$table->boolean('visible_on_map')->default(true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('meetups', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -35,6 +35,7 @@ Route::middleware([])
|
||||
Route::resource('languages', \App\Http\Controllers\Api\LanguageController::class);
|
||||
Route::get('meetups', function () {
|
||||
return \App\Models\Meetup::query()
|
||||
->where('visible_on_map', true)
|
||||
->with([
|
||||
'city',
|
||||
])
|
||||
@@ -47,8 +48,8 @@ Route::middleware([])
|
||||
'country' => str($meetup->city->country->code)->upper(),
|
||||
'state' => $meetup->github_data['state'] ?? null,
|
||||
'city' => $meetup->city->name,
|
||||
'longitude' => (float) $meetup->city->longitude,
|
||||
'latitude' => (float) $meetup->city->latitude,
|
||||
'longitude' => (float)$meetup->city->longitude,
|
||||
'latitude' => (float)$meetup->city->latitude,
|
||||
'twitter_username' => $meetup->twitter_username,
|
||||
'website' => $meetup->webpage,
|
||||
]);
|
||||
@@ -76,7 +77,7 @@ Route::middleware([])
|
||||
'continent' => 'europe',
|
||||
'icon:square' => $meetup->logoSquare,
|
||||
//'contact:email' => null,
|
||||
'contact:twitter' => $meetup->twitter_username ? 'https://twitter.com/'.$meetup->twitter_username : null,
|
||||
'contact:twitter' => $meetup->twitter_username ? 'https://twitter.com/' . $meetup->twitter_username : null,
|
||||
'contact:website' => $meetup->webpage,
|
||||
'contact:telegram' => $meetup->telegram_link,
|
||||
'contact:nostr' => $meetup->nostr,
|
||||
@@ -116,7 +117,7 @@ Route::get('/lnurl-auth-callback', function (Request $request) {
|
||||
'public_key' => $request->key,
|
||||
'is_lecturer' => true,
|
||||
'name' => $fakeName,
|
||||
'email' => str($request->key)->substr(-12).'@portal.einundzwanzig.space',
|
||||
'email' => str($request->key)->substr(-12) . '@portal.einundzwanzig.space',
|
||||
'lnbits' => [
|
||||
'read_key' => null,
|
||||
'url' => null,
|
||||
@@ -126,7 +127,7 @@ Route::get('/lnurl-auth-callback', function (Request $request) {
|
||||
$user->ownedTeams()
|
||||
->save(Team::forceCreate([
|
||||
'user_id' => $user->id,
|
||||
'name' => $fakeName."'s Team",
|
||||
'name' => $fakeName . "'s Team",
|
||||
'personal_team' => true,
|
||||
]));
|
||||
}
|
||||
|
||||
@@ -729,9 +729,9 @@ __metadata:
|
||||
linkType: hard
|
||||
|
||||
"caniuse-lite@npm:^1.0.30001426, caniuse-lite@npm:^1.0.30001449":
|
||||
version: 1.0.30001450
|
||||
resolution: "caniuse-lite@npm:1.0.30001450"
|
||||
checksum: 511b360bfc907b2e437699364cf96b83507bc45043926450056642332bcd6f65a1e72540c828534ae15e0ac906e3e9af46cb2bb84458dd580bc31478e9dce282
|
||||
version: 1.0.30001519
|
||||
resolution: "caniuse-lite@npm:1.0.30001519"
|
||||
checksum: 66085133ede05d947e30b62fed2cbae18e5767afda8b0de38840883e1cfe5846bf1568ddbafd31647544e59112355abedaf9c867ac34541bfc20d69e7a19d94c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user