mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
nostr events schedule
This commit is contained in:
@@ -20,6 +20,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
|||||||
'name' => ['required', 'string', 'max:255'],
|
'name' => ['required', 'string', 'max:255'],
|
||||||
'lightning_address' => ['nullable', 'string'],
|
'lightning_address' => ['nullable', 'string'],
|
||||||
'lnurl' => ['nullable', 'string'],
|
'lnurl' => ['nullable', 'string'],
|
||||||
|
'nostr' => ['nullable', 'string'],
|
||||||
'node_id' => ['nullable', 'string', 'max:66'],
|
'node_id' => ['nullable', 'string', 'max:66'],
|
||||||
'timezone' => ['required', 'string'],
|
'timezone' => ['required', 'string'],
|
||||||
'email' => [
|
'email' => [
|
||||||
@@ -42,6 +43,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
|||||||
'name' => $input['name'],
|
'name' => $input['name'],
|
||||||
'lightning_address' => $input['lightning_address'],
|
'lightning_address' => $input['lightning_address'],
|
||||||
'lnurl' => $input['lnurl'],
|
'lnurl' => $input['lnurl'],
|
||||||
|
'nostr' => $input['nostr'],
|
||||||
'node_id' => $input['node_id'],
|
'node_id' => $input['node_id'],
|
||||||
'email' => $input['email'],
|
'email' => $input['email'],
|
||||||
'timezone' => $input['timezone'],
|
'timezone' => $input['timezone'],
|
||||||
@@ -62,6 +64,7 @@ class UpdateUserProfileInformation implements UpdatesUserProfileInformation
|
|||||||
'lightning_address' => $input['lightning_address'],
|
'lightning_address' => $input['lightning_address'],
|
||||||
'lnurl' => $input['lnurl'],
|
'lnurl' => $input['lnurl'],
|
||||||
'node_id' => $input['node_id'],
|
'node_id' => $input['node_id'],
|
||||||
|
'nostr' => $input['nostr'],
|
||||||
'email' => $input['email'],
|
'email' => $input['email'],
|
||||||
'timezone' => $input['timezone'],
|
'timezone' => $input['timezone'],
|
||||||
'email_verified_at' => null,
|
'email_verified_at' => null,
|
||||||
|
|||||||
@@ -20,14 +20,11 @@ class LibraryItemObserver
|
|||||||
try {
|
try {
|
||||||
$libraryItem->setStatus('published');
|
$libraryItem->setStatus('published');
|
||||||
|
|
||||||
$from = $libraryItem->name;
|
|
||||||
$from .= ' von '.$libraryItem->lecturer->name;
|
|
||||||
|
|
||||||
if ($libraryItem->type !== LibraryItemType::MarkdownArticle()) {
|
if ($libraryItem->type !== LibraryItemType::MarkdownArticle()) {
|
||||||
if ($libraryItem->whereDoesntHave('libraries',
|
if ($libraryItem->whereDoesntHave('libraries',
|
||||||
fn($query) => $query->where('libraries.is_public', false))
|
fn($query) => $query->where('libraries.is_public', false))
|
||||||
->exists()) {
|
->exists()) {
|
||||||
$this->publishOnNostr($libraryItem, $this->getText('LibraryItem', $from));
|
$this->publishOnNostr($libraryItem, $this->getText('LibraryItem'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|||||||
@@ -17,11 +17,7 @@ class MeetupEventObserver
|
|||||||
public function created(MeetupEvent $meetupEvent): void
|
public function created(MeetupEvent $meetupEvent): void
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$from = $meetupEvent->meetup->name;
|
$this->publishOnNostr($meetupEvent, $this->getText('MeetupEvent'));
|
||||||
if ($meetupEvent->meetup->nostr) {
|
|
||||||
$from .= ' @'.$meetupEvent->meetup->nostr;
|
|
||||||
}
|
|
||||||
$this->publishOnNostr($meetupEvent, $this->getText('MeetupEvent', $from));
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,7 @@ class MeetupObserver
|
|||||||
public function created(Meetup $meetup): void
|
public function created(Meetup $meetup): void
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$from = $meetup->name;
|
$this->publishOnNostr($meetup, $this->getText('Meetup'));
|
||||||
if ($meetup->nostr) {
|
|
||||||
$from .= ' @'.$meetup->nostr;
|
|
||||||
}
|
|
||||||
$this->publishOnNostr($meetup, $this->getText('Meetup', $from));
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,9 @@ trait NostrTrait
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getText($model, $from = null)
|
public function getText($model)
|
||||||
{
|
{
|
||||||
|
$from = '';
|
||||||
if ($model instanceof BitcoinEvent) {
|
if ($model instanceof BitcoinEvent) {
|
||||||
return sprintf("Ein neues Event wurde eingestellt:\n\n%s\n\n%s bis %s\n\n%s\n\n%s\n\n#Bitcoin #Event #Einundzwanzig #gesundesgeld",
|
return sprintf("Ein neues Event wurde eingestellt:\n\n%s\n\n%s bis %s\n\n%s\n\n%s\n\n#Bitcoin #Event #Einundzwanzig #gesundesgeld",
|
||||||
$model->title,
|
$model->title,
|
||||||
@@ -44,8 +45,14 @@ trait NostrTrait
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($model instanceof CourseEvent) {
|
if ($model instanceof CourseEvent) {
|
||||||
|
if ($model->lecturer->nostr) {
|
||||||
|
$from .= '@'.$model->lecturer->nostr;
|
||||||
|
} else {
|
||||||
|
$from .= $model->lecturer->name;
|
||||||
|
}
|
||||||
|
|
||||||
return sprintf("Unser Dozent %s hat einen neuen Kurs-Termin eingestellt:\n\n%s\n\n%s\n\n%s\n\n#Bitcoin #Kurs #Education #Einundzwanzig #gesundesgeld",
|
return sprintf("Unser Dozent %s hat einen neuen Kurs-Termin eingestellt:\n\n%s\n\n%s\n\n%s\n\n#Bitcoin #Kurs #Education #Einundzwanzig #gesundesgeld",
|
||||||
$model->course->lecturer->name,
|
$from,
|
||||||
$model->course->name,
|
$model->course->name,
|
||||||
str($model->course->description)->limit(80),
|
str($model->course->description)->limit(80),
|
||||||
url()->route('school.landingPage.lecturer',
|
url()->route('school.landingPage.lecturer',
|
||||||
@@ -53,6 +60,11 @@ trait NostrTrait
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($model instanceof MeetupEvent) {
|
if ($model instanceof MeetupEvent) {
|
||||||
|
$from = $model->meetup->name;
|
||||||
|
if ($model->meetup->nostr) {
|
||||||
|
$from .= ' @'.$model->meetup->nostr;
|
||||||
|
}
|
||||||
|
|
||||||
return sprintf("%s hat einen neuen Termin eingestellt:\n\n%s\n\n%s\n\n%s\n\n#Bitcoin #Meetup #Einundzwanzig #gesundesgeld",
|
return sprintf("%s hat einen neuen Termin eingestellt:\n\n%s\n\n%s\n\n%s\n\n#Bitcoin #Meetup #Einundzwanzig #gesundesgeld",
|
||||||
$from,
|
$from,
|
||||||
$model->start->asDateTime(),
|
$model->start->asDateTime(),
|
||||||
@@ -62,14 +74,25 @@ trait NostrTrait
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($model instanceof Meetup) {
|
if ($model instanceof Meetup) {
|
||||||
|
$from = $model->name;
|
||||||
|
if ($model->nostr) {
|
||||||
|
$from .= ' @'.$model->nostr;
|
||||||
|
}
|
||||||
|
|
||||||
return sprintf("Eine neue Meetup Gruppe wurde hinzugefügt:\n\n%s\n\n%s\n\n#Bitcoin #Meetup #Einundzwanzig #gesundesgeld",
|
return sprintf("Eine neue Meetup Gruppe wurde hinzugefügt:\n\n%s\n\n%s\n\n#Bitcoin #Meetup #Einundzwanzig #gesundesgeld",
|
||||||
$from,
|
$from,
|
||||||
url()->route('meetup.landing', ['country' => $model->city->country->code, 'meetup' => $model])
|
url()->route('meetup.landing', ['country' => $model->city->country->code, 'meetup' => $model])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($model instanceof Course) {
|
if ($model instanceof Course) {
|
||||||
|
if ($model->lecturer->nostr) {
|
||||||
|
$from .= '@'.$model->lecturer->nostr;
|
||||||
|
} else {
|
||||||
|
$from .= $model->lecturer->name;
|
||||||
|
}
|
||||||
|
|
||||||
return sprintf("Unser Dozent %s hat einen neuen Kurs eingestellt:\n\n%s\n\n%s\n\n%s\n\n#Bitcoin #Kurs #Education #Einundzwanzig #gesundesgeld",
|
return sprintf("Unser Dozent %s hat einen neuen Kurs eingestellt:\n\n%s\n\n%s\n\n%s\n\n#Bitcoin #Kurs #Education #Einundzwanzig #gesundesgeld",
|
||||||
$model->lecturer->name,
|
$from,
|
||||||
$model->name,
|
$model->name,
|
||||||
str($model->description)->limit(80),
|
str($model->description)->limit(80),
|
||||||
url()->route('school.landingPage.lecturer',
|
url()->route('school.landingPage.lecturer',
|
||||||
@@ -77,6 +100,13 @@ trait NostrTrait
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($model instanceof LibraryItem) {
|
if ($model instanceof LibraryItem) {
|
||||||
|
$from = $model->name;
|
||||||
|
if ($model->lecturer->nostr) {
|
||||||
|
$from .= ' von @'.$model->lecturer->nostr;
|
||||||
|
} else {
|
||||||
|
$from .= ' von '.$model->lecturer->name;
|
||||||
|
}
|
||||||
|
|
||||||
return sprintf("Es gibt was Neues zum Lesen oder Anhören:\n\n%s\n\n%s\n\n#Bitcoin #Wissen #Einundzwanzig #gesundesgeld",
|
return sprintf("Es gibt was Neues zum Lesen oder Anhören:\n\n%s\n\n%s\n\n#Bitcoin #Wissen #Einundzwanzig #gesundesgeld",
|
||||||
$from,
|
$from,
|
||||||
url()->route('article.view',
|
url()->route('article.view',
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?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('users', function (Blueprint $table) {
|
||||||
|
$table->string('nostr')
|
||||||
|
->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -65,6 +65,14 @@
|
|||||||
<p class="text-xs">{{ __('Only one working address is required. But you can also fill in all fields if you have suitable data.') }}</p>
|
<p class="text-xs">{{ __('Only one working address is required. But you can also fill in all fields if you have suitable data.') }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- nostr -->
|
||||||
|
<div class="col-span-6 sm:col-span-4">
|
||||||
|
<x-jet-label for="nostr" value="{{ __('Nostr public key') }}"/>
|
||||||
|
<x-jet-input id="nostr" type="text" class="mt-1 block w-full" wire:model.defer="state.nostr"
|
||||||
|
autocomplete="nostr"/>
|
||||||
|
<x-jet-input-error for="nostr" class="mt-2"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- lightning_address -->
|
<!-- lightning_address -->
|
||||||
<div class="col-span-6 sm:col-span-4">
|
<div class="col-span-6 sm:col-span-4">
|
||||||
<x-jet-label for="lightning_address" value="{{ __('Lightning Address') }}"/>
|
<x-jet-label for="lightning_address" value="{{ __('Lightning Address') }}"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user