Use templating
This commit is contained in:
parent
a8bf19350e
commit
2463d2e11f
4
main.py
4
main.py
|
@ -1,7 +1,7 @@
|
||||||
import argparse
|
import argparse
|
||||||
import bottle
|
import bottle
|
||||||
|
|
||||||
import templates
|
TEMPLATE_INDEX = bottle.SimpleTemplate(name = "templates/index.html")
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ def render_calendar(events_map, today):
|
||||||
'already_past': day_of_month < today,
|
'already_past': day_of_month < today,
|
||||||
'events': events_map.get(day_of_month, []),
|
'events': events_map.get(day_of_month, []),
|
||||||
})
|
})
|
||||||
return bottle.template(templates.TEMPLATE_INDEX, days = days)
|
return TEMPLATE_INDEX.render(days = days)
|
||||||
|
|
||||||
## Paths
|
## Paths
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
TEMPLATE_INDEX = '''
|
|
||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -51,6 +50,3 @@ TEMPLATE_INDEX = '''
|
||||||
</table>
|
</table>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user