diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-06-04 18:49:42 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-06-04 18:49:42 +0100 |
| commit | 8b2018852e54a005a39234d6965e6268192718dc (patch) | |
| tree | 65b140cffdb72d70247523d0313f5295db0951f7 /app/templates | |
| parent | 0aeefa2387846e482635c165916012d321da9ca6 (diff) | |
| download | cheatdb-8b2018852e54a005a39234d6965e6268192718dc.tar.xz | |
Add redirection to set password after login if not set
Diffstat (limited to 'app/templates')
| -rw-r--r-- | app/templates/flask_user/login.html | 25 | ||||
| -rw-r--r-- | app/templates/users/set_password.html | 38 |
2 files changed, 33 insertions, 30 deletions
diff --git a/app/templates/flask_user/login.html b/app/templates/flask_user/login.html index 8409f79..a758011 100644 --- a/app/templates/flask_user/login.html +++ b/app/templates/flask_user/login.html @@ -11,10 +11,6 @@ Sign in <h2>{%trans%}Sign in{%endtrans%}</h2> <form action="" method="POST" class="form box-body" role="form"> - <h3>Sign in with Github</h3> - <p><a class="button" href="{{ url_for('github_signin_page') }}">GitHub</a></p> - - <h3>Sign in with username/password</h3> {{ form.hidden_tag() }} @@ -38,17 +34,13 @@ Sign in {# Password field #} {% set field = form.password %} <div class="form-group {% if field.errors %}has-error{% endif %}"> - {# Label on left, "Forgot your Password?" on right #} <div class="row"> - <div class="col-xs-6"> - <label for="{{ field.id }}" class="control-label">{{ field.label.text }}</label> - </div> - <div class="col-xs-6 text-right"> - {% if user_manager.enable_forgot_password %} + <label for="{{ field.id }}" class="control-label">{{ field.label.text }} + {% if user_manager.enable_forgot_password %} <a href="{{ url_for('user.forgot_password') }}" tabindex='195'> - {%trans%}Forgot your Password?{%endtrans%}</a> - {% endif %} - </div> + [{%trans%}Forgot My Password{%endtrans%}]</a> + {% endif %} + </label> </div> {{ field(class_='form-control', tabindex=120) }} {% if field.errors %} @@ -64,7 +56,12 @@ Sign in {% endif %} {# Submit button #} - {{ render_submit_field(form.submit, tabindex=180) }} + <p> + {{ render_submit_field(form.submit, tabindex=180) }} + </p> + + <h3>Sign in with Github</h3> + <p><a class="button" href="{{ url_for('github_signin_page') }}">GitHub</a></p> </form> </div> diff --git a/app/templates/users/set_password.html b/app/templates/users/set_password.html index 510f9b3..6fe88e9 100644 --- a/app/templates/users/set_password.html +++ b/app/templates/users/set_password.html @@ -5,30 +5,36 @@ {% endblock %} {% block content %} + +{% if optional %} + <div class="box box_grey alert alert-primary"> + It is recommended that you set a password for your account. + + <a class="alert_right button" href="{{ url_for('home_page') }}">Skip</a> + </div> +{% endif %} + + <h1>Set Password</h1> {% from "macros/forms.html" import render_field, render_submit_field %} <form action="" method="POST" class="form" role="form"> - <div class="row"> - <div class="col-sm-6 col-md-5 col-lg-4"> - {{ form.hidden_tag() }} + {{ form.hidden_tag() }} - {% if not current_user.email %} - {{ render_field(form.email, tabindex=230) }} + {% if not current_user.email %} + {{ render_field(form.email, tabindex=230) }} - <p> - Your email is needed to recover your account if you forget your - password, and to optionally send notifications. - Your email will never be shared to a third-party. - </p> - {% endif %} + <p> + Your email is needed to recover your account if you forget your + password, and to optionally send notifications. + Your email will never be shared to a third-party. + </p> + {% endif %} - {{ render_field(form.password, tabindex=230) }} - {{ render_field(form.password2, tabindex=240) }} + {{ render_field(form.password, tabindex=230) }} + {{ render_field(form.password2, tabindex=240) }} - {{ render_submit_field(form.submit, tabindex=280) }} - </div> - </div> + {{ render_submit_field(form.submit, tabindex=280) }} </form> {% endblock %} |
