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

OP-329: Forms/elements consistency #507

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
32 changes: 16 additions & 16 deletions src/Menu/ContentManagementMenuBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,11 @@ public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void
;

$cmsRootMenuItem
->addChild('blocks', [
'route' => 'bitbag_sylius_cms_plugin_admin_block_index',
])
->setLabel('bitbag_sylius_cms_plugin.ui.blocks')
->setLabelAttribute('icon', 'block layout')
;

$cmsRootMenuItem
->addChild('media', [
'route' => 'bitbag_sylius_cms_plugin_admin_media_index',
->addChild('collections', [
'route' => 'bitbag_sylius_cms_plugin_admin_collection_index',
])
->setLabel('bitbag_sylius_cms_plugin.ui.media')
->setLabelAttribute('icon', 'file')
->setLabel('bitbag_sylius_cms_plugin.ui.collections')
->setLabelAttribute('icon', 'grid layout')
;

$cmsRootMenuItem
Expand All @@ -48,11 +40,19 @@ public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void
;

$cmsRootMenuItem
->addChild('collections', [
'route' => 'bitbag_sylius_cms_plugin_admin_collection_index',
->addChild('blocks', [
'route' => 'bitbag_sylius_cms_plugin_admin_block_index',
])
->setLabel('bitbag_sylius_cms_plugin.ui.collections')
->setLabelAttribute('icon', 'grid layout')
->setLabel('bitbag_sylius_cms_plugin.ui.blocks')
->setLabelAttribute('icon', 'block layout')
;

$cmsRootMenuItem
->addChild('media', [
'route' => 'bitbag_sylius_cms_plugin_admin_media_index',
])
->setLabel('bitbag_sylius_cms_plugin.ui.media')
->setLabelAttribute('icon', 'file')
;
}
}
4 changes: 4 additions & 0 deletions src/Resources/config/grids/admin/block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ sylius_grid:
code: asc
limits: [10, 25, 50]
fields:
name:
type: string
label: bitbag_sylius_cms_plugin.ui.name
sortable: name
code:
type: string
label: sylius.ui.code
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/config/grids/admin/collection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ sylius_grid:
code: asc
limits: [10, 25, 50]
fields:
name:
type: string
label: bitbag_sylius_cms_plugin.ui.name
sortable: translation.name
code:
type: string
label: bitbag_sylius_cms_plugin.ui.code
Expand All @@ -17,10 +21,6 @@ sylius_grid:
type: string
label: bitbag_sylius_cms_plugin.ui.type
sortable: ~
name:
type: string
label: bitbag_sylius_cms_plugin.ui.name
sortable: translation.name
filters:
search:
type: string
Expand Down
14 changes: 11 additions & 3 deletions src/Resources/config/grids/admin/media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ sylius_grid:
type: string
label: bitbag_sylius_cms_plugin.ui.code
sortable: ~
enabled:
type: twig
label: sylius.ui.enabled
options:
template: "@SyliusUi/Grid/Field/enabled.html.twig"
collections:
type: twig
label: bitbag_sylius_cms_plugin.ui.collections
path: .
options:
template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig"
path:
type: string
label: bitbag_sylius_cms_plugin.ui.path
type:
type: string
label: bitbag_sylius_cms_plugin.ui.type
filters:
search:
type: string
Expand Down
15 changes: 8 additions & 7 deletions src/Resources/config/grids/admin/page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ sylius_grid:
code: asc
limits: [10, 25, 50]
fields:
code:
type: string
label: bitbag_sylius_cms_plugin.ui.code
sortable: ~
name:
type: string
label: bitbag_sylius_cms_plugin.ui.name
sortable: name
slug:
code:
type: string
label: bitbag_sylius_cms_plugin.ui.slug
sortable: translation.slug
label: bitbag_sylius_cms_plugin.ui.code
sortable: ~
enabled:
type: twig
label: sylius.ui.enabled
options:
template: "@SyliusUi/Grid/Field/enabled.html.twig"
collections:
type: twig
label: bitbag_sylius_cms_plugin.ui.collections
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/Block/Crud/_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<div class="column">
<div class="ui segment">
{{ form_errors(form) }}
{{ form_row(form.code) }}
{{ form_row(form.name) }}
{{ form_row(form.code) }}
{{ form_row(form.enabled) }}
{{ form_row(form.channels) }}
{{ form_row(form.locales) }}
Expand Down
8 changes: 4 additions & 4 deletions src/Resources/views/Media/Crud/_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<div class="ui two column stackable grid" data-bb-target="cms-handle-preview">
<div class="column">
<div class="ui segment">
{{ form_row(form.code) }}
{{ form_row(form.name) }}
{{ form_row(form.code) }}
{{ form_row(form.enabled) }}
{{ form_row(form.channels) }}
{{ form_row(form.collections) }}
{{ form_row(form.type) }}
{{ form_row(form.file) }}
{{ form_row(form.enabled) }}
{{ form_row(form.saveWithOriginalName) }}
{{ form_row(form.collections) }}
{{ form_row(form.channels) }}
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/views/Page/Crud/_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<div class="ui two column stackable grid" data-bb-target="cms-handle-preview">
<div class="column">
<div class="ui segment" data-bb-cms-wrapper>
{{ form_row(form.name) }}
{{ form_row(form.code) }}
{{ form_row(form.enabled) }}
{{ form_row(form.name) }}
{{ form_row(form.collections) }}
{{ form_row(form.channels) }}
{{ form_row(form.locales) }}
{{ form_row(form.collections) }}
{{ form_row(form.publishAt) }}
</div>
<div class="ui segment">
Expand Down
Loading