Skip to content
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
abbfa4a
Add `symfonycasts/reset-password-bundle@1.11` template
Jan 10, 2022
eb0c257
Update templates/security.html.twig
cavasinf Jan 11, 2022
b4eee0e
Re-use existing translations
Jan 11, 2022
76b2781
Update link to redo password reset
Jan 11, 2022
4843248
Add default titles
Jan 11, 2022
5c14296
Add block help request
Jan 11, 2022
0807bdb
Fix indents
Jan 11, 2022
c3f016e
Add base template for `reset_password` templates
Jan 11, 2022
fb0834e
Update DOC
Jan 11, 2022
328c8d1
Add french translations
Jan 31, 2022
2b61fac
BugFix translation FR
Feb 1, 2022
b31899f
Merge branch 'main' into feature/reset-password
Feb 18, 2022
106bcc0
Merge branch 'main' into feature/reset-password
Apr 13, 2022
0148977
Add more detailed french translations
cavasinf May 17, 2022
ff46569
Merge branch 'main' into feature/reset-password
cavasinf Dec 19, 2022
d72b422
Ranme `base` into `_layout` + use submit button macro
cavasinf Dec 19, 2022
bf1f236
Remove unused password-reset html
cavasinf Dec 23, 2022
9b34bae
Rervert BC break from login logo
cavasinf Dec 23, 2022
4f4dfca
Add default english translation
cavasinf Dec 23, 2022
cf49f78
Revert "Remove unused password-reset html"
cavasinf Dec 23, 2022
37539d7
Deprecate the `password-reset` template
cavasinf Dec 23, 2022
78d7a9d
Revert delete config option
cavasinf Jan 5, 2023
33a95c6
Revert delete config option
cavasinf Jan 5, 2023
f85204b
Add link to doc
cavasinf Jan 6, 2023
aafd6fd
Suggest reset-password-bundle
cavasinf Jan 6, 2023
703d23d
Add german translations
cavasinf Jan 6, 2023
2ae492a
`check_email.html.twig` should be `check-email.html.twig`
cavasinf Jan 6, 2023
5681f15
Update DOC
cavasinf Jan 6, 2023
75f60be
Merge branch 'main' into feature/reset-password
cavasinf Jan 6, 2023
fbacc9f
Change translation template EN
cavasinf Jan 6, 2023
950b9de
use alert component
cavasinf Jan 6, 2023
4db12a8
Rename `token` to `expirationMessage`
cavasinf Jan 16, 2023
322aa0c
Merge branch 'kevinpapst:main' into feature/reset-password
cavasinf Dec 12, 2023
51d6f3b
Apply suggestion from @kevinpapst
kevinpapst Dec 6, 2025
0faf2c8
Apply suggestion from @kevinpapst
kevinpapst Dec 6, 2025
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
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"knplabs/knp-menu-bundle": "^3.0"
},
"suggest" : {
"knplabs/knp-menu-bundle" : "Allows easy menu integration"
"knplabs/knp-menu-bundle" : "Allows easy menu integration",
"symfonycasts/reset-password-bundle" : "Includes all Symfony logic to reset user password"
},
"autoload": {
"psr-4": {
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ If you cannot find the needed information in this list of topics, please create
* [Override theme](override_theme.md)
* [Access bundle configuration](twig-context.md)
* [Customizing forms](form_theme.md)
* [Reset password templates](reset_password_pages.md)

Components (Twig macros):

Expand Down
43 changes: 43 additions & 0 deletions docs/reset_password_pages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## How it was made

3 pre-implemented layouts are available for the `reset-password` form.

There are inspired by `symfonycasts/reset-password-bundle@1.11`.
See here: https://github.com/SymfonyCasts/reset-password-bundle

Filenames and variables/forms name follows what `reset-password-bundle` as generated by default.
You can of course override everything if needed.

## Using the layout

In order to use the layouts,
you should extend the one you want from `@Tabler/security/reset_password/`:
- check-email.html.twig
- request.html.twig
- reset.html.twig

Here's an example for the reset request form with the email input.
```twig
{% extends '@Tabler/security/reset_password/request.html.twig' %}

{% block logo_login %}
<a href="." class="navbar-brand navbar-brand-autodark">
<img src="{{ asset('images/logo.svg') }}" height="36">
</a>
{% endblock %}
```

### Extra

You shouldn't directly extend `@Tabler\security\reset_password\_layout.html.twig`,
it's only there to emptying the `login_social_auth` block, and add the flash errors.

If you want to make your own template with that base, you can.

## Layout blocks

TODO explain blocks

## Next steps

Please go back to the [Tabler bundle documentation](README.md) to find out more about using the theme.
2 changes: 1 addition & 1 deletion templates/security.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% block container_before %}{% endblock %}
<div class="{% block container_classes %}container container-tight py-4{% endblock %}">
<div class="text-center mb-4">
<h1>{% block logo_login %}Tabler{% endblock %}</h1>
{% block logo_container %}<h1>{% block logo_login %}Tabler{% endblock %}</h1>{% endblock %}
</div>

<div class="{% block card_classes %}card card-md{% endblock %}">
Expand Down
1 change: 1 addition & 0 deletions templates/security/password-reset.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

{% extends '@Tabler/security.html.twig' %}

{% block login_social_auth %}{% endblock %}
Expand Down
10 changes: 10 additions & 0 deletions templates/security/reset_password/_layout.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends '@Tabler/security.html.twig' %}

