Skip to content

Commit

Permalink
fix twigCS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
oallain committed Jan 2, 2024
1 parent 56965b6 commit 2aa9dad
Show file tree
Hide file tree
Showing 118 changed files with 1,192 additions and 1,189 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<div class="card border border-light h-100">
<div class="card-body">
{% include '@SyliusShop/Common/_address.html.twig' with {'address': address} %}
</div>
<div class="card-body">
{% include '@SyliusShop/Common/_address.html.twig' with {'address': address} %}
</div>

<div class="card-footer d-flex justify-content-between align-items-center" id="sylius-default-address" {{ sylius_test_html_attribute('default-address') }}>
<span class="badge bg-primary-100 text-primary-700">{{ 'sylius.ui.your_default_address'|trans }}</span>

<div class="d-flex gap-1">
<a href="{{ path('sylius_shop_account_address_book_update', {'id': address.id}) }}" class="btn btn-link text-secondary fw-bold" {{ sylius_test_html_attribute('edit-button') }}>{{ 'sylius.ui.edit'|trans }}</a>

<form action="{{ path('sylius_shop_account_address_book_delete', {'id': address.id}) }}" method="post" onsubmit="return confirm('{{ " sylius.ui.are_your_sure_you_want_to_perform_this_action"|trans }}');">
<input type="hidden" name="_method" value="DELETE">
<button class="btn btn-link text-danger fw-bold" type="submit">
{{ 'sylius.ui.delete'|trans }}
</button>
<input type="hidden" name="_csrf_token" value="{{ csrf_token(address.id) }}"/>
</form>
</div>
</div>
<div class="d-flex gap-1">
<a href="{{ path('sylius_shop_account_address_book_update', {'id': address.id}) }}" class="btn btn-link text-secondary fw-bold" {{ sylius_test_html_attribute('edit-button') }}>{{ 'sylius.ui.edit'|trans }}</a>

<form action="{{ path('sylius_shop_account_address_book_delete', {'id': address.id}) }}" method="post" onsubmit="return confirm('{{ " sylius.ui.are_your_sure_you_want_to_perform_this_action"|trans }}');">
<input type="hidden" name="_method" value="DELETE">
<button class="btn btn-link text-danger fw-bold" type="submit">
{{ 'sylius.ui.delete'|trans }}
</button>
<input type="hidden" name="_csrf_token" value="{{ csrf_token(address.id) }}"/>
</form>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% set id = app.request.attributes.get('id') %}

{{ form_start(form, {'action': path('sylius_shop_account_address_book_set_as_default', {'id': id}), 'method': 'PATCH'}) }}
<input hidden name="{{ form.defaultAddress.vars['full_name'] }}" value="{{ id }}" />
<button type="submit" class="btn btn-link text-secondary fw-bold" {{ sylius_test_html_attribute('set-as-default-button') }}>
{{ 'sylius.ui.set_as_default'|trans }}
</button>
<input hidden name="{{ form.defaultAddress.vars['full_name'] }}" value="{{ id }}"/>
<button type="submit" class="btn btn-link text-secondary fw-bold" {{ sylius_test_html_attribute('set-as-default-button') }}>
{{ 'sylius.ui.set_as_default'|trans }}
</button>
{{ form_row(form._token) }}
{{ form_end(form, {'render_rest': false}) }}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<div class="card border border-light h-100">
<div class="card-body" {{ sylius_test_html_attribute('address', "%s %s"|format(address.firstName, address.lastName)) }}>
{% include '@SyliusShop/Common/_address.html.twig' with {'address': address} %}
</div>
<div class="card-body" {{ sylius_test_html_attribute('address', "%s %s"|format(address.firstName, address.lastName)) }}>
{% include '@SyliusShop/Common/_address.html.twig' with {'address': address} %}
</div>

