Refactor components and models:

- 🔥 Removed deprecated `placeholder-pattern` component.
- 🧹 Simplified and cleaned up Blade views by removing unused comments and sections.
- 🗂️ Extracted `SetsCreatedBy` concern for DRY and reused it across models.
- 🔧 Consolidated configuration for Horizon `authorized_nostr_keys`.
- 🧪 Migrated media conversion to use new Spatie enums for clarity.
- ♻️ Replaced repetitive link rendering with dynamic rendering in meetups and services views.
This commit is contained in:
HolgerHatGarKeineNode
2026-06-29 22:20:01 +02:00
parent beaf028c1d
commit a2a640809a
29 changed files with 130 additions and 439 deletions
@@ -42,11 +42,9 @@ class extends Component {
:description="__('This is a secure area of the application. Please confirm your password before continuing.')"
/>
<!-- Session Status -->
<x-auth-session-status class="text-center" :status="session('status')"/>
<form wire:submit="confirmPassword" class="flex flex-col gap-6">
<!-- Password -->
<flux:input
wire:model="password"
:label="__('Password')"
@@ -30,11 +30,9 @@ class extends Component {
<x-auth-header :title="__('Forgot password')"
:description="__('Enter your email to receive a password reset link')"/>
<!-- Session Status -->
<x-auth-session-status class="text-center" :status="session('status')"/>
<form wire:submit="sendPasswordResetLink" class="flex flex-col gap-6">
<!-- Email Address -->
<flux:input
wire:model="email"
:label="__('Email Address')"
@@ -135,33 +135,6 @@ class extends Component {
['country' => str(session('lang_country', config('app.domain_country')))->after('-')->lower()],
absolute: false),
);
return;
$this->validate();
$this->ensureIsNotRateLimited();
if (!Auth::attempt(['email' => $this->email, 'password' => $this->password], $this->remember)) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => __('auth.failed'),
]);
}
RateLimiter::clear($this->throttleKey());
Session::regenerate();
session([
'lang_country' => $this->currentLangCountry,
]);
$this->redirectIntended(
default: route('dashboard',
['country' => str(session('lang_country', config('app.domain_country')))->after('-')->lower()],
absolute: false),
navigate: true,
);
}
/**
@@ -276,7 +249,6 @@ class extends Component {
data-nostr-challenge="{{ $nostrChallenge ?? '' }}">
<div class="flex-1 flex justify-center items-center">
<div class="w-80 max-w-80 space-y-6">
<!-- Logo -->
<div class="flex justify-center">
<a href="/" class="group flex items-center gap-3">
<div class="h-24 m-12 [:where(&)]:size-32 [:where(&)]:text-base">
@@ -285,16 +257,12 @@ class extends Component {
</a>
</div>
<!-- Welcome Heading -->
<flux:heading class="text-center" size="xl">{{ __('Willkommen zurück') }}</flux:heading>
<!-- Session Status -->
<x-auth-session-status class="text-center" :status="session('status')"/>
<!-- Login Form -->
<div class="flex flex-col gap-6">
<!-- Submit Button -->
<flux:button variant="primary"
@click="openNostrLogin"
icon="cursor-arrow-ripple"
@@ -344,22 +312,18 @@ class extends Component {
</div>
</div>
<!-- Language Selection Accordion -->
<livewire:language.selector/>
</div>
</div>
<!-- Right Side Panel -->
<div class="flex-1 p-4 max-lg:hidden">
<div class="text-white relative rounded-lg h-full w-full bg-zinc-900 flex flex-col items-start justify-end p-16"
style="background-image: url('https://dergigi.com/assets/images/bitcoin-is-time.jpg'); background-size: cover">
<!-- Testimonial -->
<div class="mb-6 italic font-base text-3xl xl:text-4xl">
Bitcoin, not blockchain. Bitcoin, not crypto.
</div>
<!-- Author Info -->
<div class="flex gap-4">
<flux:avatar src="https://dergigi.com/assets/images/avatar.jpg" size="xl"/>
<div class="flex flex-col justify-center font-medium">
@@ -75,11 +75,9 @@ class extends Component {
<div class="flex flex-col gap-6">
<x-auth-header :title="__('Reset password')" :description="__('Please enter your new password below')"/>
<!-- Session Status -->
<x-auth-session-status class="text-center" :status="session('status')"/>
<form wire:submit="resetPassword" class="flex flex-col gap-6">
<!-- Email Address -->
<flux:input
wire:model="email"
:label="__('Email')"
@@ -88,7 +86,6 @@ class extends Component {
autocomplete="email"
/>
<!-- Password -->
<flux:input
wire:model="password"
:label="__('Password')"
@@ -99,7 +96,6 @@ class extends Component {
viewable
/>
<!-- Confirm Password -->
<flux:input
wire:model="password_confirmation"
:label="__('Confirm password')"
@@ -138,48 +138,26 @@ class extends Component {
</flux:table.cell>
<flux:table.cell>
@php
$socialLinks = [
['value' => $meetup->telegram_link, 'href' => $meetup->telegram_link, 'icon' => 'paper-airplane', 'title' => __('Telegram')],
['value' => $meetup->webpage, 'href' => $meetup->webpage, 'icon' => 'globe-alt', 'title' => __('Website')],
['value' => $meetup->twitter_username, 'href' => 'https://twitter.com/'.$meetup->twitter_username, 'icon' => 'x-mark', 'title' => __('Twitter')],
['value' => $meetup->matrix_group, 'href' => $meetup->matrix_group, 'icon' => 'chat-bubble-left', 'title' => __('Matrix')],
['value' => $meetup->nostr, 'href' => 'https://njump.me/'.$meetup->nostr, 'icon' => 'bolt', 'title' => __('Nostr')],
['value' => $meetup->simplex, 'href' => $meetup->simplex, 'icon' => 'chat-bubble-bottom-center-text', 'title' => __('Simplex')],
['value' => $meetup->signal, 'href' => $meetup->signal, 'icon' => 'shield-check', 'title' => __('Signal')],
];
@endphp
<div class="flex gap-2">
@if($meetup->telegram_link)
<flux:link :href="$meetup->telegram_link" external variant="subtle"
title="{{ __('Telegram') }}">
<flux:icon.paper-airplane variant="mini"/>
</flux:link>
@endif
@if($meetup->webpage)
<flux:link :href="$meetup->webpage" external variant="subtle"
title="{{ __('Website') }}">
<flux:icon.globe-alt variant="mini"/>
</flux:link>
@endif
@if($meetup->twitter_username)
<flux:link :href="'https://twitter.com/' . $meetup->twitter_username" external
variant="subtle" title="{{ __('Twitter') }}">
<flux:icon.x-mark variant="mini"/>
</flux:link>
@endif
@if($meetup->matrix_group)
<flux:link :href="$meetup->matrix_group" external variant="subtle"
title="{{ __('Matrix') }}">
<flux:icon.chat-bubble-left variant="mini"/>
</flux:link>
@endif
@if($meetup->nostr)
<flux:link :href="'https://njump.me/'.$meetup->nostr" external variant="subtle"
title="{{ __('Nostr') }}">
<flux:icon.bolt variant="mini"/>
</flux:link>
@endif
@if($meetup->simplex)
<flux:link :href="$meetup->simplex" external variant="subtle"
title="{{ __('Simplex') }}">
<flux:icon.chat-bubble-bottom-center-text variant="mini"/>
</flux:link>
@endif
@if($meetup->signal)
<flux:link :href="$meetup->signal" external variant="subtle" title="{{ __('Signal') }}">
<flux:icon.shield-check variant="mini"/>
</flux:link>
@endif
@foreach($socialLinks as $socialLink)
@if($socialLink['value'])
<flux:link :href="$socialLink['href']" external variant="subtle"
title="{{ $socialLink['title'] }}">
<flux:icon name="{{ $socialLink['icon'] }}" variant="mini"/>
</flux:link>
@endif
@endforeach
</div>
</flux:table.cell>
@@ -107,71 +107,33 @@ class extends Component {
</flux:table.cell>
<flux:table.cell>
@php
$serviceUrls = [
['href' => $service->url_clearnet, 'color' => 'text-blue-600 dark:text-blue-400', 'icon' => 'globe-alt', 'label' => 'Clearnet'],
['href' => $service->url_onion, 'color' => 'text-purple-600 dark:text-purple-400', 'icon' => 'lock-closed', 'label' => 'Onion'],
['href' => $service->url_i2p, 'color' => 'text-green-600 dark:text-green-400', 'icon' => 'link', 'label' => 'I2P'],
['href' => $service->url_pkdns, 'color' => 'text-orange-600 dark:text-orange-400', 'icon' => 'link', 'label' => 'pkdns'],
];
@endphp
<div class="flex flex-col gap-1">
@if($service->url_clearnet)
<div class="flex items-center gap-2">
<flux:tooltip content="{{ $service->url_clearnet }}">
<flux:link :href="$service->url_clearnet" external
class="text-blue-600 dark:text-blue-400">
<flux:icon.globe-alt variant="mini" class="inline"/>
Clearnet
</flux:link>
</flux:tooltip>
<div x-copy-to-clipboard="'{{ $service->url_clearnet }}'">
<flux:button icon="clipboard" size="xs" variant="ghost" class="cursor-pointer">
{{ __('Copy') }}
</flux:button>
@foreach($serviceUrls as $serviceUrl)
@if($serviceUrl['href'])
<div class="flex items-center gap-2">
<flux:tooltip content="{{ $serviceUrl['href'] }}">
<flux:link :href="$serviceUrl['href']" external
class="{{ $serviceUrl['color'] }}">
<flux:icon name="{{ $serviceUrl['icon'] }}" variant="mini" class="inline"/>
{{ $serviceUrl['label'] }}
</flux:link>
</flux:tooltip>
<div x-copy-to-clipboard="'{{ $serviceUrl['href'] }}'">
<flux:button icon="clipboard" size="xs" variant="ghost" class="cursor-pointer">
{{ __('Copy') }}
</flux:button>
</div>
</div>
</div>
@endif
@if($service->url_onion)
<div class="flex items-center gap-2">
<flux:tooltip content="{{ $service->url_onion }}">
<flux:link :href="$service->url_onion" external
class="text-purple-600 dark:text-purple-400">
<flux:icon.lock-closed variant="mini" class="inline"/>
Onion
</flux:link>
</flux:tooltip>
<div x-copy-to-clipboard="'{{ $service->url_onion }}'">
<flux:button icon="clipboard" size="xs" variant="ghost" class="cursor-pointer">
{{ __('Copy') }}
</flux:button>
</div>
</div>
@endif
@if($service->url_i2p)
<div class="flex items-center gap-2">
<flux:tooltip content="{{ $service->url_i2p }}">
<flux:link :href="$service->url_i2p" external
class="text-green-600 dark:text-green-400">
<flux:icon.link variant="mini" class="inline"/>
I2P
</flux:link>
</flux:tooltip>
<div x-copy-to-clipboard="'{{ $service->url_i2p }}'">
<flux:button icon="clipboard" size="xs" variant="ghost" class="cursor-pointer">
{{ __('Copy') }}
</flux:button>
</div>
</div>
@endif
@if($service->url_pkdns)
<div class="flex items-center gap-2">
<flux:tooltip content="{{ $service->url_pkdns }}">
<flux:link :href="$service->url_pkdns" external
class="text-orange-600 dark:text-orange-400">
<flux:icon.link variant="mini" class="inline"/>
pkdns
</flux:link>
</flux:tooltip>
<div x-copy-to-clipboard="'{{ $service->url_pkdns }}'">
<flux:button icon="clipboard" size="xs" variant="ghost" class="cursor-pointer">
{{ __('Copy') }}
</flux:button>
</div>
</div>
@endif
@endif
@endforeach
@if($service->ip)
<div class="flex items-center gap-2">
<span class="font-mono text-sm text-gray-700 dark:text-gray-300">