Skip to content

Commit

Permalink
fix: twig coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
tblivet committed Oct 28, 2024
1 parent 33fd6e1 commit 7041d1f
Show file tree
Hide file tree
Showing 28 changed files with 222 additions and 222 deletions.
6 changes: 3 additions & 3 deletions views/templates/block/checklist.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% import "@ModuleAutoUpgrade/macros/icons.html.twig" as icons %}
{% import '@ModuleAutoUpgrade/macros/icons.html.twig' as icons %}

<div class="bootstrap" id="currentConfigurationBlock">
<div class="panel">
Expand Down Expand Up @@ -98,8 +98,8 @@
{{ 'Your store is in maintenance mode'|trans({}) }}
{% else %}
{{ 'Enable maintenance mode and add your maintenance IP in [1]Shop parameters > General > Maintenance[/1]'|trans({
'[1]' : '<a href="' ~ maintenanceLink ~'" target="_blank">',
'[/1]' : '</a>',
'[1]': '<a href="' ~ maintenanceLink ~ '" target="_blank">',
'[/1]': '</a>',
})|raw }}
{% endif %}
</td>
Expand Down
6 changes: 3 additions & 3 deletions views/templates/components/check-requirements.html.twig
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% if requirements.warnings|length > 0 or requirements.errors|length > 0 %}
<div class="check-requirements check-requirements--failed">
<p class="check-requirements__title h3">
{{ "Update requirements"|trans({}) }}
{{ 'Update requirements'|trans({}) }}
</p>

<p class="check-requirements__message">
{{ 'Once all the following conditions are met, you can continue with the update. Read more in the [1]developer documentation[/1].'|trans({
'[1]' : '<a class="link" href="' ~ updateAssistantDocs ~'" target="_blank">',
'[/1]' : '</a>',
'[1]': '<a class="link" href="' ~ updateAssistantDocs ~ '" target="_blank">',
'[/1]': '</a>',
})|raw }}
</p>

Expand Down
12 changes: 6 additions & 6 deletions views/templates/components/local-archive.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@

{% if versionsMismatch and (not unableToFindVersionInXML and not unableToFindVersion) %}
<div class="local-archive__alert">
{% include "@ModuleAutoUpgrade/components/alert.html.twig" with {
title: "",
{{ include('@ModuleAutoUpgrade/components/alert.html.twig', {
title: '',
message: "The PrestaShop version in your archive doesn't match the one in XML file. Please fix this issue and try again.",
alertStatus: "warning",
buttonLabel: "",
buttonUrl: "",
} %}
alertStatus: 'warning',
buttonLabel: '',
buttonUrl: '',
}) }}
</div>
{% endif %}
</div>
Expand Down
8 changes: 4 additions & 4 deletions views/templates/components/logs.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
{% if logsSummaryWarning %}
<div class="logs__summary">
<p class="logs__summary-title h3">
{{ "Warning summary"|trans({}) }}
{{ 'Warning summary'|trans({}) }}
</p>

{% for log in logsSummaryWarning %}
<div class="logs__line logs__line--warning">
{{ log.message }}

{% if log.anchor is defined %}
<a class="logs__summary-anchor link" href="#{{ log.anchor }}">{{ "See warning"|trans({}) }}</a>
<a class="logs__summary-anchor link" href="#{{ log.anchor }}">{{ 'See warning'|trans({}) }}</a>
{% endif %}
</div>
{% endfor %}
Expand All @@ -35,15 +35,15 @@
{% if logsSummaryError %}
<div class="logs__summary">
<p class="logs__summary-title h3">
{{ "Error summary"|trans({}) }}
{{ 'Error summary'|trans({}) }}
</p>

{% for log in logsSummaryError %}
<div class="logs__line logs__line--error">
{{ log.message }}

{% if log.anchor is defined %}
<a class="logs__summary-anchor link" href="#{{ log.anchor }}">{{ "See error"|trans({}) }}</a>
<a class="logs__summary-anchor link" href="#{{ log.anchor }}">{{ 'See error'|trans({}) }}</a>
{% endif %}
</div>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion views/templates/components/modal.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% if modalId %}id="{{ modalId }}"{% endif %}
role="dialog"
tabindex="-1">
<div class="modal-dialog {% if modalSize and modalSize != "md" %}modal-{{ modalSize }}{% endif %}"
<div class="modal-dialog {% if modalSize and modalSize != 'md' %}modal-{{ modalSize }}{% endif %}"
role="document">
<div class="modal-content">
<div class="modal-header">
Expand Down
8 changes: 4 additions & 4 deletions views/templates/components/radio-card-local.html.twig
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% include "@ModuleAutoUpgrade/components/radio-card.html.twig" with {
{{ include('@ModuleAutoUpgrade/components/radio-card.html.twig', {
radioCardId: form_options.local_value,
radioName: form_fields.channel,
radioValue: form_options.local_value,
checked: current_values.channel == form_options.local_value,
title: "Local archive"|trans({}),
message: "Save the archive file of the version you want to update to in the following directory: /admin/autoupgrade/download/"|trans({}),
title: 'Local archive'|trans({}),
message: 'Save the archive file of the version you want to update to in the following directory: /admin/autoupgrade/download/'|trans({}),
archiveCard: true,
enableRequirementsCheck: true,
archiveFiles: local_archives.zip,
xmlFiles: local_archives.xml,
requirements: local_requirements
} %}
}) }}
8 changes: 4 additions & 4 deletions views/templates/components/radio-card-online.html.twig
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% include "@ModuleAutoUpgrade/components/radio-card.html.twig" with {
{{ include('@ModuleAutoUpgrade/components/radio-card.html.twig', {
radioCardId: form_options.online_value,
radioName: form_fields.channel,
radioValue: form_options.online_value,
checked: current_values.channel == form_options.online_value,
required: true,
message: "The maximum version of PrestaShop to which you can upgrade your store, based on its PHP version."|trans({}),
message: 'The maximum version of PrestaShop to which you can upgrade your store, based on its PHP version.'|trans({}),
archiveCard: false,
enableRequirementsCheck: true,
badgeLabel: next_release.badge_label,
badgeStatus: next_release.badge_status,
releaseNote: next_release.release_note,
requirements: online_requirements,
title: "PrestaShop %version%"|trans({'%version%': next_release.version}),
} %}
title: 'PrestaShop %version%'|trans({'%version%': next_release.version}),
}) }}
6 changes: 3 additions & 3 deletions views/templates/components/radio-card.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

{% if archiveCard %}
<div class="radio-card__local-archive">
{% include "@ModuleAutoUpgrade/components/local-archive.html.twig" %}
{{ include('@ModuleAutoUpgrade/components/local-archive.html.twig') }}
</div>
{% endif %}

Expand All @@ -60,12 +60,12 @@
<div class="radio-card__loader"></div>

<div class="radio-card__loader-title">
{{ "Checking requirements..."|trans({}) }}
{{ 'Checking requirements...'|trans({}) }}
</div>
</div>
{% if requirements is not null %}
<div class="radio-card__check-requirements">
{% include "@ModuleAutoUpgrade/components/check-requirements.html.twig" %}
{{ include('@ModuleAutoUpgrade/components/check-requirements.html.twig') }}
</div>
{% endif %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion views/templates/components/render-bool.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "@ModuleAutoUpgrade/components/render-field.html.twig" %}
{% extends '@ModuleAutoUpgrade/components/render-field.html.twig' %}

{% block action_content %}
<div class="render-field__switch">
Expand Down
2 changes: 1 addition & 1 deletion views/templates/components/render-select.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "@ModuleAutoUpgrade/components/render-field.html.twig" %}
{% extends '@ModuleAutoUpgrade/components/render-field.html.twig' %}

{% block action_content %}
<div class="render-field__select">
Expand Down
12 changes: 6 additions & 6 deletions views/templates/layouts/layout.html.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div id="{{ page_parent_id }}" class="{{ ps_version }}">
{% if page == "home" %}
{% include "@ModuleAutoUpgrade/pages/home.html.twig" %}
{% elseif page == "update" %}
{% include "@ModuleAutoUpgrade/pages/update.html.twig" %}
{% elseif page == "rollback" %}
{% include "@ModuleAutoUpgrade/pages/rollback.html.twig" %}
{% if page == 'home' %}
{{ include('@ModuleAutoUpgrade/pages/home.html.twig') }}
{% elseif page == 'update' %}
{{ include('@ModuleAutoUpgrade/pages/update.html.twig') }}
{% elseif page == 'rollback' %}
{{ include('@ModuleAutoUpgrade/pages/rollback.html.twig') }}
{% endif %}
</div>
4 changes: 2 additions & 2 deletions views/templates/layouts/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div id="ua_main">
{% block stepper %}
<div id="ua_stepper">
{% include "@ModuleAutoUpgrade/components/stepper.html.twig" %}
{{ include('@ModuleAutoUpgrade/components/stepper.html.twig') }}
</div>
{% endblock %}

Expand All @@ -16,7 +16,7 @@

{% block privacy %}
<div id="ua_privacy">
{% include "@ModuleAutoUpgrade/components/privacy.html.twig" %}
{{ include('@ModuleAutoUpgrade/components/privacy.html.twig') }}
</div>
{% endblock %}
</div>
Expand Down
20 changes: 10 additions & 10 deletions views/templates/main.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<div class="bootstrap" id="informationBlock">
<div class="panel">
<div class="panel-heading">
{{ "Welcome!"|trans({}) }}
{{ 'Welcome!'|trans({}) }}
</div>
<p>
{{ "Upgrade your store to benefit from the latest improvements, bug fixes and security patches."|trans({}) }}
{{ 'Upgrade your store to benefit from the latest improvements, bug fixes and security patches.'|trans({}) }}
</p>
<p class="alert alert-warning">
{{ "Upgrading your store on your own can be risky. If you don\'t feel comfortable doing the upgrade yourself, many agencies and developers in your area may also provide this kind of service."|trans({}) }}
Expand All @@ -30,15 +30,15 @@
</div>

{# content #}
{% include "@ModuleAutoUpgrade/block/checklist.html.twig" %}
{% include "@ModuleAutoUpgrade/block/upgradeButtonBlock.html.twig" %}
{{ include('@ModuleAutoUpgrade/block/checklist.html.twig') }}
{{ include('@ModuleAutoUpgrade/block/upgradeButtonBlock.html.twig') }}

{% include "@ModuleAutoUpgrade/block/versionComparison.html.twig" %}
{% include "@ModuleAutoUpgrade/block/postUpdateChecklistBlock.html.twig" %}
{% include "@ModuleAutoUpgrade/block/postRestoreChecklistBlock.html.twig" %}
{% include "@ModuleAutoUpgrade/block/activityLog.html.twig" %}
{{ include('@ModuleAutoUpgrade/block/versionComparison.html.twig') }}
{{ include('@ModuleAutoUpgrade/block/postUpdateChecklistBlock.html.twig') }}
{{ include('@ModuleAutoUpgrade/block/postRestoreChecklistBlock.html.twig') }}
{{ include('@ModuleAutoUpgrade/block/activityLog.html.twig') }}

{% include "@ModuleAutoUpgrade/block/rollbackForm.html.twig" %}
{{ include('@ModuleAutoUpgrade/block/rollbackForm.html.twig') }}

<form
action="{{ currentIndex }}&amp;customSubmitAutoUpgrade=1&amp;token={{ token }}"
Expand All @@ -50,7 +50,7 @@
{{ upgradeOptions|raw }}
</form>

{% include "@ModuleAutoUpgrade/block/footer.html.twig" %}
{{ include('@ModuleAutoUpgrade/block/footer.html.twig') }}

<script src="{{ psBaseUri }}modules/autoupgrade/js/jquery.xml2json.js"></script>
<script>
Expand Down
2 changes: 1 addition & 1 deletion views/templates/modals/modal-backup-all.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "@ModuleAutoUpgrade/components/modal.html.twig" %}
{% extends '@ModuleAutoUpgrade/components/modal.html.twig' %}

{% block modal_extra_content %}{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion views/templates/modals/modal-backup-delete.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "@ModuleAutoUpgrade/components/modal.html.twig" %}
{% extends '@ModuleAutoUpgrade/components/modal.html.twig' %}

{% block modal_extra_content %}{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion views/templates/modals/modal-backup.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "@ModuleAutoUpgrade/components/modal.html.twig" %}
{% extends '@ModuleAutoUpgrade/components/modal.html.twig' %}

{% block modal_extra_content %}{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion views/templates/modals/modal-error-report.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "@ModuleAutoUpgrade/components/modal.html.twig" %}
{% extends '@ModuleAutoUpgrade/components/modal.html.twig' %}

{% block modal_content %}
<div class="modal__error-report-content">
Expand Down
2 changes: 1 addition & 1 deletion views/templates/modals/modal-update.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "@ModuleAutoUpgrade/components/modal.html.twig" %}
{% extends '@ModuleAutoUpgrade/components/modal.html.twig' %}

{% block modal_content %}
{% if noBackUp %}
Expand Down
4 changes: 2 additions & 2 deletions views/templates/pages/home.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "@ModuleAutoUpgrade/layouts/page.html.twig" %}
{% extends '@ModuleAutoUpgrade/layouts/page.html.twig' %}

{% block stepper %}{% endblock %}

{% block container_inner %}
{% include "@ModuleAutoUpgrade/steps/home.html.twig" %}
{{ include('@ModuleAutoUpgrade/steps/home.html.twig') }}
{% endblock %}
4 changes: 2 additions & 2 deletions views/templates/pages/rollback.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends "@ModuleAutoUpgrade/layouts/page.html.twig" %}
{% extends '@ModuleAutoUpgrade/layouts/page.html.twig' %}

{% block container_inner %}
{% include "@ModuleAutoUpgrade/steps/restore.html.twig" %}
{{ include('@ModuleAutoUpgrade/steps/restore.html.twig') }}
{% endblock %}
20 changes: 10 additions & 10 deletions views/templates/pages/update.html.twig
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% extends "@ModuleAutoUpgrade/layouts/page.html.twig" %}
{% extends '@ModuleAutoUpgrade/layouts/page.html.twig' %}

{% block container_inner %}
{% if step.code == "update-options" %}
{% include "@ModuleAutoUpgrade/steps/update-options.html.twig" %}
{% elseif step.code == "backup" %}
{% include "@ModuleAutoUpgrade/steps/backup.html.twig" %}
{% elseif step.code == "update" %}
{% include "@ModuleAutoUpgrade/steps/update.html.twig" %}
{% elseif step.code == "post-update" %}
{% include "@ModuleAutoUpgrade/steps/post-update.html.twig" %}
{% if step.code == 'update-options' %}
{{ include('@ModuleAutoUpgrade/steps/update-options.html.twig') }}
{% elseif step.code == 'backup' %}
{{ include('@ModuleAutoUpgrade/steps/backup.html.twig') }}
{% elseif step.code == 'update' %}
{{ include('@ModuleAutoUpgrade/steps/update.html.twig') }}
{% elseif step.code == 'post-update' %}
{{ include('@ModuleAutoUpgrade/steps/post-update.html.twig') }}
{% else %}
{% include "@ModuleAutoUpgrade/steps/version-choice.html.twig" %}
{{ include('@ModuleAutoUpgrade/steps/version-choice.html.twig') }}
{% endif %}
{% endblock %}
30 changes: 15 additions & 15 deletions views/templates/steps/backup.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "@ModuleAutoUpgrade/layouts/step-content.html.twig" %}
{% extends '@ModuleAutoUpgrade/layouts/step-content.html.twig' %}

{% block page_class %}backup-page{% endblock %}

Expand All @@ -15,33 +15,33 @@
</div>

<div class="backup-page__section">
{% include "@ModuleAutoUpgrade/components/render-bool.html.twig" with {
{{ include('@ModuleAutoUpgrade/components/render-bool.html.twig', {
field: {
id: "backup_files_db",
title: "Back up files and database",
desc: "",
id: 'backup_files_db',
title: 'Back up files and database',
desc: '',
type: 'bool',
required: true,
disabled: true,
},
BoolName: "PS_AUTOUP_BACKUP_FILES_DB",
BoolId: "PS_AUTOUP_BACKUP_FILES_DB",
BoolName: 'PS_AUTOUP_BACKUP_FILES_DB',
BoolId: 'PS_AUTOUP_BACKUP_FILES_DB',
val: default_backup_files_and_database,
} %}
}) }}

{% include "@ModuleAutoUpgrade/components/render-bool.html.twig" with {
{{ include('@ModuleAutoUpgrade/components/render-bool.html.twig', {
field: {
id: "backup_files_db",
title: "Include images",
desc: "",
id: 'backup_files_db',
title: 'Include images',
desc: '',
type: 'bool',
required: true,
disabled: true,
},
BoolName: "PS_AUTOUP_BACKUP_WITH_IMAGES",
BoolId: "PS_AUTOUP_BACKUP_WITH_IMAGES",
BoolName: 'PS_AUTOUP_BACKUP_WITH_IMAGES',
BoolId: 'PS_AUTOUP_BACKUP_WITH_IMAGES',
val: default_include_images,
} %}
}) }}
</div>
</div>
{% endblock %}
Expand Down
Loading

0 comments on commit 7041d1f

Please sign in to comment.