Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add prev and next links to header for day view

  • Loading branch information...
commit 5bab03f2a518db4bac58adee26f3978c190d5367 1 parent c60edfd
Melissa Draper authored

Showing 1 changed file with 8 additions and 2 deletions. Show diff stats Hide diff stats

  1. +8 2 brain/views.py
10 brain/views.py
@@ -169,13 +169,19 @@ def singleday(year, month, day):
169 169 dayname = d.weekday()
170 170 mboxlist = mbox(d, dayname)
171 171
  172 + yesterday = d - timedelta(1)
  173 + yesterday = yesterday.strftime("%Y/%m/%d")
  174 + tomorrow = d + timedelta(1)
  175 + tomorrow = tomorrow.strftime("%Y/%m/%d")
  176 + d = d.strftime("%A, %B %d, %Y")
  177 +
172 178 if mboxlist == False:
173   - 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>'
  179 + 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> '
174 180
175 181 v = []
176 182 a = v.append
177 183 a('<table class="singleday">')
178   - a('<tr><th colspan="2">%s</th></tr>' % d)
  184 + 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))
179 185
180 186 for mboxmail in mboxlist:
181 187 avatar_url = libravatar_url(mboxmail['From'])

0 comments on commit 5bab03f

Please sign in to comment.
Something went wrong with that request. Please try again.