Remove left-overs after the old Twig Hooks implementation

This commit is contained in:
Jacob Tobiasz 2024-04-29 11:00:55 +02:00
parent e913e9e254
commit 563b1db139
No known key found for this signature in database
GPG key ID: 3F84290201B006E0
8 changed files with 5 additions and 44 deletions

View file

@ -4,7 +4,7 @@
</div>
<div class="card-body">
<div class="row">
{% hook 'billing_address' with { form hookable_metadata.context.form.billingAddress } %}
{% hook 'billing_address' with { form, billingAddress: hookable_metadata.context.form.billingAddress } %}
</div>
</div>
</div>

View file

@ -1,8 +1,5 @@
{% import '@SyliusAdmin/Shared/Helper/money.html.twig' as _money %}
{% set main_hook = hook_name(hookable_metadata.context.parent_main_hook, 'payments') %}
{% set fallback_hook = hook_name(hookable_metadata.context.parent_fallback_hook, 'payments') %}
{% set order = hookable_metadata.context.resource %}
<div class="card mb-3">

View file

@ -1,20 +1,11 @@
{% set main_hook = hook_name(hookable_metadata.context.parent_main_hook, 'sections') %}
{% set fallback_hook = hook_name(hookable_metadata.context.parent_fallback_hook, 'sections') %}
<div class="page-body">
<div class="container-xl">
<div class="row">
<div class="col-12 col-lg-3 order-lg-1">
{% hook [main_hook ~ '#right', fallback_hook ~ '#right'] with hookable_metadata.context|merge({
parent_main_hook: main_hook ~ '#right',
parent_fallback_hook: fallback_hook ~ '#right',
}) %}
{% hook 'sections#right' %}
</div>
<div class="col-12 col-lg-9 order-lg-0">
{% hook [main_hook ~ '#left', fallback_hook ~ '#left'] with hookable_metadata.context|merge({
parent_main_hook: main_hook ~ '#left',
parent_fallback_hook: fallback_hook ~ '#left',
}) %}
{% hook 'sections#left' %}
</div>
</div>
</div>

View file

@ -2,21 +2,13 @@
{% form_theme form '@SyliusAdmin/Shared/form_theme.html.twig' %}
{% set main_hook = hook_name(parent_main_hook, 'form') %}
{% set fallback_hook = hook_name(parent_fallback_hook, 'form') %}
<div class="container-xl" {{ attributes }}>
{{ form_start(form, {'attr': {'class': 'ui loadable form', 'novalidate': 'novalidate', 'id': form.vars.id}}) }}
<input type="hidden" name="_method" value="PUT" />
{{ form_errors(form) }}
{{ form_widget(form._token) }}
{% hook [main_hook, fallback_hook] with {
parent_main_hook: main_hook,
parent_fallback_hook: fallback_hook,
form,
} %}
{% hook 'form' with { form } %}
{{ form_end(form, {render_rest: false}) }}
</div>

View file

@ -1,19 +1,9 @@
{% extends '@SyliusAdmin/Shared/Layout/base.html.twig' %}
{% set fallback_hook = hook_name(_self) %}
{% set main_hook = fallback_hook %}
{% block title %}
{{ 'sylius.ui.generate_variants'|trans }} {{ parent() }}
{% endblock %}
{% block body %}
{% hook main_hook with {
parent_main_hook: main_hook,
parent_fallback_hook: fallback_hook,
resource,
metadata,
configuration,
form,
} %}
{% hook 'sylius_admin.product.generate_variants' with { resource, metadata, configuration, form } %}
{% endblock %}

View file

@ -1,6 +1,3 @@
{% set main_hook = hook_name(hookable_metadata.context.parent_main_hook, 'sections') %}
{% set fallback_hook = hook_name(hookable_metadata.context.parent_fallback_hook, 'sections') %}
<div class="col-12 col-md-8">
{% hook 'sections' %}
</div>

View file

@ -1,6 +1,3 @@
{% set main_hook = hook_name(hookable_metadata.context.parent_main_hook, 'configuration') %}
{% set fallback_hook = hook_name(hookable_metadata.context.parent_fallback_hook, 'configuration') %}
<div class="card mb-3">
<div class="card-header">
<div class="card-title">

View file

@ -1,6 +1,3 @@
{% set main_hook = hook_name(hookable_metadata.context.parent_main_hook, 'rules') %}
{% set fallback_hook = hook_name(hookable_metadata.context.parent_fallback_hook, 'rules') %}
<div class="col-12 col-md-6 mb-3">
<div class="card" {{ sylius_test_html_attribute('rules') }}>
<div class="card-header">