descrizione talk ordinata per orario
This commit is contained in:
parent
f1e70e8c43
commit
3dd8f12df2
1 changed files with 15 additions and 2 deletions
|
@ -180,11 +180,24 @@ class TalkListDirective(Directive):
|
|||
def run(self):
|
||||
lang = self.options.get('lang', 'C')
|
||||
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 [
|
||||
nodes.raw('', tmpl.render(lang=lang, **get_talk_data(n)),
|
||||
format='html')
|
||||
for n in get_talk_names()
|
||||
]
|
||||
for n in sorted(get_talk_names(),
|
||||
key=_sort_date)
|
||||
]
|
||||
|
||||
|
||||
class TalkDirective(Directive):
|
||||
|
|
Loading…
Reference in a new issue