{% block login_social_auth %}{% endblock %}

{% block login_box_error %}
{% from '@Tabler/components/alert.html.twig' import alert %}
{% for flashError in app.flashes('reset_password_error') %}
{{ alert({important: true, description : flashError}) }}
{% endfor %}
{% endblock %}
17 changes: 17 additions & 0 deletions templates/security/reset_password/check-email.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{% extends '@Tabler/security/reset_password/_layout.html.twig' %}

{% block title %}
{{ 'Password Reset Email Sent'|trans({}, 'TablerBundle') }}
{% endblock %}

{% block login_box_msg %}
{{ 'Password Reset Email Sent'|trans({}, 'TablerBundle') }}
{% endblock %}

{% block login_form %}
{% set expirationMessage = resetToken.expirationMessageKey|trans(resetToken.expirationMessageData, 'ResetPasswordBundle') %}
<p>
{{ 'If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password. This link will expire in %expirationMessage%.' | trans({'%expirationMessage%' : expirationMessage}, 'TablerBundle') }}
</p>
<p>{{ "If you don't receive an email please check your spam folder or"|trans({}, 'TablerBundle') }} <a href="{{ path('tabler_password_reset'|tabler_route) }}">{{ 'Try again'|trans({}, 'TablerBundle') }}</a>.</p>
{% endblock %}
38 changes: 38 additions & 0 deletions templates/security/reset_password/request.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{% extends '@Tabler/security/reset_password/_layout.html.twig' %}
{% from '@Tabler/components/buttons.html.twig' import submit_button %}

{% block title %}
{{ 'I forgot my password'|trans({}, 'TablerBundle') }}
{% endblock %}

{% block login_box_msg %}
{{ 'I forgot my password'|trans({}, 'TablerBundle') }}
{% endblock %}

{% block login_form %}
{% block request_help %}
<p class="text-muted mb-4">{{ 'Enter your email address and you will be emailed a link that allows to reset your password'|trans({}, 'TablerBundle') }}</p>
{% endblock %}

{{ form_start(requestForm) }}

{{ form_row(requestForm.email) }}

<div class="form-footer">
{{ submit_button('mail', {
title : 'Reset your password'|trans({}, 'TablerBundle'),
class : 'w-100',
combined : true,
}, 'primary') }}
</div>

{{ form_end(requestForm) }}
{% endblock %}

{% block login_actions %}
<div class="text-center text-muted mt-3">
<a href="{{ path('tabler_login'|tabler_route) }}">
{{ 'Back to login'|trans({}, 'TablerBundle') }}
</a>
</div>
{% endblock %}
26 changes: 26 additions & 0 deletions templates/security/reset_password/reset.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% extends '@Tabler/security/reset_password/_layout.html.twig' %}
{% from '@Tabler/components/buttons.html.twig' import submit_button %}

{% block title %}
{{ 'Reset your password'|trans({}, 'TablerBundle') }}
{% endblock %}

{% block login_box_msg %}
{{ 'Reset your password'|trans({}, 'TablerBundle') }}
{% endblock %}

{% block login_form %}
{{ form_start(resetForm) }}

{{ form_row(resetForm.plainPassword) }}

<div class="form-footer">
{{ submit_button(false, {
title : 'Reset your password'|trans({}, 'TablerBundle'),
class : 'w-100',
combined : true,
}, 'primary') }}
</div>

