From 3e7e513d030c4ade450c61e7a12ce9b164426a19 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 17 Jun 2022 17:42:58 +0200 Subject: [PATCH] wait #4213 @1.5 --- app/Fields/FluidbookChapters.php | 14 ++++++++ app/Models/FluidbookPublication.php | 5 +-- app/SubForms/FluidbookChapter.php | 34 +++++++++++++++++++ .../views/fields/fluidbook_chapters.blade.php | 30 ++++++++++++++++ 4 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 app/Fields/FluidbookChapters.php create mode 100644 app/SubForms/FluidbookChapter.php create mode 100644 resources/views/fields/fluidbook_chapters.blade.php diff --git a/app/Fields/FluidbookChapters.php b/app/Fields/FluidbookChapters.php new file mode 100644 index 000000000..981a2a999 --- /dev/null +++ b/app/Fields/FluidbookChapters.php @@ -0,0 +1,14 @@ +addField('page_numbers', Textarea::class, __('Numérotation')); $this->addField('section_theme', FormBigSection::class, __('Thème graphique')); - $this->addField('theme', \App\Fields\FluidbookTheme::class,__('Thème')); + $this->addField('theme', \App\Fields\FluidbookTheme::class, __('Thème')); $this->addField('section_locale', FormBigSection::class, __('Langue')); $this->addField('locale', FluidbookLocale::class, __('Langue principale'), ['default' => 'fr', 'allows_null' => false, 'filter' => true, 'filter_label' => 'Langue', 'column' => true, 'column_label' => '']); $this->addField('translations', \App\Fields\FluidbookTranslationOverwrite::class, __('Traductions personnalisées')); $this->addField('section_chapters', FormBigSection::class, __('Sommaire')); - $this->addField('chapters', Textarea::class, __('Sommaire')); + $this->addField('chapters', FluidbookChapters::class); $this->addField('section_settings', FormSuperSection::class, __('Paramètres')); diff --git a/app/SubForms/FluidbookChapter.php b/app/SubForms/FluidbookChapter.php new file mode 100644 index 000000000..1da327c3a --- /dev/null +++ b/app/SubForms/FluidbookChapter.php @@ -0,0 +1,34 @@ + ['regular', 'column_head']]; + $this->addField('label', Text::class, __('Nom du chapitre'), ['when' => $when]); + $this->addField('page', Text::class, __('Page'), ['when' => $when]); + $this->addField('color', Color::class, __('Couleur'), ['when' => $when]); + $this->addField('type', SelectFromArray::class, __('Type'), ['default' => 'regular', 'options' => + [ + 'regular' => __('Chapitre normal'), + 'column_head' => __('Titre de colonne') . ' (!!!)', + 'nocut' => __('Empêcher un passage à la colonne suivante') . ' (++)', + 'forcecut' => __('Forcer un passage à la colonne suivante') . ' (--)', + 'separator' => __('Séparateur') . ' (----)', + ] + ]); + $this->addField('level', Hidden::class, __('Niveau')); + + } +} diff --git a/resources/views/fields/fluidbook_chapters.blade.php b/resources/views/fields/fluidbook_chapters.blade.php new file mode 100644 index 000000000..23358c513 --- /dev/null +++ b/resources/views/fields/fluidbook_chapters.blade.php @@ -0,0 +1,30 @@ +@if (!isset($seenFluidbookChapters)) + @php $seenFluidbookChapters=true;@endphp + @push('crud_fields_scripts') + + @endpush + + @push('crud_fields_styles') + + @endpush +@endif +@include('cubist_back::fields.bunch_oneline_multiple') + -- 2.39.5