Skip to content

Commit

Permalink
feat(admin): use custom form template to improve translations
Browse files Browse the repository at this point in the history
  • Loading branch information
delyriand committed Jan 27, 2025
1 parent 5d915f4 commit 4d1dec0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Resources/config/sylius/twig_hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@ sylius_twig_hooks:
monsieurbiz.alertmessage.message:
template: '@MonsieurBizSyliusAlertMessagePlugin/message.html.twig'
priority: 900
'sylius_admin.message.update.content.form.sections.general':
default:
enabled: false
general:
template: '@MonsieurBizSyliusAlertMessagePlugin/admin/message/form/sections/general.html.twig'
priority: 100
21 changes: 21 additions & 0 deletions src/Resources/views/admin/message/form/sections/general.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% import '@SyliusAdmin/shared/helper/translations.html.twig' as translations %}

{% set form = hookable_metadata.context.form %}

{{ form_row(form.enabled) }}
{{ form_row(form.customersOnly) }}
{{ form_row(form.channels) }}
{{ form_row(form.name) }}
{{ form_row(form.description) }}
{{ form_row(form.fromDate) }}
{{ form_row(form.toDate) }}
{{ form_row(form.templateHtml) }}

<div class="card mb-3">
<div class="card-header">
<div class="card-title">
{{ 'sylius.ui.translations'|trans }}
</div>
</div>
{{ translations.default(form.translations, null, { accordion_flush: true }) }}
</div>

0 comments on commit 4d1dec0

Please sign in to comment.