From: Vincent Vanwaelscappel Date: Thu, 7 Jul 2022 18:27:40 +0000 (+0200) Subject: wip #4213 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d3882a69b53cf911c6817f5502c5ada550ef01d2;p=fluidbook-toolbox.git wip #4213 @2 --- diff --git a/app/Fields/FluidbookChapterLevel.php b/app/Fields/FluidbookChapterLevel.php new file mode 100644 index 000000000..896ac3d50 --- /dev/null +++ b/app/Fields/FluidbookChapterLevel.php @@ -0,0 +1,12 @@ + ['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('label', Text::class, __('Nom du chapitre'), ['when' => $when, 'placeholder' => __('Label')]); + $this->addField('page', Text::class, __('Page'), ['when' => $when, 'placeholder' => __('Page')]); + $this->addField('color', Color::class, __('Couleur'), ['when' => $when, 'allows_empty' => true, 'allows_alpha' => false, 'default' => null]); $this->addField('type', SelectFromArray::class, __('Type'), ['default' => 'regular', 'options' => [ 'regular' => __('Chapitre normal'), @@ -28,7 +27,7 @@ class FluidbookChapter extends SubForm 'separator' => __('Séparateur') . ' (----)', ] ]); - $this->addField('level', Hidden::class, __('Niveau')); + $this->addField('level', FluidbookChapterLevel::class, __('Niveau'), ['default' => 1, 'min' => 1, 'max' => 4]); } } diff --git a/resources/views/fields/fluidbook_chapter_level.blade.php b/resources/views/fields/fluidbook_chapter_level.blade.php new file mode 100644 index 000000000..f482130f0 --- /dev/null +++ b/resources/views/fields/fluidbook_chapter_level.blade.php @@ -0,0 +1,77 @@ +@php + $v=old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? ''; + if(!is_string($v)){ + $v=json_encode($v); + } +@endphp + +@if (!isset($seenFluidbookChapterLevel)) + @php $seenFluidbookChapterLevel=true;@endphp + @push('crud_fields_scripts') + + @endpush + + @push('crud_fields_styles') + + @endpush +@endif + +@include('crud::fields.inc.wrapper_start') + + + + + +@include('crud::fields.inc.wrapper_end') + + diff --git a/resources/views/fields/fluidbook_chapters.blade.php b/resources/views/fields/fluidbook_chapters.blade.php index 23358c513..d9762ffe6 100644 --- a/resources/views/fields/fluidbook_chapters.blade.php +++ b/resources/views/fields/fluidbook_chapters.blade.php @@ -2,14 +2,18 @@ @php $seenFluidbookChapters=true;@endphp @push('crud_fields_scripts') @endpush @push('crud_fields_styles') @endpush @endif + @include('cubist_back::fields.bunch_oneline_multiple')