{{ form_end(resetForm) }}
{% endblock %}
20 changes: 20 additions & 0 deletions translations/TablerBundle.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@
<source>Next</source>
<target>Weiter</target>
</trans-unit>
<trans-unit id="948fezF" resname="Password Reset Email Sent">
<source>Password Reset Email Sent</source>
<target>E-Mail für die Zurücksetzung des Passwort wurde gesendet</target>
</trans-unit>
<trans-unit id="5FE896d" resname="Enter your email address and you will be emailed a link that allows to reset your password">
<source>Enter your email address and you will be emailed a link that allows to reset your password</source>
<target>Geben Sie Ihre E-Mail Adresse an und Sie bekommen eine Nachricht um Ihr Passwort zurückzusetzen</target>
</trans-unit>
<trans-unit id="RG984sg" resname="If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password. This link will expire in %expirationMessage%.">
<source>If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password. This link will expire in %expirationMessage%.</source>
<target>Wenn ein Zugang mit Ihrer E-Mail existiert, wurde soeben eine E-Mail dorthin versendet, welche eine Link beinhaltet, mit dem Sie Ihr Passwort zurücksetzen können. Dieser Link wird ablaufen in %expirationMessage%.</target>
</trans-unit>
<trans-unit id="498fEsz" resname="If you don't receive an email please check your spam folder or">
<source>If you don't receive an email please check your spam folder or</source>
<target>Wenn Sie keine E-Mail erhalten, überprüfen Sie bitte Ihren Spam Ordner oder/target>
</trans-unit>
<trans-unit id="EF54d5d" resname="Try again">
<source>Try again</source>
<target>Versuchen Sie es erneut</target>
</trans-unit>
</body>
</file>
</xliff>
20 changes: 20 additions & 0 deletions translations/TablerBundle.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,26 @@
<source>Take me home</source>
<target>Take me home</target>
</trans-unit>
<trans-unit id="948fezF" resname="Password Reset Email Sent">
<source>Password Reset Email Sent</source>
<target>Password Reset Email Sent</target>
</trans-unit>
<trans-unit id="5FE896d" resname="Enter your email address and you will be emailed a link that allows to reset your password">
<source>Enter your email address and you will be emailed a link that allows to reset your password</source>
<target>Enter your email address and you will be emailed a link that allows to reset your password</target>
</trans-unit>
<trans-unit id="RG984sg" resname="If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password. This link will expire in %expirationMessage%.">
<source>If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password. This link will expire in %expirationMessage%.</source>
<target>If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password. This link will expire in %expirationMessage%.</target>
</trans-unit>
<trans-unit id="498fEsz" resname="If you don't receive an email please check your spam folder or">
<source>If you don't receive an email please check your spam folder or</source>
<target>If you don't receive an email please check your spam folder or</target>
</trans-unit>
<trans-unit id="EF54d5d" resname="Try again">
<source>Try again</source>
<target>Try again</target>
</trans-unit>
<trans-unit id="rtYKRSj" resname="http_error.title">
<source>http_error.title</source>
<target>Error</target>
Expand Down
20 changes: 20 additions & 0 deletions translations/TablerBundle.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,26 @@
<source>Take me home</source>
<target>Retourner au début</target>
</trans-unit>
<trans-unit id="948fezF" resname="Password Reset Email Sent">
<source>Password Reset Email Sent</source>
<target>E-mail de réinitialisation du mot de passe a été envoyé</target>
</trans-unit>
<trans-unit id="5FE896d" resname="Enter your email address and you will be emailed a link that allows to reset your password">
<source>Enter your email address and you will be emailed a link that allows to reset your password</source>
<target>Saisissez votre adresse e-mail et la procédure de réinitialisation de votre mot de passe vous sera envoyée par mail</target>
</trans-unit>
<trans-unit id="RG984sg" resname="If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password. This link will expire in %expirationMessage%.">
<source>If an account matching your email exists, then an email was just sent that contains a link that you can use to reset your password. This link will expire in %expirationMessage%.</source>
<target>Si un compte correspond à l'adresse renseignée, un email vient d'être envoyé contenant un lien afin de réinitialiser votre mot de passe. Ce lien expire dans %expirationMessage%.</target>
</trans-unit>
<trans-unit id="498fEsz" resname="If you don't receive an email please check your spam folder or">
<source>If you don't receive an email please check your spam folder or</source>
<target>Si vous n'avez pas reçu d'email, merci de vérifier vos spams ou</target>
</trans-unit>
<trans-unit id="EF54d5d" resname="Try again">
<source>Try again</source>
<target>Essayer à nouveau</target>
</trans-unit>
<trans-unit id="rtYKRSj" resname="http_error.title">
<source>http_error.title</source>
<target>Erreur</target>
Expand Down