From 869dde763401f3c5e6478b45f031f4d624a2b1dc Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 19 Oct 2021 17:42:23 +0200 Subject: [PATCH] wip #4795 @1 --- app/Models/Asset.php | 3 ++- app/Models/Publication.php | 2 +- app/SubForms/ResourceMemo.php | 1 - app/SubForms/ResourceSubChapter.php | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index 9f4d5aa..9e731f0 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -4,6 +4,7 @@ namespace App\Models; use Cubist\Backpack\Magic\Fields\Files; use Cubist\Backpack\Magic\Fields\SelectFromArray; +use Cubist\Backpack\Magic\Fields\SelectFromModel; use Cubist\Backpack\Magic\Fields\Tags; use Cubist\Backpack\Magic\Fields\Text; use Cubist\Backpack\Magic\Models\CubistMagicAbstractModel; @@ -39,7 +40,7 @@ class Asset extends CubistMagicAbstractModel 'column' => true, ]); $this->addField('file_upload', Files::class, 'Fichier'); - $this->addField('theme', 'SelectFromModel', 'Thème', ['optionsmodel' => AssetTheme::class]); + $this->addField('theme', SelectFromModel::class, 'Thème', ['optionsmodel' => AssetTheme::class, 'allows_null' => true, 'column' => true]); $this->addField('keywords', Tags::class, 'Mots-clé', ['column' => true]); } diff --git a/app/Models/Publication.php b/app/Models/Publication.php index 33af7c8..8afdc0c 100644 --- a/app/Models/Publication.php +++ b/app/Models/Publication.php @@ -26,7 +26,7 @@ class Publication extends CubistMagicAbstractModel $this->addField('document', Files::class, 'Document', ['tab' => 'Publication interactive']); $this->addField('precompiled', Files::class, 'Fluidbook Précompilé', ['can' => 'precompiled', 'tab' => 'Publication interactive']); - $this->addField('logo', Text::class, 'Logo', ['tab' => 'Contenus']); + $this->addField('logo', Images::class, 'Logo', ['tab' => 'Contenus']); $this->addField('subtitle', Text::class, 'Sous-titre', ['tab' => 'Contenus']); $this->addField('illustration', Images::class, 'Image', ['tab' => 'Contenus']); $this->addField('button', Text::class, 'Intitulé du bouton', ['tab' => 'Contenus']); diff --git a/app/SubForms/ResourceMemo.php b/app/SubForms/ResourceMemo.php index db278c3..8d511ed 100644 --- a/app/SubForms/ResourceMemo.php +++ b/app/SubForms/ResourceMemo.php @@ -13,7 +13,6 @@ class ResourceMemo extends SubForm parent::init(); $this->addField('memo_title', 'Text', 'Titre'); - $this->addField('memo_text', 'Textarea', 'Chapo'); $this->addField('memo_pdf', Files::class, 'PDF'); $this->addField('memo_image', Images::class, 'Vignette'); } diff --git a/app/SubForms/ResourceSubChapter.php b/app/SubForms/ResourceSubChapter.php index 88d748a..97c30d8 100644 --- a/app/SubForms/ResourceSubChapter.php +++ b/app/SubForms/ResourceSubChapter.php @@ -12,6 +12,7 @@ class ResourceSubChapter extends SubForm parent::init(); $this->addField('subchapter_title', 'Text', 'Titre du sous-chapitre'); + $this->addField('subchapter_subtitle', 'Textarea', 'Chapo du sous-chapitre'); $this->addField('subchapter_memos', BunchOfFieldsMultiple::class, 'Mémos', ['bunch' => ResourceMemo::class, 'add_label' => 'Ajouter un mémo']); } -- 2.39.5