<div class="card-footer d-flex justify-content-between">
{{ render(path('sylius_shop_account_address_book_set_as_default', {'id': address.id})) }}
<div class="d-flex gap-1">
<a href="{{ path('sylius_shop_account_address_book_update', {'id': address.id}) }}" class="btn btn-link text-secondary fw-bold" {{ sylius_test_html_attribute('edit-button') }}>{{ 'sylius.ui.edit'|trans }}</a>
<div class="card-footer d-flex justify-content-between">
{{ render(path('sylius_shop_account_address_book_set_as_default', {'id': address.id})) }}
<div class="d-flex gap-1">
<a href="{{ path('sylius_shop_account_address_book_update', {'id': address.id}) }}" class="btn btn-link text-secondary fw-bold" {{ sylius_test_html_attribute('edit-button') }}>{{ 'sylius.ui.edit'|trans }}</a>

<form action="{{ path('sylius_shop_account_address_book_delete', {'id': address.id}) }}" method="post" onsubmit="return confirm('{{ " sylius.ui.are_your_sure_you_want_to_perform_this_action"|trans }}');">
<input type="hidden" name="_method" value="DELETE">
<button class="btn btn-link text-danger fw-bold" type="submit">
{{ 'sylius.ui.delete'|trans }}
</button>
<input type="hidden" name="_csrf_token" value="{{ csrf_token(address.id) }}"/>
</form>
</div>
</div>
<form action="{{ path('sylius_shop_account_address_book_delete', {'id': address.id}) }}" method="post" onsubmit="return confirm('{{ " sylius.ui.are_your_sure_you_want_to_perform_this_action"|trans }}');">
<input type="hidden" name="_method" value="DELETE">
<button class="btn btn-link text-danger fw-bold" type="submit">
{{ 'sylius.ui.delete'|trans }}
</button>
<input type="hidden" name="_csrf_token" value="{{ csrf_token(address.id) }}"/>
</form>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
{{ sylius_template_event('sylius.shop.account.address_book.create.after_content_header', {'address': address}) }}

{{ form_start(form, {'action': path('sylius_shop_account_address_book_create'), 'attr': {'class': 'loadable', 'novalidate': 'novalidate'}}) }}
{% include '@SyliusShop/Common/Form/_address.html.twig' with {'form': form} %}
<div class="row">
<div class="col">
<a href="{{ path('sylius_shop_account_address_book_index') }}" class="btn btn-secondary">
{{ 'sylius.ui.cancel'|trans }}
</a>
</div>
<div class="col-auto">
<button type="submit" class="btn btn-primary" {{ sylius_test_html_attribute('add-address') }}>
{{ 'sylius.ui.add'|trans }}
</button>
</div>
{% include '@SyliusShop/Common/Form/_address.html.twig' with {'form': form} %}
<div class="row">
<div class="col">
<a href="{{ path('sylius_shop_account_address_book_index') }}" class="btn btn-secondary">
{{ 'sylius.ui.cancel'|trans }}
</a>
</div>
<div class="col-auto">
<button type="submit" class="btn btn-primary" {{ sylius_test_html_attribute('add-address') }}>
{{ 'sylius.ui.add'|trans }}
</button>
</div>
</div>

{{ sylius_template_event('sylius.shop.account.address_book.create.form', {'address': address}) }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
{% import '@SyliusShop/Common/Macro/breadcrumbs.html.twig' as breadcrumbs %}

{% block breadcrumb breadcrumbs.standard([
{ 'link': path('sylius_shop_account_dashboard'), 'label': 'sylius.ui.my_account'|trans },
{ 'label': 'sylius.ui.address_book'|trans }
{'link': path('sylius_shop_account_dashboard'), 'label': 'sylius.ui.my_account'|trans},
{'label': 'sylius.ui.address_book'|trans}
]) %}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% import '@SyliusShop/Common/Macro/breadcrumbs.html.twig' as breadcrumbs %}

{% block breadcrumb breadcrumbs.standard([
{ 'link': path('sylius_shop_account_dashboard'), 'label': 'sylius.ui.my_account'|trans },
{ 'label': 'sylius.ui.order_history'|trans }
{'link': path('sylius_shop_account_dashboard'), 'label': 'sylius.ui.my_account'|trans},
{'label': 'sylius.ui.order_history'|trans}
]) %}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% import '@SyliusShop/Common/Macro/breadcrumbs.html.twig' as breadcrumbs %}

