Beiträge mit dem Baukasten der Seiten, Galerie-Großansicht mit Blättern
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m42s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m3s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m32s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m41s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m5s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m57s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m59s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m35s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m42s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m3s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m32s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m41s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m5s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m57s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m59s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m35s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3b72b5327e
commit
bdd21a38cb
164 changed files with 1276 additions and 623 deletions
|
|
@ -5,7 +5,6 @@ namespace Inhaus\Plugins\News\Filament\Resources\NewsPosts;
|
|||
use BackedEnum;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\DateTimePicker;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
|
|
@ -184,9 +183,15 @@ class NewsPostResource extends Resource
|
|||
->url(fn (NewsPost $record) => route('news.show', $record))
|
||||
->openUrlInNewTab()
|
||||
->visible(fn (NewsPost $record) => $record->isPublished()),
|
||||
EditAction::make(),
|
||||
// Geschrieben wird im Baukasten-Editor des Portals (wie bei Seiten)
|
||||
Action::make('edit')
|
||||
->label('Bearbeiten')
|
||||
->icon(Heroicon::OutlinedPencilSquare)
|
||||
->url(fn (NewsPost $record) => route('news.editor.edit', $record))
|
||||
->visible(fn (NewsPost $record) => auth()->user()?->can('update', $record) ?? false),
|
||||
DeleteAction::make(),
|
||||
]);
|
||||
])
|
||||
->recordUrl(fn (NewsPost $record) => auth()->user()?->can('update', $record) ? route('news.editor.edit', $record) : null);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
|
|
|
|||
|
|
@ -9,6 +9,13 @@ class CreateNewsPost extends CreateRecord
|
|||
{
|
||||
protected static string $resource = NewsPostResource::class;
|
||||
|
||||
/** Geschrieben wird im Baukasten-Editor des Portals. */
|
||||
public function mount(): void
|
||||
{
|
||||
parent::mount(); // prüft das Recht zum Anlegen
|
||||
$this->redirect(route('news.editor.create'));
|
||||
}
|
||||
|
||||
protected function mutateFormDataBeforeCreate(array $data): array
|
||||
{
|
||||
$data['author_id'] = auth()->id();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,13 @@ class EditNewsPost extends EditRecord
|
|||
{
|
||||
protected static string $resource = NewsPostResource::class;
|
||||
|
||||
/** Bearbeitet wird im Baukasten-Editor des Portals. */
|
||||
public function mount(int|string $record): void
|
||||
{
|
||||
parent::mount($record); // prüft Zugriff (404 bei fremden Beiträgen)
|
||||
$this->redirect(route('news.editor.edit', $this->record));
|
||||
}
|
||||
|
||||
protected function mutateFormDataBeforeSave(array $data): array
|
||||
{
|
||||
if (! NewsPostResource::canPublishIn($data['category_id'] ?? $this->record->category_id)) {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ class ListNewsPosts extends ListRecords
|
|||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make()->label('Neuer Beitrag'),
|
||||
CreateAction::make()->label('Neuer Beitrag')->url(route('news.editor.create')),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue