stream calendar

This commit is contained in:
Benjamin Takats
2022-12-19 14:10:31 +01:00
parent d189917530
commit 0a6cf3c91a
5 changed files with 55 additions and 47 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use App\Models\Meetup;
use App\Models\MeetupEvent;
use Illuminate\Http\Request;
use Spatie\IcalendarGenerator\Components\Calendar;
use Spatie\IcalendarGenerator\Components\Event;
@@ -18,14 +19,19 @@ class DownloadMeetupCalendar extends Controller
*/
public function __invoke(Request $request)
{
$meetup = Meetup::query()
->with([
'meetupEvents',
])
->findOrFail($request->input('meetup'));
if ($request->has('meetup')) {
$meetup = Meetup::query()
->with([
'meetupEvents',
])
->findOrFail($request->input('meetup'));
$events = $meetup->meetupEvents;
} else {
$events = MeetupEvent::query()->get();
}
$entries = [];
foreach ($meetup->meetupEvents as $event) {
foreach ($events as $event) {
$entries[] = Event::create()
->name($meetup->name)
->uniqueIdentifier(str($meetup->name)->slug.$event->id)

View File

@@ -11,10 +11,10 @@
x-data="{
textToCopy: '{{ route('meetup.ics', ['country' => $country, 'meetup' => $row->id]) }}',
}"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'Kalendar URL kopiert!',description:'Füge den Kalender Stream-Link in eine kompatible Kalender-App ein.',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'});"
amber>
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
{{ __('Stream Calendar (WIP)') }} ({{ $row->meetup_events_count }})
{{ __('Calendar Stream-Url') }} ({{ $row->meetup_events_count }})
</x-button>
@endif
@if($row->meetup_events_count < 1)

View File

@@ -25,7 +25,7 @@
x-data="{
textToCopy: 'lightning:{{ $this->lnurl }}',
}"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'URL kopiert!',icon:'success'});"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'{{ __('URL copied!') }}',icon:'success'});"
>
<x-button
xs
@@ -45,14 +45,15 @@
</x-button>
<x-button icon="at-symbol" primary class="ml-4" wire:click="switchToEmailSignup">
{{ __('Email registration') }}
{{ __('Email registration') }}
</x-button>
</div>
@endif
<div class="pt-12">
<p class="text-xs">{{ __('Zeus bug:') }} <a target="_blank" href="https://github.com/ZeusLN/zeus/issues/1045">https://github.com/ZeusLN/zeus/issues/1045</a>
<p class="text-xs">{{ __('Zeus bug:') }} <a target="_blank"
href="https://github.com/ZeusLN/zeus/issues/1045">https://github.com/ZeusLN/zeus/issues/1045</a>
</p>
</div>
</div>

View File

@@ -10,10 +10,10 @@
x-data="{
textToCopy: '{{ route('bitcoinEvent.ics', ['country' => $country]) }}',
}"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'Kalendar URL kopiert!',description:'Füge den Kalender Stream-Link in eine kompatible Kalender-App ein.',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'});"
amber>
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
{{ __('Stream Calendar (WIP)') }} ({{ $events->count() }})
{{ __('Calendar Stream-Url') }} ({{ $events->count() }})
</x-button>
</div>
@@ -136,18 +136,6 @@
</div>
</div>
<div class="w-full flex justify-end">
<x-button
x-data="{
textToCopy: '{{ route('bitcoinEvent.ics', ['country' => $country]) }}',
}"
@click.prevent="window.navigator.clipboard.writeText(textToCopy);window.$wireui.notify({title:'Kalendar URL kopiert!',description:'Füge den Kalender Stream-Link in eine kompatible Kalender-App ein.',icon:'success'});"
amber>
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
{{ __('Stream Calendar (WIP)') }} ({{ $events->count() }})
</x-button>
</div>
<livewire:tables.bitcoin-event-table :country="$country->code"/>
</div>
</section>

View File

@@ -3,27 +3,39 @@
<livewire:frontend.header :country="$country"/>
{{-- MAIN --}}
<section class="w-full mb-12">
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4 flex flex-col sm:flex-row">
<h1 class="mb-6 text-5xl font-extrabold leading-none tracking-normal text-gray-200 sm:text-6xl md:text-6xl lg:text-7xl md:tracking-tight">
{{ __('Bitcoiner') }} <span
class="w-full text-transparent bg-clip-text bg-gradient-to-r from-amber-400 via-amber-500 to-amber-200 lg:inline">{{ __('Meetups') }}</span><br
class="lg:block hidden">
{{ __('Plebs together strong 💪') }}
</h1>
<p class="px-0 mb-6 text-lg text-gray-600 md:text-xl lg:px-24">
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4 py-4">
<div class="w-full flex justify-end">
<x-button
x-data="{
textToCopy: '{{ route('meetup.ics', ['country' => $country]) }}',
}"
@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'});"
amber>
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
{{ __('Calendar Stream-Url for all meetup events') }}
</x-button>
</div>
<div class="flex flex-col sm:flex-row">
<h1 class="mb-6 text-5xl font-extrabold leading-none tracking-normal text-gray-200 sm:text-6xl md:text-6xl lg:text-7xl md:tracking-tight">
{{ __('Bitcoiner') }} <span
class="w-full text-transparent bg-clip-text bg-gradient-to-r from-amber-400 via-amber-500 to-amber-200 lg:inline">{{ __('Meetups') }}</span><br
class="lg:block hidden">
{{ __('Plebs together strong 💪') }}
</h1>
<p class="px-0 mb-6 text-lg text-gray-600 md:text-xl lg:px-24">
{{ __('Bitcoiner Meetups are a great way to meet other Bitcoiners in your area. You can learn from each other, share ideas, and have fun!') }}
@php
$focus = '';
$map = $country->code . '_merc';
if (!\File::exists(public_path('vendor/jvector/maps/' . $country->code . '.js'))) {
$map = 'europe_merc';
$focus = 'focusOn: {lat:'.$country->latitude.',lng:'.$country->longitude.',scale:8,animate:true},';
}
@endphp
<div
wire:ignore
class="w-full flex justify-center"
x-data="{
@php
$focus = '';
$map = $country->code . '_merc';
if (!\File::exists(public_path('vendor/jvector/maps/' . $country->code . '.js'))) {
$map = 'europe_merc';
$focus = 'focusOn: {lat:'.$country->latitude.',lng:'.$country->longitude.',scale:8,animate:true},';
}
@endphp
<div
wire:ignore
class="w-full flex justify-center"
x-data="{
init() {
let markers = {{ Js::from($markers) }};
@@ -54,8 +66,9 @@
});
}
}"
>
<div id="map" style="width: 100%;" class="h-[200px] sm:h-[400px] my-4 sm:my-0"></div>
>
<div id="map" style="width: 100%;" class="h-[200px] sm:h-[400px] my-4 sm:my-0"></div>
</div>
</div>
</div>
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4" id="table">