Skip to content

Commit

Permalink
OP-329: Add channels column in listing, move path to crud form
Browse files Browse the repository at this point in the history
  • Loading branch information
jkindly committed Jul 15, 2024
1 parent 42b01c1 commit ce2eef1
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/Form/Type/MediaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'multiple' => true,
'expanded' => true,
])
->add('path', TextType::class, [
'label' => 'bitbag_sylius_cms_plugin.ui.path',
'disabled' => true,
'required' => false,
])
->add('translations', ResourceTranslationsType::class, [
'entry_type' => MediaTranslationType::class,
])
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/grids/admin/block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ sylius_grid:
path: .
options:
template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig"
channels:
type: twig
label: bitbag_sylius_cms_plugin.ui.channels
path: .
options:
template: "@BitBagSyliusCmsPlugin/Grid/Field/channels.html.twig"
filters:
search:
type: string
Expand Down
9 changes: 6 additions & 3 deletions src/Resources/config/grids/admin/media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ sylius_grid:
path: .
options:
template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig"
path:
type: string
label: bitbag_sylius_cms_plugin.ui.path
channels:
type: twig
label: bitbag_sylius_cms_plugin.ui.channels
path: .
options:
template: "@BitBagSyliusCmsPlugin/Grid/Field/channels.html.twig"
filters:
search:
type: string
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/config/grids/admin/page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ sylius_grid:
path: .
options:
template: "@BitBagSyliusCmsPlugin/Grid/Field/collections.html.twig"
channels:
type: twig
label: bitbag_sylius_cms_plugin.ui.channels
path: .
options:
template: "@BitBagSyliusCmsPlugin/Grid/Field/channels.html.twig"
filters:
search:
type: string
Expand Down
3 changes: 3 additions & 0 deletions src/Resources/views/Grid/Field/channels.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% for channel in data.channels %}
<span class="ui label">{{ channel.code }}</span>
{% endfor %}
1 change: 1 addition & 0 deletions src/Resources/views/Media/Crud/_form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{{ form_row(form.type) }}
{{ form_row(form.file) }}
{{ form_row(form.saveWithOriginalName) }}
{{ form_row(form.path) }}
</div>
</div>
</div>
Expand Down

0 comments on commit ce2eef1

Please sign in to comment.