Skip to content

[CS] Fix templates via twig-cs-fixer #1180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Autocomplete/templates/autocomplete_form_theme.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{# EasyAdminAutocomplete form type #}
{% block ux_entity_autocomplete_widget %}
{% if form.autocomplete is defined %}
{{ form_widget(form.autocomplete, { attr: form.autocomplete.vars.attr|merge({ required: required }) }) }}
{{ form_widget(form.autocomplete, {attr: form.autocomplete.vars.attr|merge({required: required})}) }}
{% else %}
{{ form_widget(form) }}
{% endif %}
Expand All @@ -12,4 +12,4 @@
{% set id = form.autocomplete.vars.id %}
{% endif %}
{{ block('form_label') }}
{% endblock ux_entity_autocomplete_label %}
{% endblock ux_entity_autocomplete_label %}
2 changes: 1 addition & 1 deletion src/Dropzone/templates/form_theme.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% block dropzone_widget -%}
{%- set dataController = (attr['data-controller']|default('') ~ ' symfony--ux-dropzone--dropzone')|trim -%}
{%- set attr = attr|merge({ 'data-controller': '', class: (attr.class|default('') ~ ' dropzone-input')|trim}) -%}
{%- set attr = attr|merge({'data-controller': '', class: (attr.class|default('') ~ ' dropzone-input')|trim}) -%}

<div class="dropzone-container" data-controller="{{ dataController }}">
<input type="file" {{ block('widget_attributes') }} data-symfony--ux-dropzone--dropzone-target="input" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{ component_url('component1', { prop1: null, prop2: date }) }}
{{ component_url('component1', {prop1: null, prop2: date}) }}
{{ component_url('alternate_route') }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div{{ attributes }}>
Count: {{ this.count }}
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ component('todo_list', {
items: [
{ text: 'milk'},
{ text: 'cheese'},
{ text: 'milk'},
{text: 'milk'},
{text: 'cheese'},
{text: 'milk'},
]
}) }}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ component('todo_list', {
items: [
{ text: 'milk'},
{ text: 'cheese'},
{ text: 'milk'},
{text: 'milk'},
{text: 'cheese'},
{text: 'milk'},
],
includeDataLiveId: true
}) }}
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
{% endfor %}
{% endset %}

{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }}
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', {link: profiler_url}) }}

{% endif %}
{% endblock %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<twig:Button label='Click me'/>
<twig:Button label='Click me'/>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<twig:Form:SubmitButton label='Submit'/>
<twig:Form:SubmitButton label='Submit'/>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<twig:UserCard :user='user' class='foo'/>
<twig:UserCard :user='user' class='foo'/>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<twig:Button label='Click me' :primary='false'/>
<twig:Button label='Click me' :primary='false'/>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

<twig:Message>
<p>Hey!</p>
</twig:Message>
</twig:Message>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<button{{ attributes.defaults({ class: 'foo', type: 'button' }) }}>Component Content ({{ prop }})</button>
<button{{ attributes.defaults({class: 'foo', type: 'button'}) }}>Component Content ({{ prop }})</button>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<twig:GenericElement element="div" class="divComponent">
{{ outerScope.this.foo }}
{{ outerScope.this.foo }}
</twig:GenericElement>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{ component('component_a', { propA: 'prop a value 1', propB: 'prop b value 1' }) }}
{{ component('component_a', { propA: 'prop a value 2', propB: 'prop b value 2' }) }}
{{ component('component_b', { value: 'b value 1', extra: 'value' }) }}
{{ component('component_a', {propA: 'prop a value 1', propB: 'prop b value 1'}) }}
{{ component('component_a', {propA: 'prop a value 2', propB: 'prop b value 2'}) }}
{{ component('component_b', {value: 'b value 1', extra: 'value'}) }}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<twig:component_a propA propB="hello">
</twig:component_a>
</twig:component_a>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<twig:component_a propA propB='hello'/>
<twig:component_a propA propB='hello'/>
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/_nav.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="nav-component-img d-flex justify-content-center align-items-center me-2"
style="background: {{ package.color }}">
<img width="10" height="10"
src="{{ asset('images/ux_packages/'~package.imageFilename) }}"
src="{{ asset('images/ux_packages/' ~ package.imageFilename) }}"
alt="Image for the {{ package.humanName }} UX package">
</div>
{{ package.humanName }}
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/components/CodeBlock.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
</div>
{% endif %}
<div class="Terminal_body" {{ stimulus_controller('code-expander')}}>
<div class="Terminal_body" {{ stimulus_controller('code-expander') }}>
{% if not showFilename %}
<div class="Terminal_actions">
<twig:CodeBlockButtons source="{{ this.rawSource }}" link="{{ this.githubLink }}"/>
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/components/DocsLink.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div {{ attributes.defaults({ class: 'DocsLink' }) }}>
<div {{ attributes.defaults({class: 'DocsLink'}) }}>
<div class="DocsLink_content">
<p class="DocsLink_title ubuntu-header">
<a href="{{ url }}" class="DocsLink_link"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div {{ attributes.defaults({
class: 'homepage-terminal-swapper'
}) }}>
{% component Terminal with { height: '180px', bottomPadding: 0, processContents: false } %}
{% component Terminal with {height: '180px', bottomPadding: 0, processContents: false} %}
{% block content -%}
<span
style="font-size: 1.2em;"
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/components/Icon.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set default_attributes = {
'class': 'Icon Icon--'~name,
'class': 'Icon Icon--' ~ name,
'role': 'img',
'aria-hidden': 'true',
'aria-label': label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
</button>
{% if saveFailed %}
<small class="text-secondary">Check above for errors</small>
{% endif %}
{% endif %}
{% if areAnyLineItemsEditing %}
<small class="text-secondary">Save all line items before continuing.</small>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
</div>
</form>

{% component BootstrapModal with { id: 'new-category-modal' } %}
{% component BootstrapModal with {id: 'new-category-modal'} %}
{% block modal_header %}
<h5>Add a Category</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/components/PackageBox.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="PackageBox" style="--gradient: {{ package.gradient }};--color: {{ package.color }};">

<div class="PackageBox_logo">
<img width="36" height="36" src="{{ asset('images/ux_packages/'~package.imageFilename) }}"
<img width="36" height="36" src="{{ asset('images/ux_packages/' ~ package.imageFilename) }}"
alt="Image for the {{ package.humanName }} UX package">
</div>

Expand Down
4 changes: 2 additions & 2 deletions ux.symfony.com/templates/components/TodoListForm.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
}) }}
</td>
<td>
{{ form_row(itemForm.vars.button_delete, { label: 'X', attr: { class: 'btn btn-outline-danger' } }) }}
{{ form_row(itemForm.vars.button_delete, {label: 'X', attr: {class: 'btn btn-outline-danger'}}) }}
</td>
</tr>
{% endfor %}
</tbody>
</table>

{{ form_widget(form.todoItems.vars.button_add, { label: '+ Add Item', attr: { class: 'btn btn-outline-primary' } }) }}
{{ form_widget(form.todoItems.vars.button_add, {label: '+ Add Item', attr: {class: 'btn btn-outline-primary'}}) }}

<button type="submit" class="btn btn-success" formnovalidate>Save</button>
{{ form_end(form) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@
{% block demo_content %}
<twig:TodoListForm :form="form" :todoList="todoList" />
{% endblock %}

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ the new `Category` to the database and then does two important things:
(see `bootstrap-modal-controller.js`).
</twig:CodeWithExplanationRow>


<twig:TabbedCodeBlocks :files="[
'src/Twig/BootstrapModal.php',
'templates/components/BootstrapModal.html.twig',
Expand All @@ -49,7 +48,7 @@ the new `Category` to the database and then does two important things:
{% endblock %}

{% block code_block_right %}
{% component CodeBlock with { filename: 'templates/components/InlineEditFood.html.twig', height: '400px' } %}
{% component CodeBlock with {filename: 'templates/components/InlineEditFood.html.twig', height: '400px'} %}
{% block content %}
{{- source('components/InlineEditFood.html.twig') -}}
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/main/_package_in_list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="components-container p-2">
<div class="d-flex">
<div class="live-component-img d-flex justify-content-center align-items-center" style="background: {{ package.gradient }}, {{ package.color }}">
<img width="17px" height="17px" src="{{ asset('images/ux_packages/'~package.imageFilename) }}" alt="Image for the {{ package.humanName }} UX package">
<img width="17px" height="17px" src="{{ asset('images/ux_packages/' ~ package.imageFilename) }}" alt="Image for the {{ package.humanName }} UX package">
</div>
<h4 class="ubuntu-title ps-2 align-self-center">{{ package.humanName }}</h4>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/main/homepage.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<p class="eyebrows" style="margin-top: 111px;">Packages</p>
<div class="d-md-flex justify-content-md-between text-center align-items-center text-md-start">
<h2 class="ubuntu pt-2 component-headlines">Install extra <em class="rainbow-emphasis">Packages</em></h2>
<a style="height: 100%;" class="btn btn-md btn-outline-primary mt-3 mt-md-0" href="{{ path('app_packages')}}">
<a style="height: 100%;" class="btn btn-md btn-outline-primary mt-3 mt-md-0" href="{{ path('app_packages') }}">
Browse all Packages
<twig:Icon name="arrow-right" style="transform: rotate(-45deg);"/>
</a>
Expand Down
2 changes: 1 addition & 1 deletion ux.symfony.com/templates/packageBase.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends 'base.html.twig' %}

{#{% set package = twigPackageHelper.currentPackage() %}#}
{# {% set package = twigPackageHelper.currentPackage() %} #}
{% block title %}{{ package.humanName }} | Symfony UX Packages{% endblock %}

{% block header %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h2 class="ubuntu text-center mt-5">Install It</h2>
<div class="d-flex justify-content-center mt-5">
<div class="col-12 col-md-6">
{% component Terminal with { bottomPadding: 20 } %}
{% component Terminal with {bottomPadding: 20} %}
{% block content %}
composer require {{ package.composerName }}
npm install --force
Expand Down
1 change: 0 additions & 1 deletion ux.symfony.com/templates/ux_packages/cropperjs.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,3 @@
</div>
{% endif %}
{% endblock %}

1 change: 0 additions & 1 deletion ux.symfony.com/templates/ux_packages/notify.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@
<button type="submit" class="btn btn-primary">Send Notification</button>
{{ form_end(form) }}
{% endblock %}

9 changes: 4 additions & 5 deletions ux.symfony.com/templates/ux_packages/turbo.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
courtesy of <a class="font-white text-underline" href="https://turbo.hotwired.dev/" rel="external noopener noreferrer">Turbo</a>

<div style="position: absolute; bottom: 4rem; left: 50%; transform: translateX(-50%);">
{{ include('ux_packages/turbo/_chatMessageCount.html.twig', {messageCount: this.messageCount }) }}
{{ include('ux_packages/turbo/_chatMessageCount.html.twig', {messageCount: this.messageCount}) }}
</div>
{% endblock %}

Expand Down Expand Up @@ -54,13 +54,13 @@
<div class="d-flex justify-content-between">
<div class="flex-grow-1">
{{ form_row(form.name, {
row_attr: { class: 'form-floating' },
attr: { placeholder: 'Enter a name' },
row_attr: {class: 'form-floating'},
attr: {placeholder: 'Enter a name'},
}) }}
</div>
<div class="flex-grow-1 ms-2">
{{ form_row(form.animal, {
row_attr: { class: 'form-floating' },
row_attr: {class: 'form-floating'},
}) }}
</div>
</div>
Expand Down Expand Up @@ -145,4 +145,3 @@

</div>
{% endblock %}

Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@
</form>
</turbo-frame>
{% endblock %}

1 change: 0 additions & 1 deletion ux.symfony.com/templates/ux_packages/turbo/todos.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@
<a class="btn btn-dark mt-5" style="width: 100%;" href="{{ path('app_turbo_add_todo_item') }}">+ Add another item</a>
</turbo-frame>
{% endblock %}

1 change: 0 additions & 1 deletion ux.symfony.com/templates/ux_packages/typed.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@
></span>
</div>
{% endblock %}