On the view-whole-thread page we previously did a redirect back to the
anchor of the very first mail of the thread when loading the first mail
of the thread. This pollutes the URL more than necessary.
We still do the redirect for messages that are not the first, to make it
possible to link to an individual message.
{%load pgfilters%}
{%block extrahead%}
<meta name="robots" content="noindex" />
+{%if not isfirst%}
<script type="text/javascript">
function load() {
if (document.location.href.indexOf('#') < 0) {
}
window.onload = load;
</script>
+{%endif%}
{%endblock%}
{%block contents%}
{%if not msg.hiddenstatus%}
allmsg = list(Message.objects.filter(threadid=msg.threadid).order_by('date'))
# XXX: need to get the complete list of lists!
+ isfirst = (msg == allmsg[0])
+
newest = calendar.timegm(max(allmsg, key=lambda x: x.date).date.utctimetuple())
if request.META.has_key('HTTP_IF_MODIFIED_SINCE') and not settings.DEBUG:
ims = parse_http_date_safe(request.META.get('HTTP_IF_MODIFIED_SINCE'))
r = render_nav(NavContext(request), 'message_flat.html', {
'msg': msg,
'allmsg': allmsg,
+ 'isfirst': isfirst,
})
r['X-pgthread'] = ":%s:" % msg.threadid
r['Last-Modified'] = http_date(newest)