Skip to content

Commit 7af0bbb

Browse files
authored
Merge pull request #6 from maximehuran/feature/edit-link
Add link to edit block
2 parents 1ac0ad0 + 33b45f8 commit 7af0bbb

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

src/Resources/config/sylius/grid.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ sylius_grid:
99
method: createListQueryBuilder
1010
arguments: ["%locale%"]
1111
limits: [25, 50, 100, 200]
12+
sorting:
13+
id: desc
1214
fields:
15+
id:
16+
type: string
17+
label: monsieurbiz_cms_block.ui.form.id
18+
sortable: ~
1319
code:
1420
type: string
1521
label: monsieurbiz_cms_block.ui.form.code

src/Resources/translations/messages.en.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ monsieurbiz_cms_block:
88
blocks_subheader: "CMS block management"
99
back_to_admin: "Back to admin"
1010
block_not_found: 'Block "%name%" not found.'
11+
edit_block_link: 'Edit bloc «%blockName%»'
1112
form:
13+
id: 'ID'
1214
block_info: 'Block information'
1315
block_content: 'Block content'
1416
enabled: "Enabled"

src/Resources/translations/messages.fr.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ monsieurbiz_cms_block:
88
blocks_subheader: "Gestion des blocs CMS"
99
back_to_admin: "Retour à l'administration"
1010
block_not_found: 'Le bloc "%name%" n''a pas été trouvé.'
11+
edit_block_link: 'Modifier le bloc «%blockName%»'
1112
form:
13+
id: 'ID'
1214
block_info: 'Informations sur le bloc'
1315
block_content: 'Contenu du bloc'
1416
enabled: "Activé"

src/Resources/views/Admin/UiElement/block.html.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ element methods:
99

1010
{% set blockEntity = ui_element.getBlock(element.block) %}
1111
{% if blockEntity and blockEntity.enabled %}
12-
{{ blockEntity.content|monsieurbiz_richeditor_render_field }}
12+
<a href="{{ path('monsieurbiz_cms_block_admin_block_update', {id: blockEntity.id}) }}" class="ui button labeled icon" style="margin-bottom: 20px;">
13+
<i class="pencil icon"></i>
14+
{{ 'monsieurbiz_cms_block.ui.edit_block_link'|trans({'%blockName%': blockEntity.name}) }}
15+
</a>
16+
<div style="border: 2px dashed rgba(34,36,38,0.38); padding: 10px;">
17+
{{ blockEntity.content|monsieurbiz_richeditor_render_field }}
18+
</div>
1319
{% else %}
1420
<div class="ui orange message">
1521
{{ 'monsieurbiz_cms_block.ui.block_not_found'|trans({'%name%': element.block}) }}

0 commit comments

Comments
 (0)