mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
stream calendar
This commit is contained in:
48
app/Http/Controllers/DownloadBitcoinEventCalendar.php
Normal file
48
app/Http/Controllers/DownloadBitcoinEventCalendar.php
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\BitcoinEvent;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Spatie\IcalendarGenerator\Components\Calendar;
|
||||||
|
use Spatie\IcalendarGenerator\Components\Event;
|
||||||
|
|
||||||
|
class DownloadBitcoinEventCalendar extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle the incoming request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function __invoke(Request $request)
|
||||||
|
{
|
||||||
|
$events = BitcoinEvent::query()
|
||||||
|
->with([
|
||||||
|
'venue.city.country',
|
||||||
|
])
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$entries = [];
|
||||||
|
foreach ($events as $event) {
|
||||||
|
$entries[] = Event::create()
|
||||||
|
->name($event->title)
|
||||||
|
->uniqueIdentifier('ID'.$event->id)
|
||||||
|
->address($event->venue->name.', '.$event->venue->street.', '.$event->venue->city->name.', '.$event->venue->city->country->name)
|
||||||
|
->description($event->description.' Link: '.$event->link)
|
||||||
|
->image($event->getFirstMediaUrl('logo'))
|
||||||
|
->startsAt($event->from)
|
||||||
|
->endsAt($event->to)
|
||||||
|
->alertMinutesBefore(60 * 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
$calendar = Calendar::create()
|
||||||
|
->name(__('Bitcoin Events'))
|
||||||
|
->refreshInterval(5)
|
||||||
|
->event($entries);
|
||||||
|
|
||||||
|
return response($calendar->get())
|
||||||
|
->header('Content-Type', 'text/calendar; charset=utf-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
47
app/Http/Controllers/DownloadMeetupCalendar.php
Normal file
47
app/Http/Controllers/DownloadMeetupCalendar.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\Meetup;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Spatie\IcalendarGenerator\Components\Calendar;
|
||||||
|
use Spatie\IcalendarGenerator\Components\Event;
|
||||||
|
|
||||||
|
class DownloadMeetupCalendar extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Handle the incoming request.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function __invoke(Request $request)
|
||||||
|
{
|
||||||
|
$meetup = Meetup::query()
|
||||||
|
->with([
|
||||||
|
'meetupEvents',
|
||||||
|
])
|
||||||
|
->findOrFail($request->input('meetup'));
|
||||||
|
|
||||||
|
$entries = [];
|
||||||
|
foreach ($meetup->meetupEvents as $event) {
|
||||||
|
$entries[] = Event::create()
|
||||||
|
->name($meetup->name)
|
||||||
|
->uniqueIdentifier('ID'.$event->id)
|
||||||
|
->address($event->location)
|
||||||
|
->description($event->description.' Link: '.$event->link)
|
||||||
|
->image($meetup->getFirstMediaUrl('logo'))
|
||||||
|
->startsAt($event->start)
|
||||||
|
->alertMinutesBefore(60 * 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$calendar = Calendar::create()
|
||||||
|
->name($meetup->name)
|
||||||
|
->refreshInterval(5)
|
||||||
|
->event($entries);
|
||||||
|
|
||||||
|
return response($calendar->get())
|
||||||
|
->header('Content-Type', 'text/calendar; charset=utf-8');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,7 +60,9 @@ class MeetupTable extends DataTableComponent
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
Column::make(__('Links'),)
|
Column::make(__('Links'),)
|
||||||
->label(
|
->label(
|
||||||
fn($row, Column $column) => view('columns.meetups.action')->withRow($row)
|
fn($row, Column $column) => view('columns.meetups.action')
|
||||||
|
->withRow($row)
|
||||||
|
->withCountry($this->country)
|
||||||
)
|
)
|
||||||
->collapseOnMobile(),
|
->collapseOnMobile(),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
"sentry/sentry-laravel": "^3.1",
|
"sentry/sentry-laravel": "^3.1",
|
||||||
"simplesoftwareio/simple-qrcode": "^4.2",
|
"simplesoftwareio/simple-qrcode": "^4.2",
|
||||||
"spatie/eloquent-sortable": "^4.0",
|
"spatie/eloquent-sortable": "^4.0",
|
||||||
|
"spatie/icalendar-generator": "^2.5",
|
||||||
"spatie/laravel-comments": "^1.4",
|
"spatie/laravel-comments": "^1.4",
|
||||||
"spatie/laravel-comments-livewire": "^1.2",
|
"spatie/laravel-comments-livewire": "^1.2",
|
||||||
"spatie/laravel-google-fonts": "^1.2",
|
"spatie/laravel-google-fonts": "^1.2",
|
||||||
|
|||||||
139
composer.lock
generated
139
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "233c21d81dfd51b9929f8cf795c2435c",
|
"content-hash": "d570d40413edbe29a499759d99b8584c",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "akuechler/laravel-geoly",
|
"name": "akuechler/laravel-geoly",
|
||||||
@@ -9247,6 +9247,143 @@
|
|||||||
],
|
],
|
||||||
"time": "2022-01-21T08:32:41+00:00"
|
"time": "2022-01-21T08:32:41+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "spatie/enum",
|
||||||
|
"version": "3.13.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/spatie/enum.git",
|
||||||
|
"reference": "f1a0f464ba909491a53e60a955ce84ad7cd93a2c"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/spatie/enum/zipball/f1a0f464ba909491a53e60a955ce84ad7cd93a2c",
|
||||||
|
"reference": "f1a0f464ba909491a53e60a955ce84ad7cd93a2c",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"php": "^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"fakerphp/faker": "^1.9.1",
|
||||||
|
"larapack/dd": "^1.1",
|
||||||
|
"phpunit/phpunit": "^9.0",
|
||||||
|
"vimeo/psalm": "^4.3"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"fakerphp/faker": "To use the enum faker provider",
|
||||||
|
"phpunit/phpunit": "To use the enum assertions"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Spatie\\Enum\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Brent Roose",
|
||||||
|
"email": "brent@spatie.be",
|
||||||
|
"homepage": "https://spatie.be",
|
||||||
|
"role": "Developer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tom Witkowski",
|
||||||
|
"email": "dev@gummibeer.de",
|
||||||
|
"homepage": "https://gummibeer.de",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHP Enums",
|
||||||
|
"homepage": "https://github.com/spatie/enum",
|
||||||
|
"keywords": [
|
||||||
|
"enum",
|
||||||
|
"enumerable",
|
||||||
|
"spatie"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"docs": "https://docs.spatie.be/enum",
|
||||||
|
"issues": "https://github.com/spatie/enum/issues",
|
||||||
|
"source": "https://github.com/spatie/enum"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://spatie.be/open-source/support-us",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/spatie",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2022-04-22T08:51:55+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spatie/icalendar-generator",
|
||||||
|
"version": "2.5.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/spatie/icalendar-generator.git",
|
||||||
|
"reference": "128d8fe4f0d759b8bdb0383a178c15963b54f458"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/spatie/icalendar-generator/zipball/128d8fe4f0d759b8bdb0383a178c15963b54f458",
|
||||||
|
"reference": "128d8fe4f0d759b8bdb0383a178c15963b54f458",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"nesbot/carbon": "^2.54",
|
||||||
|
"php": "^7.4|^8.0",
|
||||||
|
"spatie/enum": "^3.11"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"larapack/dd": "^1.1",
|
||||||
|
"pestphp/pest": "^1.22",
|
||||||
|
"phpunit/phpunit": "^9.5",
|
||||||
|
"spatie/pest-plugin-snapshots": "^1.1",
|
||||||
|
"spatie/phpunit-snapshot-assertions": "^4.2",
|
||||||
|
"vimeo/psalm": "^4.13"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Spatie\\IcalendarGenerator\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Ruben Van Assche",
|
||||||
|
"email": "ruben@spatie.be",
|
||||||
|
"homepage": "https://spatie.be",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Build calendars in the iCalendar format",
|
||||||
|
"homepage": "https://github.com/spatie/icalendar-generator",
|
||||||
|
"keywords": [
|
||||||
|
"calendar",
|
||||||
|
"iCalendar",
|
||||||
|
"ical",
|
||||||
|
"ics",
|
||||||
|
"spatie"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/spatie/icalendar-generator/tree/2.5.1"
|
||||||
|
},
|
||||||
|
"time": "2022-10-26T10:18:21+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "spatie/image",
|
"name": "spatie/image",
|
||||||
"version": "2.2.4",
|
"version": "2.2.4",
|
||||||
|
|||||||
@@ -3,13 +3,25 @@
|
|||||||
<x-button
|
<x-button
|
||||||
amber
|
amber
|
||||||
wire:click="meetupEventSearch({{ $row->id }})">
|
wire:click="meetupEventSearch({{ $row->id }})">
|
||||||
|
<i class="fa fa-thin fa-calendar mr-2"></i>
|
||||||
{{ __('Show dates') }} ({{ $row->meetup_events_count }})
|
{{ __('Show dates') }} ({{ $row->meetup_events_count }})
|
||||||
</x-button>
|
</x-button>
|
||||||
|
|
||||||
|
<x-button
|
||||||
|
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'});"
|
||||||
|
amber>
|
||||||
|
<i class="fa fa-thin fa-calendar-arrow-down mr-2"></i>
|
||||||
|
{{ __('Stream Calendar (WIP)') }} ({{ $row->meetup_events_count }})
|
||||||
|
</x-button>
|
||||||
@endif
|
@endif
|
||||||
@if($row->meetup_events_count < 1)
|
@if($row->meetup_events_count < 1)
|
||||||
<x-button
|
<x-button
|
||||||
outlined
|
outlined
|
||||||
wire:click="meetupEventSearch({{ $row->id }})">
|
wire:click="meetupEventSearch({{ $row->id }})">
|
||||||
|
<i class="fa fa-thin fa-calendar-circle-exclamation mr-2"></i>
|
||||||
{{ __('Show dates') }} ({{ $row->meetup_events_count }})
|
{{ __('Show dates') }} ({{ $row->meetup_events_count }})
|
||||||
</x-button>
|
</x-button>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -23,8 +23,8 @@
|
|||||||
<div class="flex justify-end w-full">
|
<div class="flex justify-end w-full">
|
||||||
<div
|
<div
|
||||||
x-data="{
|
x-data="{
|
||||||
textToCopy: 'lightning:{{ $this->lnurl }}',
|
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 kopiert!',icon:'success'});"
|
||||||
>
|
>
|
||||||
<x-button
|
<x-button
|
||||||
|
|||||||
@@ -4,6 +4,19 @@
|
|||||||
{{-- MAIN --}}
|
{{-- MAIN --}}
|
||||||
<section class="w-full mb-12">
|
<section class="w-full mb-12">
|
||||||
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4" id="table">
|
<div class="max-w-screen-2xl mx-auto px-2 sm:px-10 space-y-4" id="table">
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
<div class="flex items-start">
|
<div class="flex items-start">
|
||||||
<div class="w-full sm:w-1/2">
|
<div class="w-full sm:w-1/2">
|
||||||
|
|
||||||
@@ -123,6 +136,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</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"/>
|
<livewire:tables.bitcoin-event-table :country="$country->code"/>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -70,6 +70,8 @@ Route::middleware([])
|
|||||||
->as('bitcoinEvent.')
|
->as('bitcoinEvent.')
|
||||||
->prefix('/{country:code}/event')
|
->prefix('/{country:code}/event')
|
||||||
->group(function () {
|
->group(function () {
|
||||||
|
Route::get('stream-calendar', \App\Http\Controllers\DownloadBitcoinEventCalendar::class)
|
||||||
|
->name('ics');
|
||||||
Route::get('overview', \App\Http\Livewire\BitcoinEvent\BitcoinEventTable::class)
|
Route::get('overview', \App\Http\Livewire\BitcoinEvent\BitcoinEventTable::class)
|
||||||
->name('table.bitcoinEvent');
|
->name('table.bitcoinEvent');
|
||||||
});
|
});
|
||||||
@@ -82,6 +84,8 @@ Route::middleware([])
|
|||||||
->as('meetup.')
|
->as('meetup.')
|
||||||
->prefix('/{country:code}/meetup')
|
->prefix('/{country:code}/meetup')
|
||||||
->group(function () {
|
->group(function () {
|
||||||
|
Route::get('stream-calendar', \App\Http\Controllers\DownloadMeetupCalendar::class)
|
||||||
|
->name('ics');
|
||||||
Route::get('world', \App\Http\Livewire\Meetup\WorldMap::class)
|
Route::get('world', \App\Http\Livewire\Meetup\WorldMap::class)
|
||||||
->name('world');
|
->name('world');
|
||||||
Route::get('overview', \App\Http\Livewire\Meetup\MeetupTable::class)
|
Route::get('overview', \App\Http\Livewire\Meetup\MeetupTable::class)
|
||||||
|
|||||||
Reference in New Issue
Block a user