1.1 --- a/pymove3d.py Sun Jan 19 10:52:51 2014 +0100
1.2 +++ b/pymove3d.py Sun Jan 19 11:40:20 2014 +0100
1.3 @@ -14,6 +14,10 @@
1.4 from sayings import get_saying
1.5 from jinja2 import Environment, FileSystemLoader
1.6
1.7 +import codecs
1.8 +from docutils.core import publish_parts
1.9 +
1.10 +
1.11 LANGUAGE_SELECTED = "de"
1.12 #ToDo after engelish is implemented set LANGUAGE_SELECTED = None
1.13
1.14 @@ -103,8 +107,15 @@
1.15
1.16 @app.route("/dates")
1.17 def dates():
1.18 - return render_template(get_locale() + "/dates.html",
1.19 - act="dates")
1.20 + content = u""
1.21 + filename = os.path.join("templates", get_locale(), "rst", "dates.rst")
1.22 + if os.path.isfile(filename):
1.23 + with codecs.open(filename, 'r', 'utf-8') as f:
1.24 + rst_data = f.read()
1.25 + f.close()
1.26 + content = publish_parts(rst_data, writer_name='html')['html_body']
1.27 + return render_template("/dates.html",
1.28 + act="dates", content=content)
1.29
1.30
1.31 @app.errorhandler(404)