{% set orderLabel = "sylius.ui.order"|trans ~ ' <span id="number" ' ~ sylius_test_html_attribute("order-number") ~'>#' ~ order.number ~ '</span>' %}
{% set order_label = "sylius.ui.order"|trans ~ ' <span id="number" ' ~ sylius_test_html_attribute("order-number") ~ '>#' ~ order.number ~ '</span>' %}

{% block breadcrumb breadcrumbs.standard([
{ 'link': path('sylius_shop_account_dashboard'), 'label': 'sylius.ui.my_account'|trans },
{ 'link': path('sylius_shop_account_order_index'), 'label': 'sylius.ui.order_history'|trans },
{ 'label': orderLabel }
{'link': path('sylius_shop_account_dashboard'), 'label': 'sylius.ui.my_account'|trans},
{'link': path('sylius_shop_account_order_index'), 'label': 'sylius.ui.order_history'|trans},
{'label': order_label}
]) %}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
{% import '@SyliusShop/Common/Macro/breadcrumbs.html.twig' as breadcrumbs %}

{% block breadcrumb breadcrumbs.standard([
{ link: path('sylius_shop_account_dashboard'), label: 'sylius.ui.my_account'|trans },
{ label: 'sylius.ui.change_password'|trans }
{link: path('sylius_shop_account_dashboard'), label: 'sylius.ui.my_account'|trans},
{label: 'sylius.ui.change_password'|trans}
]) %}

{% block subcontent %}
Expand Down
134 changes: 67 additions & 67 deletions templates/bundles/SyliusShopBundle/Account/dashboard.html.twig
Original file line number Diff line number Diff line change
@@ -1,92 +1,92 @@
{% extends '@SyliusShop/Account/layout.html.twig' %}

{% block title %}
{{ 'sylius.ui.my_account'|trans }}
|
{{ parent() }}
{{ 'sylius.ui.my_account'|trans }}
|
{{ parent() }}
{% endblock %}

{% import '@SyliusShop/Common/Macro/headers.html.twig' as headers %}
{% import "@SyliusShop/Common/Macro/icons.html.twig" as icons %}
{% import '@SyliusShop/Common/Macro/breadcrumbs.html.twig' as breadcrumbs %}

{% block breadcrumb breadcrumbs.standard([
{ link: path('sylius_shop_account_dashboard'), label: 'sylius.ui.my_account'|trans },
{ label: 'sylius.ui.my_account'|trans }
{link: path('sylius_shop_account_dashboard'), label: 'sylius.ui.my_account'|trans},
{label: 'sylius.ui.my_account'|trans}
]) %}

{% block subcontent %}
{{ headers.default('sylius.ui.my_account'|trans, '', 'sylius.ui.manage_your_personal_information_and_preferences'|trans) }}
{{ headers.default('sylius.ui.my_account'|trans, '', 'sylius.ui.manage_your_personal_information_and_preferences'|trans) }}

{{ sylius_template_event('sylius.shop.account.dashboard.after_content_header', {'customer': customer}) }}
{{ sylius_template_event('sylius.shop.account.dashboard.after_content_header', {'customer': customer}) }}

<div class="card mb-4 border border-light" {{ sylius_test_html_attribute('customer-information') }}>
<div class="card mb-4 border border-light" {{ sylius_test_html_attribute('customer-information') }}>

<div class="card-body">
<strong class="d-block h4 pb-3 border-bottom border-light mb-3">{{ customer.fullName }}</strong>
<div class="card-body">
<strong class="d-block h4 pb-3 border-bottom border-light mb-3">{{ customer.fullName }}</strong>

