Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Bootstrap 5 layout support #498

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@

## Installation

```bash
composer require "dachcom-digital/formbuilder":"~5.1.4"
```

OR add to `composer.json`:

```json
"require" : {
"dachcom-digital/formbuilder" : "~5.1.0"
Expand Down Expand Up @@ -93,7 +99,7 @@ Nothing to tell here, it's just [Symfony](https://symfony.com/doc/current/templa
- [Frontend Tips](docs/90_FrontendTips.md)
- [FormBuilder Javascript Plugins](docs/91_Javascript.md)
- [Configuration Flags](docs/100_ConfigurationFlags.md)

- [Custom form templates](docs/110_CustomTemplates.md)
## Upgrade Info
Before updating, please [check our upgrade notes!](UPGRADE.md)

Expand Down
4 changes: 3 additions & 1 deletion config/install/translations/admin.csv
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
"form_builder_form_template.bootstrap_3_layout","Bootstrap 3 Layout","Bootstrap 3 Layout"
"form_builder_form_template.bootstrap_4_horizontal_layout","Bootstrap 4 Horizontal Layout","Bootstrap 4 Horizontales Layout"
"form_builder_form_template.bootstrap_4_layout","Bootstrap 4 Layout","Bootstrap 4 Layout"
"form_builder_form_template.bootstrap_5_horizontal_layout","Bootstrap 5 Horizontal Layout","Bootstrap 5 Horizontales Layout"
"form_builder_form_template.bootstrap_5_layout","Bootstrap 5 Layout","Bootstrap 5 Layout"
"form_builder_form_template.form_div_layout","Form Div Layout","Form Div Layout"
"form_builder_type_container.repeater.option.min","Minimum","Minimum"
"form_builder_type_container.repeater.option.max","Maximum","Maximum"
Expand All @@ -145,4 +147,4 @@
"form_builder.output_workflow.channel.email","Email Channel", "E-Mail Channel"
"form_builder.output_workflow.channel.object","Object Channel", "Object Channel"
"form_builder.output_workflow.channel.api","API Channel", "API Channel"
"form_builder.output_workflow.channel.funnel","Funnel Layer", "Funnel Layer"
"form_builder.output_workflow.channel.funnel","Funnel Layer", "Funnel Layer"
10 changes: 9 additions & 1 deletion config/pimcore/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ form_builder:
value: 'bootstrap_4_horizontal_layout.html.twig'
label: 'form_builder_form_template.bootstrap_4_horizontal_layout'
default: false
bootstrap_5_layout:
value: 'bootstrap_5_layout.html.twig'
label: 'form_builder_form_template.bootstrap_5_layout'
default: false
bootstrap_5_horizontal_layout:
value: 'bootstrap_5_horizontal_layout.html.twig'
label: 'form_builder_form_template.bootstrap_5_horizontal_layout'
default: false
field:
templates:
default:
Expand Down Expand Up @@ -241,4 +249,4 @@ form_builder:
imports:
- { resource: '../backend/base_config.yaml' }
- { resource: '../types/field_types.yaml' }
- { resource: '../types/container_types.yaml' }
- { resource: '../types/container_types.yaml' }
8 changes: 8 additions & 0 deletions tests/Functional/SimpleForm/SimpleFormEditWindowCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ public function testConfigFieldFormTemplateSelector(FunctionalTester $I)
0 => 'bootstrap_4_horizontal_layout.html.twig',
1 => 'Bootstrap 4 Horizontal Layout',
],
5 => [
0 => 'bootstrap_5_layout.html.twig',
1 => 'Bootstrap 5 Layout',
],
6 => [
0 => 'bootstrap_5_horizontal_layout.html.twig',
1 => 'Bootstrap 5 Horizontal Layout',
],
],
];

Expand Down
4 changes: 3 additions & 1 deletion tests/Unit/Config/TemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public function testFormTemplatesConfig()
$this->assertArrayHasKey('bootstrap_3_horizontal_layout', $formConfig['templates']);
$this->assertArrayHasKey('bootstrap_4_layout', $formConfig['templates']);
$this->assertArrayHasKey('bootstrap_4_horizontal_layout', $formConfig['templates']);
$this->assertCount(5, $formConfig['templates']);
$this->assertArrayHasKey('bootstrap_5_layout', $formConfig['templates']);
$this->assertArrayHasKey('bootstrap_5_horizontal_layout', $formConfig['templates']);
$this->assertCount(7, $formConfig['templates']);
}

public function testFormFieldTemplates()
Expand Down
Loading