add a "today" class to events in list view

This commit is contained in:
Frédéric Péters 2011-12-09 16:41:01 +01:00
parent 737a2e7c0e
commit 0fe18d887e
2 changed files with 6 additions and 1 deletions

View File

@ -102,6 +102,11 @@ class Event(BaseEvent):
def klass(self):
return 'generic-event'
def todayclass(self):
if self.start.timetuple()[:3] == datetime.datetime.today().timetuple()[:3]:
return 'today'
return ''
class EventBaseView:
def next_event_url(self, portal_type=None):
# do not go more than 100 days in the future

View File

@ -205,7 +205,7 @@ jq('#tabellio-agenda tbody a').click(
<ul id="events-ul-list" tal:condition="view/as_list">
<li tal:repeat="event view/getMonthEventsWithRepetition"
tal:attributes="id string:event-${event/id};
class event/klass">
class string:${event/klass} ${event/todayclass}">
<div tal:attributes="id string:d${event/start/year}-${event/start/month}-${event/start/day}">
<p class="date"><span tal:content="event/longdatetime"/>
<br/><span tal:condition="event/place" class="place" tal:content="event/place"></span>