diff -r 591429b20748 -r 6a8a901ba550 eskp.py --- a/eskp.py Tue May 06 16:32:30 2014 +0200 +++ b/eskp.py Wed May 07 09:52:18 2014 +0200 @@ -35,6 +35,7 @@ def get_topmenue(): menue = [ + ('/', _(u'Home')), ('/ozoneloss', _(u'Ozoneloss')), ('/eskp', _(u'ESKP')), ('/iek-7', _(u'IEK-7')), @@ -44,11 +45,11 @@ 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')), + menue = [('/ozoneloss/years/2014', _(u'2014')), + ('/ozoneloss/years/2013', _(u'2013')), + ('/ozoneloss/years/2012', _(u'2012')), + ('/ozoneloss/years/2011', _(u'2011')), + ('/ozoneloss/years/2010', _(u'2010')), ] return menue @@ -68,35 +69,35 @@ ) -@app.route('/ozoneloss/2014') +@app.route('/ozoneloss/years/2014') def y2014(): - filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") content = get_content(filename) - return render_template("/ozoneloss.html", act="ozoneloss/2014", content=content, year=2014) + return render_template("/ozoneloss_years.html", act="ozoneloss/years/2014", content=content, year=2014) -@app.route('/ozoneloss/2013') +@app.route('/ozoneloss/years/2013') def y2013(): - filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") content = get_content(filename) - return render_template("/ozoneloss.html", act="ozoneloss/2013", content=content, year=2013) + return render_template("/ozoneloss_years.html", act="ozoneloss/years/2013", content=content, year=2013) -@app.route('/ozoneloss/2012') +@app.route('/ozoneloss/years/2012') def y2012(): - filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") content = get_content(filename) - return render_template("/ozoneloss.html", act="ozoneloss/2012", content=content, year=2012) + return render_template("/ozoneloss_years.html", act="ozoneloss/years/2012", content=content, year=2012) -@app.route('/ozoneloss/2011') +@app.route('/ozoneloss/years/2011') def y2011(): - filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") content = get_content(filename) - return render_template("/ozoneloss.html", act="ozoneloss/2011", content=content, year=2011) + return render_template("/ozoneloss_years.html", act="ozoneloss/years/2011", content=content, year=2011) -@app.route('/ozoneloss/2010') +@app.route('/ozoneloss/years/2010') def y2010(): - filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") content = get_content(filename) - return render_template("/ozoneloss.html", act="ozoneloss/2010", content=content, year=2010) + return render_template("/ozoneloss_years.html", act="ozoneloss/years/2010", content=content, year=2010) @app.route('/de') def de(): @@ -130,7 +131,13 @@ def task(): 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) + return render_template("/ozoneloss.html", act="ozoneloss", content=content) + +@app.route("/ozoneloss/years") +def task1(): + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") + content = get_content(filename) + return render_template("/ozoneloss_years.html", act="ozoneloss/years", content=content) @app.route("/iek-7") def submission():