1
0
Fork 0

descrizione talk ordinata per orario

This commit is contained in:
boyska 2017-06-09 11:42:08 +02:00
parent f1e70e8c43
commit 3dd8f12df2
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9

View file

@ -180,10 +180,23 @@ class TalkListDirective(Directive):
def run(self): def run(self):
lang = self.options.get('lang', 'C') lang = self.options.get('lang', 'C')
tmpl = jinja_env().get_template('talk.html') tmpl = jinja_env().get_template('talk.html')
def _sort_date(name):
'''
This function is a helper to sort talks by start date
When no date is available, put at the beginning
'''
d = get_talk_data(name)
if 'time' in d:
return d['time']
return datetime.datetime(1, 1, 1)
return [ return [
nodes.raw('', tmpl.render(lang=lang, **get_talk_data(n)), nodes.raw('', tmpl.render(lang=lang, **get_talk_data(n)),
format='html') format='html')
for n in get_talk_names() for n in sorted(get_talk_names(),
key=_sort_date)
] ]