<dl class="d-flex flex-wrap gap-2 gap-lg-4">
<div class="d-flex flex-column" style="flex: 1">
<dt class="fw-medium mb-2">{{ 'sylius.ui.email'|trans }}</dt>
<dd class="mb-0">
{{ customer.email }}
{% if not customer.user.verified %}
<div class="text-danger fw-bold">
<i class="fa-solid fa-times"></i>
{{ 'sylius.ui.not_verified'|trans }}
</div>
{% endif %}
</dd>
</div>
<div class="d-flex flex-column" style="flex: 1">
<dt class="fw-medium mb-2">{{ 'sylius.ui.phone_number'|trans }}</dt>
<dd class="mb-0">{{ customer.phoneNumber }}</dd>
</div>
<div class="d-flex flex-column" style="flex: 1">
<dt class="fw-medium mb-2">{{ 'sylius.ui.password'|trans }}</dt>
<dd class="mb-0">*********</dd>
</div>
</dl>
</div>
<dl class="d-flex flex-wrap gap-2 gap-lg-4">
<div class="d-flex flex-column" style="flex: 1">
<dt class="fw-medium mb-2">{{ 'sylius.ui.email'|trans }}</dt>
<dd class="mb-0">
{{ customer.email }}
{% if not customer.user.verified %}
<div class="text-danger fw-bold">
<i class="fa-solid fa-times"></i>
{{ 'sylius.ui.not_verified'|trans }}
</div>
{% endif %}
</dd>
</div>
<div class="d-flex flex-column" style="flex: 1">
<dt class="fw-medium mb-2">{{ 'sylius.ui.phone_number'|trans }}</dt>
<dd class="mb-0">{{ customer.phoneNumber }}</dd>
</div>
<div class="d-flex flex-column" style="flex: 1">
<dt class="fw-medium mb-2">{{ 'sylius.ui.password'|trans }}</dt>
<dd class="mb-0">*********</dd>
</div>
</dl>
</div>

<div class="card-footer d-flex flex-wrap">
{% if not customer.user.verified %}
<form action="{{ path('sylius_shop_user_request_verification_token') }}" {{ sylius_test_html_attribute('verification-form') }} method="post">
<button type="submit" class="btn btn-outline-primary" {{ sylius_test_html_attribute('verification-button') }}>
{{ icons.success('me-2') }}
{{ 'sylius.ui.verify'|trans }}
</button>
</form>
{% endif %}
<a href="{{ path('sylius_shop_account_profile_update') }}" class="btn btn-link ms-2">
{{ icons.edit('me-2') }}
{{ 'sylius.ui.edit'|trans }}
</a>
<a href="{{ path('sylius_shop_account_change_password') }}" class="btn btn-link ms-2">
{{ icons.lock('me-2') }}
{{ 'sylius.ui.change_password'|trans }}
</a>
</div>
<div class="card-footer d-flex flex-wrap">
{% if not customer.user.verified %}
<form action="{{ path('sylius_shop_user_request_verification_token') }}" {{ sylius_test_html_attribute('verification-form') }} method="post">
<button type="submit" class="btn btn-outline-primary" {{ sylius_test_html_attribute('verification-button') }}>
{{ icons.success('me-2') }}
{{ 'sylius.ui.verify'|trans }}
</button>
</form>
{% endif %}
<a href="{{ path('sylius_shop_account_profile_update') }}" class="btn btn-link ms-2">
{{ icons.edit('me-2') }}
{{ 'sylius.ui.edit'|trans }}
</a>
<a href="{{ path('sylius_shop_account_change_password') }}" class="btn btn-link ms-2">
{{ icons.lock('me-2') }}
{{ 'sylius.ui.change_password'|trans }}
</a>
</div>

</div>
</div>

{% if customer.defaultAddress %}
<div class="card mb-4 border border-light">
<div class="card-body">
<strong class="d-block h4 pb-3 border-bottom border-light mb-3">{{ 'sylius.ui.default_address'|trans }}</strong>
{% include '@SyliusShop/Common/_address.html.twig' with {'address': customer.defaultAddress} %}
</div>
{% if customer.defaultAddress %}
<div class="card mb-4 border border-light">
<div class="card-body">
<strong class="d-block h4 pb-3 border-bottom border-light mb-3">{{ 'sylius.ui.default_address'|trans }}</strong>
{% include '@SyliusShop/Common/_address.html.twig' with {'address': customer.defaultAddress} %}
</div>

