diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources')
6 files changed, 107 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml index c734a3a5..062e1651 100644 --- a/src/Wallabag/CoreBundle/Resources/config/services.yml +++ b/src/Wallabag/CoreBundle/Resources/config/services.yml | |||
@@ -22,9 +22,17 @@ services: | |||
22 | - @security.context | 22 | - @security.context |
23 | - %theme% # default theme from parameters.yml | 23 | - %theme% # default theme from parameters.yml |
24 | 24 | ||
25 | # custom form type | ||
25 | wallabag_core.form.type.config: | 26 | wallabag_core.form.type.config: |
26 | class: Wallabag\CoreBundle\Form\Type\ConfigType | 27 | class: Wallabag\CoreBundle\Form\Type\ConfigType |
27 | arguments: | 28 | arguments: |
28 | - %liip_theme.themes% | 29 | - %liip_theme.themes% |
29 | tags: | 30 | tags: |
30 | - { name: form.type, alias: config } | 31 | - { name: form.type, alias: config } |
32 | |||
33 | wallabag_core.form.type.forgot_password: | ||
34 | class: Wallabag\CoreBundle\Form\Type\ForgotPasswordType | ||
35 | arguments: | ||
36 | - @doctrine | ||
37 | tags: | ||
38 | - { name: form.type, alias: forgot_password } | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/Mail/forgotPassword.txt.twig b/src/Wallabag/CoreBundle/Resources/views/Mail/forgotPassword.txt.twig new file mode 100644 index 00000000..631bcb88 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Mail/forgotPassword.txt.twig | |||
@@ -0,0 +1,6 @@ | |||
1 | Hello {{username}}! | ||
2 | |||
3 | To reset your password - please visit {{confirmationUrl}} | ||
4 | |||
5 | Regards, | ||
6 | Wallabag bot | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/Security/checkEmail.html.twig b/src/Wallabag/CoreBundle/Resources/views/Security/checkEmail.html.twig new file mode 100644 index 00000000..056d65b5 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Security/checkEmail.html.twig | |||
@@ -0,0 +1,17 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{% trans %}Forgot password{% endtrans %}{% endblock %} | ||
4 | |||
5 | {% block body_class %}login{% endblock %} | ||
6 | |||
7 | {% block menu %}{% endblock %} | ||
8 | |||
9 | {% block content %} | ||
10 | <form> | ||
11 | <fieldset class="w500p center"> | ||
12 | <h2 class="mbs txtcenter">{% trans %}Forgot password{% endtrans %}</h2> | ||
13 | |||
14 | <p>{{ 'An email has been sent to %email%. It contains a link you must click to reset your password.'|trans({'%email%': email}) }}</p> | ||
15 | </fieldset> | ||
16 | </form> | ||
17 | {% endblock %} | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/Security/forgotPassword.html.twig b/src/Wallabag/CoreBundle/Resources/views/Security/forgotPassword.html.twig new file mode 100644 index 00000000..4476ea7b --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Security/forgotPassword.html.twig | |||
@@ -0,0 +1,31 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{% trans %}Forgot password{% endtrans %}{% endblock %} | ||
4 | |||
5 | {% block body_class %}login{% endblock %} | ||
6 | |||
7 | {% block menu %}{% endblock %} | ||
8 | |||
9 | {% block content %} | ||
10 | <form action="{{ path('forgot_password') }}" method="post" name="forgotPasswordform"> | ||
11 | <fieldset class="w500p center"> | ||
12 | <h2 class="mbs txtcenter">{% trans %}Forgot password{% endtrans %}</h2> | ||
13 | |||
14 | {{ form_errors(form) }} | ||
15 | |||
16 | <p>Enter your email address below and we'll send you password reset instructions.</p> | ||
17 | |||
18 | <div class="row"> | ||
19 | {{ form_label(form.email) }} | ||
20 | {{ form_errors(form.email) }} | ||
21 | {{ form_widget(form.email) }} | ||
22 | </div> | ||
23 | |||
24 | <div class="row mts txtcenter"> | ||
25 | <button type="submit">Send me reset instructions</button> | ||
26 | </div> | ||
27 | </fieldset> | ||
28 | |||
29 | {{ form_rest(form) }} | ||
30 | </form> | ||
31 | {% endblock %} | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/Security/login.html.twig b/src/Wallabag/CoreBundle/Resources/views/Security/login.html.twig index eb8f08c8..f669574e 100644 --- a/src/Wallabag/CoreBundle/Resources/views/Security/login.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/Security/login.html.twig | |||
@@ -5,15 +5,19 @@ | |||
5 | {% block body_class %}login{% endblock %} | 5 | {% block body_class %}login{% endblock %} |
6 | 6 | ||
7 | {% block menu %}{% endblock %} | 7 | {% block menu %}{% endblock %} |
8 | {% block messages %}{% endblock %} | ||
8 | 9 | ||
9 | {% block content %} | 10 | {% block content %} |
10 | {% if error %} | ||
11 | <div>{{ error.message }}</div> | ||
12 | {% endif %} | ||
13 | |||
14 | <form action="{{ path('login_check') }}" method="post" name="loginform"> | 11 | <form action="{{ path('login_check') }}" method="post" name="loginform"> |
15 | <fieldset class="w500p center"> | 12 | <fieldset class="w500p center"> |
16 | <h2 class="mbs txtcenter">{% trans %}Login to wallabag{% endtrans %}</h2> | 13 | <h2 class="mbs txtcenter">{% trans %}Login to wallabag{% endtrans %}</h2> |
14 | {% if error %} | ||
15 | <div>{{ error.message }}</div> | ||
16 | {% endif %} | ||
17 | |||
18 | {% for flashMessage in app.session.flashbag.get('notice') %} | ||
19 | <p>{{ flashMessage }}</p> | ||
20 | {% endfor %} | ||
17 | 21 | ||
18 | <div class="row"> | 22 | <div class="row"> |
19 | <label class="col w150p" for="username">{% trans %}Username{% endtrans %}</label> | 23 | <label class="col w150p" for="username">{% trans %}Username{% endtrans %}</label> |
@@ -26,7 +30,8 @@ | |||
26 | </div> | 30 | </div> |
27 | 31 | ||
28 | <div class="row mts txtcenter"> | 32 | <div class="row mts txtcenter"> |
29 | <button type="submit">login</button> | 33 | <button type="submit">Login</button> |
34 | <a href="{{ path('forgot_password') }}" class="small">Forgot your password?</a> | ||
30 | </div> | 35 | </div> |
31 | </fieldset> | 36 | </fieldset> |
32 | </form> | 37 | </form> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/Security/reset.html.twig b/src/Wallabag/CoreBundle/Resources/views/Security/reset.html.twig new file mode 100644 index 00000000..fda88af2 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/Security/reset.html.twig | |||
@@ -0,0 +1,35 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{% trans %}Change password{% endtrans %}{% endblock %} | ||
4 | |||
5 | {% block body_class %}login{% endblock %} | ||
6 | |||
7 | {% block menu %}{% endblock %} | ||
8 | |||
9 | {% block content %} | ||
10 | <form action="{{ path('forgot_password_reset', {'token': token}) }}" method="post" name="loginform"> | ||
11 | <fieldset class="w500p center"> | ||
12 | <h2 class="mbs txtcenter">{% trans %}Change password{% endtrans %}</h2> | ||
13 | |||
14 | {{ form_errors(form) }} | ||
15 | |||
16 | <div class="row"> | ||
17 | {{ form_label(form.new_password.first) }} | ||
18 | {{ form_errors(form.new_password.first) }} | ||
19 | {{ form_widget(form.new_password.first) }} | ||
20 | </div> | ||
21 | |||
22 | <div class="row"> | ||
23 | {{ form_label(form.new_password.second) }} | ||
24 | {{ form_errors(form.new_password.second) }} | ||
25 | {{ form_widget(form.new_password.second) }} | ||
26 | </div> | ||
27 | |||
28 | <div class="row mts txtcenter"> | ||
29 | <button type="submit">Change password</button> | ||
30 | </div> | ||
31 | </fieldset> | ||
32 | |||
33 | {{ form_rest(form) }} | ||
34 | </form> | ||
35 | {% endblock %} | ||