Commit 588bcdde by benjaoming

Making notifications update in a smart way. Fixing wrong urls in accounts

parent bf09bf4f
notify_latest_id = 0;
notify_update_timeout = 30000;
notify_update_timeout_adjust = 1.2; // factor to adjust between each timeout.
function notify_update() {
jsonWrapper(URL_NOTIFY_GET_NEW, function (data) {
......@@ -29,9 +31,15 @@ function notify_mark_read() {
});
}
function update_timeout() {
setTimeout("notify_update()", notify_update_timeout);
setTimeout("update_timeout()", notify_update_timeout);
notify_update_timeout *= notify_update_timeout_adjust;
}
$(document).ready(function () {
notify_update();
// Update every second minute.
setInterval("notify_update()", 120000);
// Don't check immediately... some users just click through pages very quickly.
setTimeout("notify_update()", 2000);
update_timeout();
})
......@@ -28,8 +28,8 @@ class Logout(View):
def get(self, request, *args, **kwargs):
auth_logout(request)
messages.info(request, _(u"You are no longer logged in. Bye bye!"))
print redirect("wiki:get_url", URLPath.root().path)
return redirect("wiki:get_url", URLPath.root().path)
print redirect("wiki:get", URLPath.root().path)
return redirect("wiki:get", URLPath.root().path)
class Login(FormView):
......@@ -47,5 +47,5 @@ class Login(FormView):
messages.info(self.request, _(u"You are now logged in! Have fun!"))
if self.request.GET.get("next", None):
return redirect(self.request.GET['next'])
return redirect("wiki:get_url", URLPath.root().path)
return redirect("wiki:get", URLPath.root().path)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment