aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorZachary Sloan2013-06-26 21:50:56 +0000
committerZachary Sloan2013-06-26 21:50:56 +0000
commite712f665d8d1000d87a7c1aafce776062ff75cf1 (patch)
tree35b951e5f1024c7853fc4f031ca268bf35a6a1a7 /wqflask
parent9718fc35ac90640f9ff1324af077c99fe43c4900 (diff)
parentc751c6e4e50fdb35ea1108975e21735a665b48df (diff)
downloadgenenetwork2-e712f665d8d1000d87a7c1aafce776062ff75cf1.tar.gz
Merge /home/sam/gene
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/cfg/default_settings.py2
-rw-r--r--wqflask/wqflask/static/new/javascript/login.coffee6
-rw-r--r--wqflask/wqflask/static/new/javascript/login.js5
-rw-r--r--wqflask/wqflask/static/new/javascript/thank_you.coffee4
-rw-r--r--wqflask/wqflask/static/new/javascript/thank_you.js10
-rw-r--r--wqflask/wqflask/templates/base.html6
-rw-r--r--wqflask/wqflask/templates/security/thank_you.html8
-rw-r--r--wqflask/wqflask/views.py10
8 files changed, 41 insertions, 10 deletions
diff --git a/wqflask/cfg/default_settings.py b/wqflask/cfg/default_settings.py
index 96f7f1a5..e638a9c0 100644
--- a/wqflask/cfg/default_settings.py
+++ b/wqflask/cfg/default_settings.py
@@ -13,3 +13,5 @@ SECURITY_REGISTERABLE = True
SECURITY_RECOVERABLE = True
SECURITY_EMAIL_SENDER = "no-reply@genenetwork.org"
+
+SECURITY_POST_LOGIN_VIEW = "/thank_you"
diff --git a/wqflask/wqflask/static/new/javascript/login.coffee b/wqflask/wqflask/static/new/javascript/login.coffee
index c49353d5..15dafd9a 100644
--- a/wqflask/wqflask/static/new/javascript/login.coffee
+++ b/wqflask/wqflask/static/new/javascript/login.coffee
@@ -13,8 +13,8 @@ $ ->
-
- $(document).on("click", ".modalize", modalize)
+ $(document).one("click", ".modalize", modalize)
+ console.log("Modalized click!!!")
form_success = (data) ->
$.colorbox(
@@ -39,4 +39,4 @@ $ ->
)
- $("form").on("submit", submit_form)
+ $("#colorbox form").on("submit", submit_form)
diff --git a/wqflask/wqflask/static/new/javascript/login.js b/wqflask/wqflask/static/new/javascript/login.js
index 6c6120ec..ce301353 100644
--- a/wqflask/wqflask/static/new/javascript/login.js
+++ b/wqflask/wqflask/static/new/javascript/login.js
@@ -14,7 +14,8 @@
}
});
};
- $(document).on("click", ".modalize", modalize);
+ $(document).one("click", ".modalize", modalize);
+ console.log("Modalized click!!!");
form_success = function(data) {
return $.colorbox({
open: true,
@@ -38,7 +39,7 @@
success: form_success
});
};
- return $("form").on("submit", submit_form);
+ return $("#colorbox form").on("submit", submit_form);
});
}).call(this);
diff --git a/wqflask/wqflask/static/new/javascript/thank_you.coffee b/wqflask/wqflask/static/new/javascript/thank_you.coffee
new file mode 100644
index 00000000..975f85c6
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/thank_you.coffee
@@ -0,0 +1,4 @@
+$ ->
+ console.log("Starting transform")
+ $('#login_out').text('Sign out').attr('href', '/logout').removeClass('modalize')
+ console.log("Transformed to sign out I hope")
diff --git a/wqflask/wqflask/static/new/javascript/thank_you.js b/wqflask/wqflask/static/new/javascript/thank_you.js
new file mode 100644
index 00000000..2871dd2d
--- /dev/null
+++ b/wqflask/wqflask/static/new/javascript/thank_you.js
@@ -0,0 +1,10 @@
+// Generated by CoffeeScript 1.4.0
+(function() {
+
+ $(function() {
+ console.log("Starting transform");
+ $('#login_out').text('Sign out').attr('href', '/logout').removeClass('modalize');
+ return console.log("Transformed to sign out I hope");
+ });
+
+}).call(this);
diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html
index 741c5425..cbed5859 100644
--- a/wqflask/wqflask/templates/base.html
+++ b/wqflask/wqflask/templates/base.html
@@ -70,9 +70,9 @@
</li>
<li class="">
{% if g.identity.name=="anon" %}
- <a id="login" class="modalize" href="/login">Sign in</a>
+ <a id="login_out" class="modalize" href="/login">Sign in</a>
{% else %}
- <a href="/logout">Sign out</a>
+ <a id="login_out" href="/logout">Sign out</a>
{% endif %}
</li>
</ul>
@@ -180,7 +180,7 @@
<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>
{% block js %}
{% endblock %}
diff --git a/wqflask/wqflask/templates/security/thank_you.html b/wqflask/wqflask/templates/security/thank_you.html
new file mode 100644
index 00000000..dd6c7297
--- /dev/null
+++ b/wqflask/wqflask/templates/security/thank_you.html
@@ -0,0 +1,8 @@
+{% from "security/_macros.html" import render_only_errors %}
+{% include "security/_messages.html" %}
+
+<div class="security_box">
+ <h4>Thank you for signing in!</h4>
+</div>
+
+<script src="/static/new/javascript/thank_you.js"></script>
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 603ff49b..bd56f7a9 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -100,7 +100,7 @@ def search_page():
print("key is:", pf(key))
with Bench("Loading cache"):
result = Redis.get(key)
-
+
if result:
print("Cache hit!!!")
with Bench("Loading results"):
@@ -110,7 +110,7 @@ def search_page():
print("request.args is", request.args)
the_search = search_results.SearchResultPage(request.args)
result = the_search.__dict__
-
+
print("result: ", pf(result))
Redis.set(key, pickle.dumps(result))
Redis.expire(key, 60*60)
@@ -262,11 +262,17 @@ def sharing_info_page():
return template_vars
+# Take this out or secure it before going into production
@app.route("/get_temp_data")
def get_temp_data():
temp_uuid = request.args['key']
return flask.jsonify(temp_data.TempData(temp_uuid).get_all())
+
+@app.route("/thank_you")
+def thank_you():
+ return render_template("security/thank_you.html")
+
@app.route("/manage/users")
def manage_users():
template_vars = user_manager.UsersManager()