From 5b05c3322c1ea25a30bec0048847e5265a036d15 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 21 Jun 2013 21:00:34 +0000 Subject: Working on getting logins working again --- wqflask/wqflask/static/new/javascript/login.coffee | 2 +- wqflask/wqflask/static/new/javascript/login.js | 2 +- wqflask/wqflask/templates/base.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'wqflask') diff --git a/wqflask/wqflask/static/new/javascript/login.coffee b/wqflask/wqflask/static/new/javascript/login.coffee index c49353d5..95e2b5c7 100644 --- a/wqflask/wqflask/static/new/javascript/login.coffee +++ b/wqflask/wqflask/static/new/javascript/login.coffee @@ -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..d51a0ac8 100644 --- a/wqflask/wqflask/static/new/javascript/login.js +++ b/wqflask/wqflask/static/new/javascript/login.js @@ -38,7 +38,7 @@ success: form_success }); }; - return $("form").on("submit", submit_form); + return $("#colorbox form").on("submit", submit_form); }); }).call(this); diff --git a/wqflask/wqflask/templates/base.html b/wqflask/wqflask/templates/base.html index 741c5425..bdb1c362 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -180,7 +180,7 @@ - + {% block js %} {% endblock %} -- cgit v1.2.3 From a9960c6e0b99e3641d309d22af9f1be77d738c3f Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 21 Jun 2013 21:33:01 +0000 Subject: Added a thank you for siging in message Fixed issues where homepage was reloaded in modal after siging in --- wqflask/cfg/default_settings.py | 2 ++ wqflask/wqflask/static/new/javascript/login.coffee | 4 ++-- wqflask/wqflask/static/new/javascript/login.js | 3 ++- wqflask/wqflask/templates/security/thank_you.html | 6 ++++++ wqflask/wqflask/views.py | 10 ++++++++-- 5 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 wqflask/wqflask/templates/security/thank_you.html (limited to 'wqflask') 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 95e2b5c7..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( diff --git a/wqflask/wqflask/static/new/javascript/login.js b/wqflask/wqflask/static/new/javascript/login.js index d51a0ac8..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, diff --git a/wqflask/wqflask/templates/security/thank_you.html b/wqflask/wqflask/templates/security/thank_you.html new file mode 100644 index 00000000..f2e2db68 --- /dev/null +++ b/wqflask/wqflask/templates/security/thank_you.html @@ -0,0 +1,6 @@ +{% from "security/_macros.html" import render_only_errors %} +{% include "security/_messages.html" %} + +
+

Thank you for signing in!

+
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index b9aa3acf..90be7a71 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -87,7 +87,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"): @@ -97,7 +97,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) @@ -249,11 +249,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() -- cgit v1.2.3 From c751c6e4e50fdb35ea1108975e21735a665b48df Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 26 Jun 2013 21:50:01 +0000 Subject: More signin changes --- wqflask/wqflask/static/new/javascript/thank_you.coffee | 4 ++++ wqflask/wqflask/static/new/javascript/thank_you.js | 10 ++++++++++ wqflask/wqflask/templates/base.html | 4 ++-- wqflask/wqflask/templates/security/thank_you.html | 2 ++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 wqflask/wqflask/static/new/javascript/thank_you.coffee create mode 100644 wqflask/wqflask/static/new/javascript/thank_you.js (limited to 'wqflask') 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 bdb1c362..cbed5859 100644 --- a/wqflask/wqflask/templates/base.html +++ b/wqflask/wqflask/templates/base.html @@ -70,9 +70,9 @@
  • {% if g.identity.name=="anon" %} - Sign in + Sign in {% else %} - Sign out + Sign out {% endif %}
  • diff --git a/wqflask/wqflask/templates/security/thank_you.html b/wqflask/wqflask/templates/security/thank_you.html index f2e2db68..dd6c7297 100644 --- a/wqflask/wqflask/templates/security/thank_you.html +++ b/wqflask/wqflask/templates/security/thank_you.html @@ -4,3 +4,5 @@

    Thank you for signing in!

    + + -- cgit v1.2.3