Skip to content

Commit

Permalink
login: update reset password message
Browse files Browse the repository at this point in the history
* Adds a warning message to the user without email address.

Co-Authored-by: Johnny Mariéthoz <[email protected]>
  • Loading branch information
jma committed Nov 12, 2020
1 parent fb01784 commit ff3f1e7
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions rero_ils/templates/rero_ils/forgot_password.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,35 @@

{% block panel %}
{%- with form = forgot_password_form %}
<div class="card text-center m-4">
<h3 class="card-title my-4">{{_('Reset Password')}}</h3>
<div class="card-body">
{%- if messages %}
{%- for category, message in messages %}
<p>{{ message }}</p>
{%- endfor %}
{%- else %}
<p class="text-left">{{_('Enter your email address below and we will send you a link to reset your password.')}}</p>
<form action="{{ url_for_security('forgot_password') }}" method="POST" name="forgot_password_form">
<div class="card text-center m-4">
<h3 class="card-title my-4">{{_('Reset Password')}}</h3>
<div class="card-body">
{%- if messages %}
{%- for category, message in messages %}
<p>{{ message }}</p>
{%- endfor %}
{%- else %}
<p class="text-left">{{_('Enter your email address below and we will send you a link to reset your password.')}}</p>
<div class="alert alert-warning" role="alert">
{{_('If you are registered without email, please contact your library.')}}
</div>
<form action="{{ url_for_security('forgot_password') }}" method="POST" name="forgot_password_form">
{{ form.hidden_tag() }}
{{ render_field(form.email, icon="fa fa-user", autofocus=True) }}
{{ render_field(form.email, icon="fa fa-user", autofocus=True, placeholder=_("email")) }}
<button type="submit" class="btn btn-primary btn-lg btn-block">{{_('Reset Password')}}</button>
</form>
{%- endif %}
</div>

{# contents of this if-block can be always shown after mattupstate/flask-security#291 is released. #}
{%- if current_user.is_anonymous %}
<div class="card-footer">
<h4 class="text-muted my-2"><a href="{{url_for('security.login')}}">{{_('Log In')}}</a>{% if security.registerable %} {{_('or')}} <a href="{{url_for('security.register')}}">{{_('Sign Up')}}</a>{% endif %}</h4>
</div>
</form>
{%- endif %}
</div>

{# contents of this if-block can be always shown after mattupstate/flask-security#291 is released. #}
{%- if current_user.is_anonymous %}
<div class="card-footer">
<h4 class="text-muted my-2"><a
href="{{url_for('security.login')}}">{{_('Log In')}}</a>{% if security.registerable %} {{_('or')}} <a
href="{{url_for('security.register')}}">{{_('Sign Up')}}</a>{% endif %}</h4>
</div>
{%- endif %}
</div>
</div>
{%- endwith %}
{% endblock panel %}

0 comments on commit ff3f1e7

Please sign in to comment.