parent
4189550093
commit
2921d383d6
|
@ -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, '</p>', n)]
|
||||
|
||||
class Event(BaseEvent):
|
||||
implements(IEvent)
|
||||
|
|
|
@ -126,6 +126,7 @@
|
|||
class string:d-${event/start/year}-${event/start/month}-${event/start/day}">
|
||||
<h3><span tal:content="event/longdatetime"/> <span tal:content="event/title"/></h3>
|
||||
<p tal:condition="event/place" class="place" tal:content="event/place"></p>
|
||||
<span tal:condition="event/text" class="preview" tal:content="structure event/preview"></span>
|
||||
<a href="#" class="event-details" tal:attributes="href event/absolute_url">Détail de l'événement</a>
|
||||
<span class="closediv"/>
|
||||
</div>
|
||||
|
|
Reference in New Issue