-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes OSQA 317, Wrong links in the user profile in the new notificati…
…on email, and OSQA 312, Blank page when the user clicks in an email in the notication settings link without being logged in the site. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@428 0cfe37f9-358a-4d5e-be75-b63607b5c754
- Loading branch information
hernani
committed
Jun 16, 2010
1 parent
a315fa9
commit 25d2724
Showing
10 changed files
with
93 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
from django.http import HttpResponse | ||
from django.template.loader import render_to_string | ||
from django.template import RequestContext | ||
|
||
from forum import settings | ||
|
||
class HttpResponseServiceUnavailable(HttpResponse): | ||
def __init__(self, message): | ||
super(HttpResponseServiceUnavailable, self).__init__(content=render_to_string('503.html', { | ||
'message': message, | ||
'app_logo': settings.APP_LOGO, | ||
'app_title': settings.APP_TITLE | ||
}), status=503) | ||
super(HttpResponseServiceUnavailable, self).__init__( | ||
content=render_to_string('503.html', { | ||
'message': message, | ||
'app_logo': settings.APP_LOGO, | ||
'app_title': settings.APP_TITLE | ||
}), status=503) | ||
|
||
class HttpResponseUnauthorized(HttpResponse): | ||
pass | ||
def __init__(self, request): | ||
if request.user.is_authenticated(): | ||
super(HttpResponseUnauthorized, self).__init__( | ||
content=render_to_string('403.html', context_instance=RequestContext(request)), | ||
status=403 | ||
) | ||
else: | ||
super(HttpResponseUnauthorized, self).__init__( | ||
content=render_to_string('401.html', context_instance=RequestContext(request)), | ||
status=401 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{% extends "base_content.html" %} | ||
{% load i18n %} | ||
{% block title %}{% trans "Not logged in" %}{% endblock %} | ||
{% block meta %} | ||
<!-- <meta http-equiv="refresh" content="5;url={% url auth_signin %}"> --> | ||
{% endblock %} | ||
{% block forestyle%} | ||
<style type="text/css"> | ||
form input { margin-right: 5px; } | ||
</style> | ||
{% endblock %} | ||
{% block forejs %} | ||
<script type="text/javascript"> | ||
$().ready(function(){ | ||
window.setInterval(function() { | ||
$('#redirect_loader').html($('#redirect_loader').html() + '.') | ||
}, 800); | ||
|
||
window.setTimeout(function() { | ||
window.location = "{% url auth_signin %}"; | ||
}, 5000); | ||
}); | ||
|
||
</script> | ||
{% endblock %} | ||
{% block content %} | ||
<div id="main-bar" class="headNormal"> | ||
{% trans "Not logged in" %} | ||
</div> | ||
<div id="main-body" class=""> | ||
<div style="padding:5px 0px 10px 0;line-height:25px;"> | ||
<h3>{% trans "You are not logged in..." %}</h3> | ||
<div style="margin-top:5px"> | ||
{% trans "...and the resource you're trying to access is pretocted." %} | ||
<p> | ||
{% trans "Redirecting to the login page." %}<span id="redirect_loader"></span> | ||
</p> | ||
<p> | ||
{% trans "If you're not automatically redirected in 5 seconds, please click" %} | ||
<a href="{% url auth_signin %}">{% trans "here" %}</a>. | ||
</p> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters