eskp.py
changeset 249 3b60bc570d8a
parent 247 6a8a901ba550
child 250 a4adf5a448f3
equal deleted inserted replaced
248:32918c5a2ea3 249:3b60bc570d8a
    43     return menue
    43     return menue
    44 
    44 
    45 app.jinja_env.globals.update(get_topmenue=get_topmenue)
    45 app.jinja_env.globals.update(get_topmenue=get_topmenue)
    46 
    46 
    47 def get_ozone_dates():
    47 def get_ozone_dates():
    48     menue = [('/ozoneloss/years/2014', _(u'2014')),
    48     menue = [('/ozoneloss/clams/2014', _(u'2014')),
    49              ('/ozoneloss/years/2013', _(u'2013')),
    49              ('/ozoneloss/clams/2013', _(u'2013')),
    50              ('/ozoneloss/years/2012', _(u'2012')),
    50              ('/ozoneloss/clams/2012', _(u'2012')),
    51              ('/ozoneloss/years/2011', _(u'2011')),
    51              ('/ozoneloss/clams/2011', _(u'2011')),
    52              ('/ozoneloss/years/2010', _(u'2010')),
    52              ('/ozoneloss/clams/2010', _(u'2010')),
    53              ]
    53              ]
    54     return menue
    54     return menue
    55 
    55 
       
    56 def get_vpsc_dates():
       
    57     menue = [('/ozoneloss/vpsc/2014', _(u'2014')),
       
    58              ('/ozoneloss/vpsc/2013', _(u'2013')),
       
    59              ('/ozoneloss/vpsc/2012', _(u'2012')),
       
    60              ('/ozoneloss/vpsc/2011', _(u'2011')),
       
    61              ('/ozoneloss/vpsc/2010', _(u'2010')),
       
    62              ]
       
    63     return menue
       
    64 
    56 app.jinja_env.globals.update(get_ozone_dates=get_ozone_dates)
    65 app.jinja_env.globals.update(get_ozone_dates=get_ozone_dates)
       
    66 app.jinja_env.globals.update(get_vpsc_dates=get_vpsc_dates)
    57 
    67 
    58 @babel.localeselector
    68 @babel.localeselector
    59 def get_locale():
    69 def get_locale():
    60     """ToDo: if translation is completed, switch to en """
    70     """ToDo: if translation is completed, switch to en """
    61     return LANGUAGE_SELECTED or request.accept_languages.best_match(LANGUAGES.keys()) or 'de'
    71     return LANGUAGE_SELECTED or request.accept_languages.best_match(LANGUAGES.keys()) or 'de'
    67     return render_template("/index.html",
    77     return render_template("/index.html",
    68                            eskp_info=_(u'About ESKP'),
    78                            eskp_info=_(u'About ESKP'),
    69                            )
    79                            )
    70 
    80 
    71 
    81 
    72 @app.route('/ozoneloss/years/2014')
    82 @app.route('/ozoneloss/clams/2014')
    73 def y2014():
    83 def y2014():
    74     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst")
    84     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_clams.rst")
    75     content = get_content(filename)
    85     content = get_content(filename)
    76     return render_template("/ozoneloss_years.html", act="ozoneloss/years/2014", content=content, year=2014)
    86     return render_template("/ozoneloss_clams.html", act="ozoneloss/clams/2014", content=content, year=2014)
    77 
    87 
    78 @app.route('/ozoneloss/years/2013')
    88 @app.route('/ozoneloss/clams/2013')
    79 def y2013():
    89 def y2013():
    80     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst")
    90     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_clams.rst")
    81     content = get_content(filename)
    91     content = get_content(filename)
    82     return render_template("/ozoneloss_years.html", act="ozoneloss/years/2013", content=content, year=2013)
    92     return render_template("/ozoneloss_clams.html", act="ozoneloss/clams/2013", content=content, year=2013)
    83 
    93 
    84 @app.route('/ozoneloss/years/2012')
    94 @app.route('/ozoneloss/clams/2012')
    85 def y2012():
    95 def y2012():
    86     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst")
    96     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_clams.rst")
    87     content = get_content(filename)
    97     content = get_content(filename)
    88     return render_template("/ozoneloss_years.html", act="ozoneloss/years/2012", content=content, year=2012)
    98     return render_template("/ozoneloss_clams.html", act="ozoneloss/clams/2012", content=content, year=2012)
    89 
    99 
    90 @app.route('/ozoneloss/years/2011')
   100 @app.route('/ozoneloss/clams/2011')
    91 def y2011():
   101 def y2011():
    92     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst")
   102     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_clams.rst")
    93     content = get_content(filename)
   103     content = get_content(filename)
    94     return render_template("/ozoneloss_years.html", act="ozoneloss/years/2011", content=content, year=2011)
   104     return render_template("/ozoneloss_clams.html", act="ozoneloss/clams/2011", content=content, year=2011)
    95 
   105 
    96 @app.route('/ozoneloss/years/2010')
   106 @app.route('/ozoneloss/clams/2010')
    97 def y2010():
   107 def y2010():
    98     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst")
   108     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_clams.rst")
    99     content = get_content(filename)
   109     content = get_content(filename)
   100     return render_template("/ozoneloss_years.html", act="ozoneloss/years/2010", content=content, year=2010)
   110     return render_template("/ozoneloss_clams.html", act="ozoneloss/clams/2010", content=content, year=2010)
       
   111 
       
   112 @app.route('/ozoneloss/vpsc/2014')
       
   113 def y2014a():
       
   114     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_vpsc.rst")
       
   115     content = get_content(filename)
       
   116     return render_template("/ozoneloss_vpsc.html", act="ozoneloss/vpsc/2014", content=content, year=2014)
       
   117 
       
   118 @app.route('/ozoneloss/vpsc/2013')
       
   119 def y2013a():
       
   120     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_vpsc.rst")
       
   121     content = get_content(filename)
       
   122     return render_template("/ozoneloss_vpsc.html", act="ozoneloss/vpsc/2013", content=content, year=2013)
       
   123 
       
   124 @app.route('/ozoneloss/vpsc/2012')
       
   125 def y2012a():
       
   126     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_vpsc.rst")
       
   127     content = get_content(filename)
       
   128     return render_template("/ozoneloss_vpsc.html", act="ozoneloss/vpsc/2012", content=content, year=2012)
       
   129 
       
   130 @app.route('/ozoneloss/vpsc/2011')
       
   131 def y2011a():
       
   132     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_vpsc.rst")
       
   133     content = get_content(filename)
       
   134     return render_template("/ozoneloss_vpsc.html", act="ozoneloss/vpsc/2011", content=content, year=2011)
       
   135 
       
   136 @app.route('/ozoneloss/vpsc/2010')
       
   137 def y2010a():
       
   138     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_vpsc.rst")
       
   139     content = get_content(filename)
       
   140     return render_template("/ozoneloss_vpsc.html", act="ozoneloss/vpsc/2010", content=content, year=2010)
   101 
   141 
   102 @app.route('/de')
   142 @app.route('/de')
   103 def de():
   143 def de():
   104     global LANGUAGE_SELECTED
   144     global LANGUAGE_SELECTED
   105     LANGUAGE_SELECTED = "de"
   145     LANGUAGE_SELECTED = "de"
   131 def task():
   171 def task():
   132     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst")
   172     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst")
   133     content = get_content(filename)
   173     content = get_content(filename)
   134     return render_template("/ozoneloss.html", act="ozoneloss", content=content)
   174     return render_template("/ozoneloss.html", act="ozoneloss", content=content)
   135 
   175 
   136 @app.route("/ozoneloss/years")
   176 @app.route("/ozoneloss/clams")
   137 def task1():
   177 def task1():
   138     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst")
   178     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_clams.rst")
   139     content = get_content(filename)
   179     content = get_content(filename)
   140     return render_template("/ozoneloss_years.html", act="ozoneloss/years", content=content)
   180     return render_template("/ozoneloss_clams.html", act="ozoneloss/clams", content=content)
       
   181 
       
   182 @app.route("/ozoneloss/vpsc")
       
   183 def task2():
       
   184     filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_vpsc.rst")
       
   185     content = get_content(filename)
       
   186     return render_template("/ozoneloss_vpsc.html", act="ozoneloss/vpsc", content=content)
   141 
   187 
   142 @app.route("/iek-7")
   188 @app.route("/iek-7")
   143 def submission():
   189 def submission():
   144     filename = os.path.join("templates", get_locale(), "rst", "iek-7.rst")
   190     filename = os.path.join("templates", get_locale(), "rst", "iek-7.rst")
   145     content = get_content(filename)
   191     content = get_content(filename)
Impressum Datenschutzerklärung