<div class="card-footer">
<a href="{{ path('sylius_shop_account_address_book_update', {'id': customer.defaultAddress.id}) }}" class="btn btn-link me-2">
{{ icons.edit('me-2') }}
{{ 'sylius.ui.edit'|trans }}
</a>
</div>
</div>
{% endif %}
<div class="card-footer">
<a href="{{ path('sylius_shop_account_address_book_update', {'id': customer.defaultAddress.id}) }}" class="btn btn-link me-2">
{{ icons.edit('me-2') }}
{{ 'sylius.ui.edit'|trans }}
</a>
</div>
</div>
{% endif %}

{{ sylius_template_event('sylius.shop.account.dashboard.after_information', {'customer': customer}) }}
{{ sylius_template_event('sylius.shop.account.dashboard.after_information', {'customer': customer}) }}


{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
{% import '@SyliusShop/Common/Macro/breadcrumbs.html.twig' as breadcrumbs %}

{% block breadcrumb breadcrumbs.standard([
{ 'link': path('sylius_shop_account_dashboard'), 'label': 'sylius.ui.my_account'|trans },
{ 'label': 'sylius.ui.personal_information'|trans }
{'link': path('sylius_shop_account_dashboard'), 'label': 'sylius.ui.my_account'|trans},
{'label': 'sylius.ui.personal_information'|trans}
]) %}

{% block subcontent %}
Expand All @@ -20,7 +20,7 @@

{{ sylius_template_event('sylius.shop.account.profile.update.after_content_header', {'customer': customer, 'form': form}) }}

<input type="hidden" name="_method" value="PUT" />
<input type="hidden" name="_method" value="PUT"/>

<div class="row">
<div class="col">{{ form_row(form.firstName) }}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@

{% block content %}

<div class="grid mb-5">
<div class="g-col-12 g-col-md-8 g-start-md-3 g-col-lg-6 g-start-lg-4 mb-3 p-2 p-lg-4 border border-light rounded">
<h1 class="h3">{{ 'sylius.ui.reset_password'|trans }}</h1>
<p>{{ 'sylius.ui.set_a_new_password_for_your_account'|trans }}</p>
{{ sylius_template_event('sylius.shop.request_password_reset_token.after_content_header') }}
<div>
{{ form_start(form, {'action': path('sylius_shop_request_password_reset_token'), 'attr': {'class': 'loadable', 'novalidate': 'novalidate'}}) }}
{{ form_row(form.email, sylius_test_form_attribute('reset-email')) }}

{{ sylius_template_event('sylius.shop.request_password_reset_token.form', {'form': form}) }}

{{ form_row(form._token) }}
<button type="submit" class="btn btn-primary" {{ sylius_test_html_attribute('request-password-reset-button') }}>
{{ 'sylius.ui.reset'|trans }}
</button>
{{ form_end(form, {'render_rest': false}) }}
</div>
</div>
</div>
<div class="grid mb-5">
<div class="g-col-12 g-col-md-8 g-start-md-3 g-col-lg-6 g-start-lg-4 mb-3 p-2 p-lg-4 border border-light rounded">
<h1 class="h3">{{ 'sylius.ui.reset_password'|trans }}</h1>
<p>{{ 'sylius.ui.set_a_new_password_for_your_account'|trans }}</p>

{{ sylius_template_event('sylius.shop.request_password_reset_token.after_content_header') }}
<div>
{{ form_start(form, {'action': path('sylius_shop_request_password_reset_token'), 'attr': {'class': 'loadable', 'novalidate': 'novalidate'}}) }}
{{ form_row(form.email, sylius_test_form_attribute('reset-email')) }}

{{ sylius_template_event('sylius.shop.request_password_reset_token.form', {'form': form}) }}

{{ form_row(form._token) }}
<button type="submit" class="btn btn-primary" {{ sylius_test_html_attribute('request-password-reset-button') }}>
{{ 'sylius.ui.reset'|trans }}
</button>
{{ form_end(form, {'render_rest': false}) }}
</div>
</div>
</div>

{% endblock %}
Loading

0 comments on commit 2aa9dad

Please sign in to comment.