Permalink
Browse files

Add prev and next links to header for day view

  • Loading branch information...
1 parent c60edfd commit 5bab03f2a518db4bac58adee26f3978c190d5367 @meldra committed Aug 2, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 brain/views.py
View
@@ -169,13 +169,19 @@ def singleday(year, month, day):
dayname = d.weekday()
mboxlist = mbox(d, dayname)
+ yesterday = d - timedelta(1)
+ yesterday = yesterday.strftime("%Y/%m/%d")
+ tomorrow = d + timedelta(1)
+ tomorrow = tomorrow.strftime("%Y/%m/%d")
+ d = d.strftime("%A, %B %d, %Y")
+
if mboxlist == False:
- return '<table><tr><th><h1>This date does not appear to be in the mail archive. It either pre-dates it, or has not happened yet</th></tr></h1>'
+ return '<table><tr><th><h1>This date does not appear to be in the mail archive. It either pre-dates it, or has not happened yet</th></tr></h1> '
v = []
a = v.append
a('<table class="singleday">')
- a('<tr><th colspan="2">%s</th></tr>' % d)
+ a('<tr><th colspan="2"><a class="nounder" href="/%s"><</a>&nbsp;%s&nbsp;<a class="nounder" href="/%s">></a></th></tr>' % (yesterday, d, tomorrow))
for mboxmail in mboxlist:
avatar_url = libravatar_url(mboxmail['From'])

0 comments on commit 5bab03f

Please sign in to comment.