Duplicate records as drafts, and preview them from the form

The copy keeps the content, stack and team, but is unpublished, out of any
review, and gets a title marked as a copy and a free slug. It replaces
Filament's replicate action, which left the copy without a slug and still
published. The same copy is available through the API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 10:14:51 +02:00
parent 70521d4bc9
commit 366568b793
18 changed files with 486 additions and 64 deletions

View File

@@ -144,6 +144,15 @@ return [
'select_all' => 'Selecciona-ho tot',
],
'duplicate' => [
'label' => 'Duplicar',
'heading' => 'Duplicar com a esborrany',
'hint' => 'Es crea una còpia amb el mateix contingut, sense publicar i fora de qualsevol revisió, i s\'obre per editar-la.',
'done' => 'Còpia creada',
'title_suffix' => '(còpia)',
'slug_suffix' => 'copia',
],
'permissions' => [
'groups' => [
'general' => 'General',
@@ -182,12 +191,6 @@ return [
],
],
'actions' => [
'duplicate' => 'Duplicar',
'duplicate_heading' => 'Duplicar aquest registre',
'duplicated' => 'Duplicat. Posa-li un slug i una data abans de publicar-lo.',
],
'preview' => [
'label' => 'Vista prèvia',
'heading' => 'Enllaços de vista prèvia',

View File

@@ -144,6 +144,15 @@ return [
'select_all' => 'Select all',
],
'duplicate' => [
'label' => 'Duplicate',
'heading' => 'Duplicate as a draft',
'hint' => 'A copy with the same content is made, unpublished and out of any review, and opened for editing.',
'done' => 'Copy made',
'title_suffix' => '(copy)',
'slug_suffix' => 'copy',
],
'permissions' => [
'groups' => [
'general' => 'General',
@@ -182,12 +191,6 @@ return [
],
],
'actions' => [
'duplicate' => 'Duplicate',
'duplicate_heading' => 'Duplicate this record',
'duplicated' => 'Duplicated. Give it a slug and a date before publishing it.',
],
'preview' => [
'label' => 'Preview',
'heading' => 'Preview links',

View File

@@ -144,6 +144,15 @@ return [
'select_all' => 'Seleccionar todos',
],
'duplicate' => [
'label' => 'Duplicar',
'heading' => 'Duplicar como borrador',
'hint' => 'Se crea una copia con el mismo contenido, sin publicar y fuera de cualquier revisión, y se abre para editarla.',
'done' => 'Copia creada',
'title_suffix' => '(copia)',
'slug_suffix' => 'copia',
],
'permissions' => [
'groups' => [
'general' => 'General',
@@ -182,12 +191,6 @@ return [
],
],
'actions' => [
'duplicate' => 'Duplicar',
'duplicate_heading' => 'Duplicar este registro',
'duplicated' => 'Duplicado. Ponle un slug y una fecha antes de publicarlo.',
],
'preview' => [
'label' => 'Vista previa',
'heading' => 'Enlaces de vista previa',