aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/static/new/js_external/zxcvbn/.gitignore2
-rw-r--r--wqflask/wqflask/templates/base.html12
-rw-r--r--wqflask/wqflask/templates/new_security/_scripts.html4
-rw-r--r--wqflask/wqflask/templates/new_security/register_user.html158
-rw-r--r--wqflask/wqflask/views.py16
5 files changed, 118 insertions, 74 deletions
diff --git a/wqflask/wqflask/static/new/js_external/zxcvbn/.gitignore b/wqflask/wqflask/static/new/js_external/zxcvbn/.gitignore
deleted file mode 100644
index af1b4bc3..00000000
--- a/wqflask/wqflask/static/new/js_external/zxcvbn/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*~
-*.js
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index cbed5859..7f72ff22 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -19,6 +19,7 @@
<link rel="stylesheet" type="text/css" href="/static/packages/colorbox/example4/colorbox.css" />
<link rel="stylesheet" type="text/css" href="/static/new/css/main.css" />
+ <link rel="stylesheet" type="text/css" href="/static/new/css/parsley.css" />
{% block css %}
{% endblock %}
@@ -70,9 +71,9 @@
</li>
<li class="">
{% if g.identity.name=="anon" %}
- <a id="login_out" class="modalize" href="/login">Sign in</a>
+ <a id="login_out" class="modalize" href="/n/register">Sign in</a>
{% else %}
- <a id="login_out" href="/logout">Sign out</a>
+ <a id="login_out" href="/n/logout">Sign out</a>
{% endif %}
</li>
</ul>
@@ -180,12 +181,13 @@
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="/static/packages/colorbox/jquery.colorbox.js"></script>
- <script type="text/javascript" src="/static/new/javascript/login.js"></script>
+ <!--<script type="text/javascript" src="/static/new/javascript/login.js"></script>-->
+
+ <script type="text/javascript" src="/static/new/js_external/parsley.min.js"></script>
+
{% block js %}
{% endblock %}
-
-
</body>
</html>
diff --git a/wqflask/wqflask/templates/new_security/_scripts.html b/wqflask/wqflask/templates/new_security/_scripts.html
index 5a453dca..5fefe305 100644
--- a/wqflask/wqflask/templates/new_security/_scripts.html
+++ b/wqflask/wqflask/templates/new_security/_scripts.html
@@ -1,3 +1 @@
-<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
-<script language="javascript" type="text/javascript" src="/static/packages/colorbox/jquery.colorbox.js"></script>-->
-<script type="text/javascript" src="/static/new/javascript/login.js"></script>
+<!--<script type="text/javascript" src="/static/new/javascript/login.js"></script>-->
diff --git a/wqflask/wqflask/templates/new_security/register_user.html b/wqflask/wqflask/templates/new_security/register_user.html
index d66365f4..d203d65f 100644
--- a/wqflask/wqflask/templates/new_security/register_user.html
+++ b/wqflask/wqflask/templates/new_security/register_user.html
@@ -1,66 +1,104 @@
-<div class="security_box">
- <h4>* Already have an account?</h4>
+{% extends "base.html" %}
+{% block title %}Register{% endblock %}
+{% block content %}
+ <header class="jumbotron subhead" id="overview">
+ <div class="container">
+ <h1>Register</h1>
+ <p class="lead">
+ It's easy and fast to make an account.
+ </p>
+ </div>
+ </header>
- <center>
- <a href="/n/login"
- class="btn btn-info modalize">Sign in using existing account</a>
- </center>
-
- <hr />
-
- <h4>Don't have an account?</h4>
-
- <h5>Register here</h5>
-
- <form class="form-horizontal" action="/n/register_submit"
- method="POST" name="login_user_form">
- <fieldset>
-
-
- <div class="control-group">
- <label class="control-label" for="email">Email Address</label>
- <div class="controls">
- <input id="email" name="email" class="focused" type="text" value="">
- </div>
- </div>
+ <div class="container">
+ <div class="page-header">
+ <h1>Registration</h1>
+ </div>
+
+ <div class="security_box">
+ <h4>Already have an account?</h4>
+
- <div class="control-group">
- <label class="control-label" for="email">Name</label>
- <div class="controls">
- <input id="name" name="name" type="text" value="">
- </div>
- </div>
-
- <div class="control-group">
- <label class="control-label" for="email">Organization</label>
- <div class="controls">
- <input id="organization" name="organization" type="text" value="">
- </div>
- </div>
+ <a href="/n/login"
+ class="btn btn-info modalize">Sign in using existing account</a>
- <div class="control-group">
- <label class="control-label" for="password">Password</label>
- <div class="controls">
- <input id="password" name="password" type="password" value="">
- </div>
- </div>
-
- <div class="control-group">
- <label class="control-label" for="password_confirm">Confirm Password</label>
- <div class="controls">
- <input id="password" name="password_confirm" type="password" value="">
- </div>
- </div>
+
+ <hr />
+
+ <h4>Don't have an account?</h4>
+
+ <h5>Register here</h5>
+
+ <form class="form-horizontal" action="/n/register_submit" data-validate="parsley"
+ method="POST" name="login_user_form">
+ <fieldset>
+
+ <div class="control-group">
+ <label class="control-label" for="email">Email Address</label>
+ <div class="controls">
+ <input id="email" name="email" class="focused" type="text" value=""
+ data-trigger="change" data-required="true" data-type="email" data-maxlength="50">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="email">Full Name</label>
+ <div class="controls">
+ <input id="name" name="name" type="text" value=""
+ data-trigger="change" data-required="true" data-minlength="5" data-maxlength="50">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="email">Organization</label>
+ <div class="controls">
+ <input id="organization" name="organization" type="text" value="" data-minlength="3" data-maxlength="50">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <label class="control-label" for="password">Password</label>
+ <div class="controls">
+ <input id="password" name="password" type="password" value=""
+ data-trigger="change" data-required="true" data-minlength="6" data-maxlength="30">
+ </div>
+ </div>
+
+
+ <div class="control-group" style="display: none" id="password_alert">
+ <div class="controls"">
+ <span id="password_strength" class="alert"></span>
+ </div>
+ </div>
+
+
+ <div class="control-group">
+ <label class="control-label" for="password_confirm">Confirm Password</label>
+ <div class="controls">
+ <input id="password" name="password_confirm" type="password" value=""
+ data-trigger="change" data-required="true" data-equalto="#password">
+ </div>
+ </div>
+
+ <div class="control-group">
+ <div class="controls"">
+ <input class="btn btn-primary" id="submit" name="submit" type="submit" value="Create account">
+ </div>
+ </div>
+
+ </fieldset>
+
+ </form>
+ </div>
+ </div>
- <div class="control-group">
- <div class="controls"">
- <input class="btn btn-primary" id="submit" name="submit" type="submit" value="Create account">
- </div>
- </div>
+{% endblock %}
- </fieldset>
+{% block js %}
+ <!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>-->
+
+ {% include "new_security/_scripts.html" %}
+ <script type="text/javascript" src="/static/new/js_external/zxcvbn/zxcvbn-async.js"></script>
+ <script type="text/javascript" src="/static/new/javascript/password_strength.js"></script>
+{% endblock %}
- </form>
-</div>
-{% include "security/_scripts.html" %}
-<!--{% include "security/_menu.html" %}-->
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 2b16dd77..6f14ac8d 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -51,10 +51,10 @@ from wqflask import user_manager
def connect_db():
g.db = sqlalchemy.create_engine(app.config['DB_URI'])
-@app.before_request
-def trace_it():
- from wqflask import tracer
- tracer.turn_on()
+#@app.before_request
+#def trace_it():
+# from wqflask import tracer
+# tracer.turn_on()
@app.route("/")
def index_page():
@@ -292,6 +292,14 @@ def manage_groups():
return render_template("admin/group_manager.html", **template_vars.__dict__)
+@app.route("/n/register")
+def new_register():
+ return render_template("new_security/register_user.html")
+
+@app.route("/n/login")
+def new_login():
+ return render_template("new_security/login_user.html")
+
def json_default_handler(obj):
'''Based on http://stackoverflow.com/a/2680060/1175849'''
# Handle datestamps