anchor list link to current day

This commit is contained in:
Frédéric Péters 2011-12-12 12:04:29 +01:00
parent 1d19470dcc
commit 1943e00571
2 changed files with 4 additions and 1 deletions

View File

@ -143,6 +143,9 @@ class View(grok.View, utils.MonthlyView):
events.sort(lambda x,y: cmp(x.start, y.start))
return events
def todayanchor(self):
return 'd%d-%d-%d' % datetime.datetime.today().timetuple()[:3]
class List(View):
grok.context(IAgendaFolder)
grok.require('zope2.View')

View File

@ -26,7 +26,7 @@
<h2 tal:condition="view/has_view_switcher" tal:content="context/title" />
<div tal:condition="view/has_view_switcher" id="agenda-view-switcher">
<span>Calendrier</span> | <a tal:attributes="href string:list?navyear=${view/year}&navmonth=${view/month}">Liste</a>
<span>Calendrier</span> | <a tal:attributes="href string:list?navyear=${view/year}&navmonth=${view/month}#${view/todayanchor}">Liste</a>
</div>
<table class="ploneCalendar"