diff -r 08ffc7be6c23 -r 9bfd98868419 eskp.py --- a/eskp.py Mon May 05 14:37:39 2014 +0200 +++ b/eskp.py Mon May 05 16:36:25 2014 +0200 @@ -10,8 +10,6 @@ from flask.ext.babel import gettext as _ from flask.ext.babel import Babel from config import LANGUAGES -from sayings import get_saying - LANGUAGE_SELECTED = "de" #ToDo after engelish is implemented set LANGUAGE_SELECTED = None @@ -41,6 +39,16 @@ app.jinja_env.globals.update(get_topmenue=get_topmenue) +def get_ozone_dates(): + menue = [('/ozoneloss/2014', _(u'2014')), + ('/ozoneloss/2013', _(u'2013')), + ('/ozoneloss/2012', _(u'2012')), + ('/ozoneloss/2011', _(u'2011')), + ('/ozoneloss/2010', _(u'2010')), + ] + return menue + +app.jinja_env.globals.update(get_ozone_dates=get_ozone_dates) @babel.localeselector def get_locale(): @@ -51,13 +59,41 @@ @app.route("/") @app.route("/index") def index(): - saying, author = get_saying() return render_template("/index.html", - saying=saying, - author=author, eskp_info=_(u'About ESKP'), ) + +@app.route('/ozoneloss/2014') +def y2014(): + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + content = get_content(filename) + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2014) + +@app.route('/ozoneloss/2013') +def y2013(): + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + content = get_content(filename) + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2013) + +@app.route('/ozoneloss/2012') +def y2012(): + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + content = get_content(filename) + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2012) + +@app.route('/ozoneloss/2011') +def y2011(): + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + content = get_content(filename) + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2011) + +@app.route('/ozoneloss/2010') +def y2010(): + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + content = get_content(filename) + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2010) + @app.route('/de') def de(): global LANGUAGE_SELECTED @@ -92,7 +128,7 @@ content = get_content(filename) print content print filename - return render_template("/content.html", act="ozoneloss", content=content) + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2014) @app.route("/iek-7") def submission():