1.1 --- a/eskp.py Mon May 05 14:37:39 2014 +0200
1.2 +++ b/eskp.py Mon May 05 16:36:25 2014 +0200
1.3 @@ -10,8 +10,6 @@
1.4 from flask.ext.babel import gettext as _
1.5 from flask.ext.babel import Babel
1.6 from config import LANGUAGES
1.7 -from sayings import get_saying
1.8 -
1.9
1.10 LANGUAGE_SELECTED = "de"
1.11 #ToDo after engelish is implemented set LANGUAGE_SELECTED = None
1.12 @@ -41,6 +39,16 @@
1.13
1.14 app.jinja_env.globals.update(get_topmenue=get_topmenue)
1.15
1.16 +def get_ozone_dates():
1.17 + menue = [('/ozoneloss/2014', _(u'2014')),
1.18 + ('/ozoneloss/2013', _(u'2013')),
1.19 + ('/ozoneloss/2012', _(u'2012')),
1.20 + ('/ozoneloss/2011', _(u'2011')),
1.21 + ('/ozoneloss/2010', _(u'2010')),
1.22 + ]
1.23 + return menue
1.24 +
1.25 +app.jinja_env.globals.update(get_ozone_dates=get_ozone_dates)
1.26
1.27 @babel.localeselector
1.28 def get_locale():
1.29 @@ -51,13 +59,41 @@
1.30 @app.route("/")
1.31 @app.route("/index")
1.32 def index():
1.33 - saying, author = get_saying()
1.34 return render_template("/index.html",
1.35 - saying=saying,
1.36 - author=author,
1.37 eskp_info=_(u'About ESKP'),
1.38 )
1.39
1.40 +
1.41 +@app.route('/ozoneloss/2014')
1.42 +def y2014():
1.43 + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst")
1.44 + content = get_content(filename)
1.45 + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2014)
1.46 +
1.47 +@app.route('/ozoneloss/2013')
1.48 +def y2013():
1.49 + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst")
1.50 + content = get_content(filename)
1.51 + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2013)
1.52 +
1.53 +@app.route('/ozoneloss/2012')
1.54 +def y2012():
1.55 + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst")
1.56 + content = get_content(filename)
1.57 + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2012)
1.58 +
1.59 +@app.route('/ozoneloss/2011')
1.60 +def y2011():
1.61 + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst")
1.62 + content = get_content(filename)
1.63 + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2011)
1.64 +
1.65 +@app.route('/ozoneloss/2010')
1.66 +def y2010():
1.67 + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst")
1.68 + content = get_content(filename)
1.69 + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2010)
1.70 +
1.71 @app.route('/de')
1.72 def de():
1.73 global LANGUAGE_SELECTED
1.74 @@ -92,7 +128,7 @@
1.75 content = get_content(filename)
1.76 print content
1.77 print filename
1.78 - return render_template("/content.html", act="ozoneloss", content=content)
1.79 + return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2014)
1.80
1.81 @app.route("/iek-7")
1.82 def submission():
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/templates/ozoneloss.html Mon May 05 16:36:25 2014 +0200
2.3 @@ -0,0 +1,22 @@
2.4 +{% extends "theme.html" %}
2.5 +{% block body %}
2.6 +<div class="container">
2.7 + <div class="col-lg-12">
2.8 + <div class="row">
2.9 + {{ content|safe }}
2.10 + </div>
2.11 +</div>
2.12 +
2.13 +
2.14 +
2.15 +<ul class="nav navbar-nav navbar-right">
2.16 +{% for href, caption in get_ozone_dates(): %}
2.17 + {%- if href[1:] == act -%}
2.18 + <li class="active">{% else %} <li>{% endif %}<a href="{{ href }}" >{{ caption }}</a></li>
2.19 +
2.20 +{% endfor %}
2.21 +</ul>
2.22 +
2.23 + <img src="/static/images/ozoneloss/eskp_{{ year }}.svg" alt="{{ year }}">
2.24 + </div>
2.25 +{% endblock %}