Skip to content

Commit

Permalink
[BootstrapAdminUi] Reorganize login page Twig hooks (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 authored Nov 22, 2024
2 parents 30b5f7c + 32cf4e5 commit 457a297
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 14 deletions.
6 changes: 1 addition & 5 deletions src/AdminUi/templates/security/login.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
{% block body_class %}d-flex flex-column{% endblock %}

{% block body %}
<div class="page page-center">
<div class="container container-tight py-4">
{% hook 'sylius_admin.security.login' with { form, last_error, last_username } %}
</div>
</div>
{% hook 'sylius_admin.security.login' with { form, last_error, last_username } %}
{% endblock %}
24 changes: 15 additions & 9 deletions src/BootstrapAdminUi/config/app/twig_hooks/security/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
$container->extension('sylius_twig_hooks', [
'hooks' => [
'sylius_admin.security.login' => [
'page' => [
'template' => '@SyliusBootstrapAdminUi/security/common/page.html.twig',
],
],

'sylius_admin.security.login.page' => [
'logo' => [
'template' => '@SyliusBootstrapAdminUi/security/common/logo.html.twig',
],
Expand All @@ -25,39 +31,39 @@
],
],

'sylius_admin.security.login.logo' => [
'sylius_admin.security.login.page.logo' => [
'image' => [
'template' => '@SyliusBootstrapAdminUi/security/common/logo/image.html.twig',
],
],

'sylius_admin.security.login.content' => [
'sylius_admin.security.login.page.content' => [
'header' => [
'template' => '@SyliusBootstrapAdminUi/security/common/content/header.html.twig',
],
'flashes' => [
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/content/flashes.html.twig',
],
'form' => [
'template' => '@SyliusBootstrapAdminUi/security/login/content/form.html.twig',
'template' => '@SyliusBootstrapAdminUi/security/login/page/content/form.html.twig',
],
],

'sylius_admin.security.login.content.form' => [
'sylius_admin.security.login.page.content.form' => [
'error' => [
'template' => '@SyliusBootstrapAdminUi/security/login/content/form/error.html.twig',
'template' => '@SyliusBootstrapAdminUi/security/login/page/content/form/error.html.twig',
],
'username' => [
'template' => '@SyliusBootstrapAdminUi/security/login/content/form/username.html.twig',
'template' => '@SyliusBootstrapAdminUi/security/login/page/content/form/username.html.twig',
],
'password' => [
'template' => '@SyliusBootstrapAdminUi/security/login/content/form/password.html.twig',
'template' => '@SyliusBootstrapAdminUi/security/login/page/content/form/password.html.twig',
],
'remember_me' => [
'template' => '@SyliusBootstrapAdminUi/security/login/content/form/remember_me.html.twig',
'template' => '@SyliusBootstrapAdminUi/security/login/page/content/form/remember_me.html.twig',
],
'submit' => [
'template' => '@SyliusBootstrapAdminUi/security/login/content/form/submit.html.twig',
'template' => '@SyliusBootstrapAdminUi/security/login/page/content/form/submit.html.twig',
],
],
],
Expand Down
5 changes: 5 additions & 0 deletions src/BootstrapAdminUi/templates/security/common/page.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="page page-center">
<div class="container container-tight py-4">
{% hook 'page' %}
</div>
</div>

0 comments on commit 457a297

Please sign in to comment.