Initial commit

This commit is contained in:
2026-05-20 18:25:15 +02:00
commit 95f0b4ff01
288 changed files with 90909 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class EntryMetaItem extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public string $label,
public string $value,
public string $route = "#"
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.entry-meta-item');
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class EntrySectionTitle extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public string $label,
public string $icon = ''
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.entry-section-title');
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class ErrorBlock extends Component
{
private const array ERROR_TYPES = [
'custom' => [
'icon' => 'ban',
'message' => '%s'
],
'page-not-allowed' => [
'icon' => 'shield-ban',
'message' => "You do not have permission to access this page.\nRequired permission: %s"
]
];
public array $errorArray;
/**
* Create a new component instance.
*/
public function __construct(
public string $errorType,
public string $message = ""
)
{
$this->errorArray = self::ERROR_TYPES[$errorType] ?? self::ERROR_TYPES['custom'];
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.error-block');
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class FormErrorText extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public string $message,
public bool $icon = true
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.form-error-text');
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class FormFieldTitle extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public string $name,
public string $helper = "",
public bool $required = false,
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.form-field-title');
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class FormGroupTitle extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public string $label,
public string $icon = ""
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.form-group-title');
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class GalleryField extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public array $oldPaths = [],
public bool $required = true,
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.gallery-field');
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\View\Components;
use App\Models\Language;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class LanguagesSelector extends Component
{
public $languages;
/**
* Create a new component instance.
*/
public function __construct(
public array $selected = [],
public bool $required = true
)
{
$this->languages = Language::orderBy('name')->get();
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.languages-selector');
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class MainImageField extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public string $oldPath = "",
public bool $required = true
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.main-image-field');
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class MarkdownTextarea extends Component
{
public array $toolbar;
/**
* Create a new component instance.
*/
public function __construct(
public string $name,
public string $value = "",
public string $minHeight = "200px",
public bool $required = true
)
{
$this->toolbar = [
'bold', 'italic', 'strikethrough', 'heading', '|', 'quote', 'unordered-list', 'ordered-list', 'check-list', '|', 'link', 'image', '|', 'preview', 'guide'
];
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.markdown-textarea');
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class StaffCreditsField extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public ?string $oldStaffCredits = null // JSON.
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.staff-credits-field');
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class SubmitEntryStatus extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public string $section
)
{
//
}
public function availableStates(): array
{
// TODO: Change for permissions.
return [
'draft' => "Save into my drafts",
'pending' => "Add to submissions queue",
'published' => "Publish it now"
];
}
public function defaultState(): string
{
$availableStates = array_keys( $this->availableStates() );
return in_array('published', $availableStates) ? 'published' : ( in_array('pending', $availableStates) ? 'pending' : 'draft' );
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.submit-entry-status', [ 'states' => $this->availableStates(), 'defaultState' => $this->defaultState(), 'section' => $this->section ]);
}
}

View File

@@ -0,0 +1,39 @@
<?php
namespace App\View\Components;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class SuccessBlock extends Component
{
private const array SUCCESS_TYPES = [
'custom' => [
'icon' => 'check',
'message' => '%s'
]
];
public array $successArray;
/**
* Create a new component instance.
*/
public function __construct(
public string $successType,
public string $message = "",
)
{
$this->successArray = self::SUCCESS_TYPES[$this->successType] ?? self::SUCCESS_TYPES['custom'];
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.success-block');
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\View\Components;
use App\Auth\XenForoUser;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class XenForoAvatar extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public ?XenForoUser $user = null,
)
{
if( $this->user === null )
$this->user = \Auth::user();
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.xen-foro-avatar');
}
}