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