diff options
author | Sam | 2013-05-17 20:59:50 +0000 |
---|---|---|
committer | Sam | 2013-05-17 20:59:50 +0000 |
commit | 48ba921c234abb218b14d7f1ae4d5b017ab8d388 (patch) | |
tree | c8614aff3e6013a61eec42b4a52a3db1f9c9272f /wqflask/wqflask | |
parent | 457712ce46beed04126535024daae603dd6136fc (diff) | |
download | genenetwork2-48ba921c234abb218b14d7f1ae4d5b017ab8d388.tar.gz |
Added flask_security locally
Diffstat (limited to 'wqflask/wqflask')
-rw-r--r-- | wqflask/wqflask/templates/security/_macros.html | 48 | ||||
-rw-r--r-- | wqflask/wqflask/templates/security/login_user.html | 7 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 3 |
3 files changed, 37 insertions, 21 deletions
diff --git a/wqflask/wqflask/templates/security/_macros.html b/wqflask/wqflask/templates/security/_macros.html index 83f12bf7..bd6f9786 100644 --- a/wqflask/wqflask/templates/security/_macros.html +++ b/wqflask/wqflask/templates/security/_macros.html @@ -1,29 +1,39 @@ {% macro render_field_with_errors(field) %} - <p> - {{ field.label }} {{ field(**kwargs)|safe }} - {% if field.errors %} - <ul> - {% for error in field.errors %} - <li>{{ error }}</li> - {% endfor %} - </ul> - {% endif %} - </p> + <p> + {{ field.label }} {{ field(**kwargs)|safe }} + {% if field.errors %} + <ul> + {% for error in field.errors %} + <li>{{ error }}</li> + {% endfor %} + </ul> + {% endif %} + </p> {% endmacro %} {% macro render_only_errors(field) %} - <p> + <p> <!--{{ field.label }} {{ field(**kwargs)|safe }}--> {% if field.errors %} - <ul> - {% for error in field.errors %} - <li>{{ error }}</li> - {% endfor %} - </ul> - {% endif %} - </p> + <div> + {% for error in field.errors %} + {% if error=="Email requires confirmation." %} + <div class="alert"> + <p>You must confirm your email address before signing in.</p> + <p>Check your email for confirmation instructions.</p> + <p>Can't find the email? Check your spam folder.</p> + <p>Still can't find it? <a href="/confirm"> + Click here to resend.</a></p> + </div> + {% else %} + <div class="alert">{{ error }}</div> + {% endif %} + {% endfor %} + </div> + {% endif %} + </p> {% endmacro %} {% macro render_field(field) %} - <p>{{ field(**kwargs)|safe }}</p> + <p>{{ field(**kwargs)|safe }}</p> {% endmacro %} diff --git a/wqflask/wqflask/templates/security/login_user.html b/wqflask/wqflask/templates/security/login_user.html index d6f6fb63..f982dc08 100644 --- a/wqflask/wqflask/templates/security/login_user.html +++ b/wqflask/wqflask/templates/security/login_user.html @@ -2,6 +2,8 @@ {% include "security/_messages.html" %} <div style="padding: 20px;"> + {{ g.identity}} + <h4>Don't have an account?</h4> <center> @@ -21,19 +23,20 @@ <div class="control-group"> + {{ render_only_errors(login_user_form.email) }} <label class="control-label" for="email">Email Address</label> <div class="controls"> <input id="email" class="focused" name="email" type="text" value=""> </div> - {{ render_only_errors(login_user_form.email) }} </div> <div class="control-group"> + {{ render_only_errors(login_user_form.password) }} <label class="control-label" for="password">Password</label> <div class="controls"> <input id="password" name="password" type="password" value=""> + <br /> - {{ render_only_errors(login_user_form.password) }} {% if security.recoverable %} <a href="{{ url_for_security('forgot_password') }}">Forgot your password?</a><br/> diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index dadce4d5..63781c73 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -1,5 +1,8 @@ from __future__ import absolute_import, division, print_function +import sys +print("sys.path is:", sys.path) + import csv import StringIO # Todo: Use cStringIO? |