diff options
author | Andy Knotts <arknotts@gmail.com> | 2011-04-08 19:33:47 -0700 |
---|---|---|
committer | Andy Knotts <arknotts@gmail.com> | 2011-04-08 19:33:47 -0700 |
commit | 943dbd34b130bba3ab79f4413259f7de8d8badd8 (patch) | |
tree | b9992f4f74932ce7ab0dd3879145216d1baa5556 | |
parent | 8e57f310d1da605c31d30d7392c26deab73f2619 (diff) | |
download | askbot-943dbd34b130bba3ab79f4413259f7de8d8badd8.tar.gz askbot-943dbd34b130bba3ab79f4413259f7de8d8badd8.tar.bz2 askbot-943dbd34b130bba3ab79f4413259f7de8d8badd8.zip |
Converted logout meta link to directly logout user, and display an informational logout page
-rw-r--r-- | askbot/skins/default/templates/blocks/header_meta_links.html | 2 | ||||
-rw-r--r-- | askbot/skins/default/templates/logout.html | 33 | ||||
-rw-r--r-- | askbot/views/meta.py | 10 |
3 files changed, 12 insertions, 33 deletions
diff --git a/askbot/skins/default/templates/blocks/header_meta_links.html b/askbot/skins/default/templates/blocks/header_meta_links.html index e5969416..bbc87c0f 100644 --- a/askbot/skins/default/templates/blocks/header_meta_links.html +++ b/askbot/skins/default/templates/blocks/header_meta_links.html @@ -5,7 +5,7 @@ {{ macros.moderation_items_link(request.user, moderation_items) }} ({{ macros.user_long_score_and_badge_summary(user) }}) </span> - <a href="{% url logout %}">{% trans %}logout{% endtrans %}</a> + <a href="{% url user_signout %}?next={% url logout %}">{% trans %}logout{% endtrans %}</a> {% else %} <a href="{% url user_signin %}">{% trans %}login{% endtrans %}</a> {% endif %} diff --git a/askbot/skins/default/templates/logout.html b/askbot/skins/default/templates/logout.html index e1e4e419..d9ab69f0 100644 --- a/askbot/skins/default/templates/logout.html +++ b/askbot/skins/default/templates/logout.html @@ -2,9 +2,8 @@ <!-- template logout.html --> {% block title %}{% spaceless %}{% trans %}Logout{% endtrans %}{% endspaceless %}{% endblock %} {% block content %} -<h1>{% trans %}Logout{% endtrans %}</h1> -<p>{% trans %}As a registered user you can login with your OpenID, log out of the site or permanently remove your account.{% endtrans %}</p> -<input id="btLogout" type="button" class="submit" value="{% trans %}Logout now{% endtrans %}"><!-- style="width:150px">--> +<h1>{% trans %}You have successfully logged out{% endtrans %}</h1> +<p>{% trans %}However, you still may be logged in to your OpenID provider. Please logout of your provider if you wish to do so.{% endtrans %}</p> {% if settings.FACEBOOK_KEY and settings.FACEBOOK_SECRET %} <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> @@ -15,27 +14,15 @@ {% endblock %} {% block endjs %} <script type="text/javascript"> - var sign_out = function(){ - window.location.href='{% url user_signout %}?next={{ next }}'; - } $(document).ready(function(){ - $('#btLogout').bind('click', function(){ - if (typeof FB != 'undefined'){ - FB.getLoginStatus(function(response){ - if (response.session){ - FB.logout(function(response){ - sign_out(); - }); - } - else { - sign_out(); - } - }); - } - else { - sign_out(); - } - }); + //logout user from facebook + if (typeof FB != 'undefined'){ + FB.getLoginStatus(function(response){ + if (response.session){ + FB.logout(); + } + }); + } }); </script> {% endblock %} diff --git a/askbot/views/meta.py b/askbot/views/meta.py index 7cc536ed..0e67f08f 100644 --- a/askbot/views/meta.py +++ b/askbot/views/meta.py @@ -74,16 +74,8 @@ feedback.CANCEL_MESSAGE=_('We look forward to hearing your feedback! Please, giv def privacy(request): return render_into_skin('privacy.html', {'page_class': 'meta'}, request) -def logout(request):#refactor/change behavior? -#currently you click logout and you get -#to this view which actually asks you again - do you really want to log out? -#I guess rationale was to tell the user that s/he may be still logged in -#through their external login sytem and we'd want to remind them about it -#however it might be a little annoying -#why not just show a message: you are logged out of forum, but -#if you really want to log out -> go to your openid provider +def logout(request): data = { - 'next' : get_next_url(request), 'page_class': 'meta', } return render_into_skin('logout.html', data, request) |