33 content = publish_parts(rst_data, writer_name='html', settings_overrides=overrides)['html_body'] |
33 content = publish_parts(rst_data, writer_name='html', settings_overrides=overrides)['html_body'] |
34 return content |
34 return content |
35 |
35 |
36 def get_topmenue(): |
36 def get_topmenue(): |
37 menue = [ |
37 menue = [ |
|
38 ('/', _(u'Home')), |
38 ('/ozoneloss', _(u'Ozoneloss')), |
39 ('/ozoneloss', _(u'Ozoneloss')), |
39 ('/eskp', _(u'ESKP')), |
40 ('/eskp', _(u'ESKP')), |
40 ('/iek-7', _(u'IEK-7')), |
41 ('/iek-7', _(u'IEK-7')), |
41 ] |
42 ] |
42 return menue |
43 return menue |
43 |
44 |
44 app.jinja_env.globals.update(get_topmenue=get_topmenue) |
45 app.jinja_env.globals.update(get_topmenue=get_topmenue) |
45 |
46 |
46 def get_ozone_dates(): |
47 def get_ozone_dates(): |
47 menue = [('/ozoneloss/2014', _(u'2014')), |
48 menue = [('/ozoneloss/years/2014', _(u'2014')), |
48 ('/ozoneloss/2013', _(u'2013')), |
49 ('/ozoneloss/years/2013', _(u'2013')), |
49 ('/ozoneloss/2012', _(u'2012')), |
50 ('/ozoneloss/years/2012', _(u'2012')), |
50 ('/ozoneloss/2011', _(u'2011')), |
51 ('/ozoneloss/years/2011', _(u'2011')), |
51 ('/ozoneloss/2010', _(u'2010')), |
52 ('/ozoneloss/years/2010', _(u'2010')), |
52 ] |
53 ] |
53 return menue |
54 return menue |
54 |
55 |
55 app.jinja_env.globals.update(get_ozone_dates=get_ozone_dates) |
56 app.jinja_env.globals.update(get_ozone_dates=get_ozone_dates) |
56 |
57 |
66 return render_template("/index.html", |
67 return render_template("/index.html", |
67 eskp_info=_(u'About ESKP'), |
68 eskp_info=_(u'About ESKP'), |
68 ) |
69 ) |
69 |
70 |
70 |
71 |
71 @app.route('/ozoneloss/2014') |
72 @app.route('/ozoneloss/years/2014') |
72 def y2014(): |
73 def y2014(): |
73 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") |
74 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") |
74 content = get_content(filename) |
75 content = get_content(filename) |
75 return render_template("/ozoneloss.html", act="ozoneloss/2014", content=content, year=2014) |
76 return render_template("/ozoneloss_years.html", act="ozoneloss/years/2014", content=content, year=2014) |
76 |
77 |
77 @app.route('/ozoneloss/2013') |
78 @app.route('/ozoneloss/years/2013') |
78 def y2013(): |
79 def y2013(): |
79 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") |
80 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") |
80 content = get_content(filename) |
81 content = get_content(filename) |
81 return render_template("/ozoneloss.html", act="ozoneloss/2013", content=content, year=2013) |
82 return render_template("/ozoneloss_years.html", act="ozoneloss/years/2013", content=content, year=2013) |
82 |
83 |
83 @app.route('/ozoneloss/2012') |
84 @app.route('/ozoneloss/years/2012') |
84 def y2012(): |
85 def y2012(): |
85 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") |
86 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") |
86 content = get_content(filename) |
87 content = get_content(filename) |
87 return render_template("/ozoneloss.html", act="ozoneloss/2012", content=content, year=2012) |
88 return render_template("/ozoneloss_years.html", act="ozoneloss/years/2012", content=content, year=2012) |
88 |
89 |
89 @app.route('/ozoneloss/2011') |
90 @app.route('/ozoneloss/years/2011') |
90 def y2011(): |
91 def y2011(): |
91 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") |
92 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") |
92 content = get_content(filename) |
93 content = get_content(filename) |
93 return render_template("/ozoneloss.html", act="ozoneloss/2011", content=content, year=2011) |
94 return render_template("/ozoneloss_years.html", act="ozoneloss/years/2011", content=content, year=2011) |
94 |
95 |
95 @app.route('/ozoneloss/2010') |
96 @app.route('/ozoneloss/years/2010') |
96 def y2010(): |
97 def y2010(): |
97 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") |
98 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") |
98 content = get_content(filename) |
99 content = get_content(filename) |
99 return render_template("/ozoneloss.html", act="ozoneloss/2010", content=content, year=2010) |
100 return render_template("/ozoneloss_years.html", act="ozoneloss/years/2010", content=content, year=2010) |
100 |
101 |
101 @app.route('/de') |
102 @app.route('/de') |
102 def de(): |
103 def de(): |
103 global LANGUAGE_SELECTED |
104 global LANGUAGE_SELECTED |
104 LANGUAGE_SELECTED = "de" |
105 LANGUAGE_SELECTED = "de" |
128 |
129 |
129 @app.route("/ozoneloss") |
130 @app.route("/ozoneloss") |
130 def task(): |
131 def task(): |
131 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") |
132 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") |
132 content = get_content(filename) |
133 content = get_content(filename) |
133 return render_template("/ozoneloss.html", act="ozoneloss", content=content, year=2014) |
134 return render_template("/ozoneloss.html", act="ozoneloss", content=content) |
|
135 |
|
136 @app.route("/ozoneloss/years") |
|
137 def task1(): |
|
138 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_years.rst") |
|
139 content = get_content(filename) |
|
140 return render_template("/ozoneloss_years.html", act="ozoneloss/years", content=content) |
134 |
141 |
135 @app.route("/iek-7") |
142 @app.route("/iek-7") |
136 def submission(): |
143 def submission(): |
137 filename = os.path.join("templates", get_locale(), "rst", "iek-7.rst") |
144 filename = os.path.join("templates", get_locale(), "rst", "iek-7.rst") |
138 content = get_content(filename) |
145 content = get_content(filename) |