forked from boyska/sito-hackit-17
descrizione talk ordinata per orario
This commit is contained in:
parent
f1e70e8c43
commit
3dd8f12df2
1 changed files with 15 additions and 2 deletions
|
@ -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)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue