mirror of
https://github.com/pelican-dev/panel.git
synced 2025-06-30 20:31:08 +02:00
Fix Editing Files
This commit is contained in:
parent
4f3e07d4e4
commit
0c3baa5cd8
@ -118,16 +118,14 @@ class EditFiles extends Page
|
|||||||
->icon('tabler-x')
|
->icon('tabler-x')
|
||||||
->url(fn () => ListFiles::getUrl(['path' => dirname($this->path)])),
|
->url(fn () => ListFiles::getUrl(['path' => dirname($this->path)])),
|
||||||
])
|
])
|
||||||
->footerActionsAlignment(Alignment::End)
|
->footerActionsAlignment(Alignment::End) //TODO MISSING PADDING
|
||||||
->schema([
|
->schema([
|
||||||
Select::make('lang')
|
Select::make('lang') //TODO BROKEN
|
||||||
->label('Syntax Highlighting')
|
->label('Syntax Highlighting')
|
||||||
->searchable()
|
->searchable()
|
||||||
->native(false)
|
|
||||||
->live()
|
->live()
|
||||||
->options(EditorLanguages::class)
|
->options(EditorLanguages::class)
|
||||||
->selectablePlaceholder(false)
|
->selectablePlaceholder(false)
|
||||||
->afterStateUpdated(fn ($state) => $this->dispatch('setLanguage', lang: $state))
|
|
||||||
->default(fn () => EditorLanguages::fromWithAlias(pathinfo($this->path, PATHINFO_EXTENSION))),
|
->default(fn () => EditorLanguages::fromWithAlias(pathinfo($this->path, PATHINFO_EXTENSION))),
|
||||||
CodeEditor::make('editor')
|
CodeEditor::make('editor')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
@ -165,7 +163,8 @@ class EditFiles extends Page
|
|||||||
$this->redirect(ListFiles::getUrl(['path' => dirname($this->path)]));
|
$this->redirect(ListFiles::getUrl(['path' => dirname($this->path)]));
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
]),
|
])
|
||||||
|
->columnSpanFull(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +207,7 @@ class EditFiles extends Page
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'form' => $this->form(static::getResource()::form(
|
'form' => $this->form(static::getResource()::form(
|
||||||
$this->makeForm()
|
$this->makeSchema()
|
||||||
->statePath($this->getFormStatePath())
|
->statePath($this->getFormStatePath())
|
||||||
->columns($this->hasInlineLabels() ? 1 : 2)
|
->columns($this->hasInlineLabels() ? 1 : 2)
|
||||||
->inlineLabel($this->hasInlineLabels()),
|
->inlineLabel($this->hasInlineLabels()),
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
<x-filament-panels::page class="fi-resource-edit-file-page">
|
<x-filament-panels::page class="fi-resource-edit-file-page">
|
||||||
<x-filament-panels::form
|
<form>
|
||||||
id="form"
|
|
||||||
:wire:key="$this->getId() . '.forms.' . $this->getFormStatePath()"
|
|
||||||
wire:submit="save"
|
|
||||||
>
|
|
||||||
{{ $this->form }}
|
{{ $this->form }}
|
||||||
</x-filament-panels::form>
|
</form>
|
||||||
</x-filament-panels::page>
|
<x-filament-actions::modals />
|
||||||
|
</x-filament-panels::form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user