diff --git a/tabellio/agenda/event.py b/tabellio/agenda/event.py index 4b400c6..4820f35 100644 --- a/tabellio/agenda/event.py +++ b/tabellio/agenda/event.py @@ -101,6 +101,16 @@ class BaseEvent(Item): return 'today' return '' + def preview(self): + n = 3 + + def nth_position(string, sub, n, pos = 0): + if n: + sliced_from = string.find(sub) + len(sub) + return pos + nth_position(string[sliced_from:], + sub, n-1, sliced_from) + return pos + return self.text.output[:nth_position(self.text.output, '

', n)] class Event(BaseEvent): implements(IEvent) diff --git a/tabellio/agenda/folder_templates/view.pt b/tabellio/agenda/folder_templates/view.pt index 29fa8bf..418b40d 100644 --- a/tabellio/agenda/folder_templates/view.pt +++ b/tabellio/agenda/folder_templates/view.pt @@ -126,6 +126,7 @@ class string:d-${event/start/year}-${event/start/month}-${event/start/day}">

+ Détail de l'événement