54 def index(): |
52 def index(): |
55 saying, author = get_saying() |
53 saying, author = get_saying() |
56 return render_template("/index.html", |
54 return render_template("/index.html", |
57 saying=saying, |
55 saying=saying, |
58 author=author, |
56 author=author, |
59 competition_info=_(u'About Competition'), |
57 eskp_info=_(u'About ESKP'), |
60 dates=_(u'Dates'), |
58 ) |
61 impressions=_(u'Impressions')) |
|
62 |
59 |
63 @app.route('/de') |
60 @app.route('/de') |
64 def de(): |
61 def de(): |
65 global LANGUAGE_SELECTED |
62 global LANGUAGE_SELECTED |
66 LANGUAGE_SELECTED = "de" |
63 LANGUAGE_SELECTED = "de" |
67 saying, author = get_saying() |
64 saying, author = get_saying() |
68 return render_template("/index.html", |
65 return render_template("/index.html", |
69 saying=saying, |
66 saying=saying, |
70 author=author, |
67 author=author, |
71 competition_info=_(u'About Competition'), |
68 eskp_info=_(u'About ESKP'), |
72 dates=_(u'Dates'), |
69 ) |
73 impressions=_(u'Impressions')) |
|
74 |
70 |
75 @app.route('/en') |
71 @app.route('/en') |
76 def en(): |
72 def en(): |
77 saying, author = get_saying() |
73 saying, author = get_saying() |
78 global LANGUAGE_SELECTED |
74 global LANGUAGE_SELECTED |
79 LANGUAGE_SELECTED = "en" |
75 LANGUAGE_SELECTED = "en" |
80 return render_template("/index.html", |
76 return render_template("/index.html", |
81 saying=saying, |
77 saying=saying, |
82 author=author, |
78 author=author, |
83 competition_info=_(u'About Competition'), |
79 eskp_info=_(u'About ESKP'), |
84 dates=_(u'Dates'), |
80 ) |
85 impressions=_(u'Impressions')) |
|
86 |
81 |
87 @app.route("/competition") |
82 @app.route("/eskp") |
88 def competition(): |
83 def eskp(): |
89 filename = os.path.join("templates", get_locale(), "rst", "competition.rst") |
84 filename = os.path.join("templates", get_locale(), "rst", "eskp.rst") |
90 content = get_content(filename) |
85 content = get_content(filename) |
91 return render_template("/content.html", act="competition", content=content) |
86 return render_template("/content.html", act="eskp", content=content) |
92 |
87 |
93 @app.route("/task") |
88 @app.route("/ozoneloss") |
94 def task(): |
89 def task(): |
95 filename = os.path.join("templates", get_locale(), "rst", "task.rst") |
90 filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") |
96 content = get_content(filename) |
91 content = get_content(filename) |
97 return render_template("/content.html", act="task", content=content) |
92 print content |
|
93 print filename |
|
94 return render_template("/content.html", act="ozoneloss", content=content) |
98 |
95 |
99 @app.route("/submission") |
96 @app.route("/iek-7") |
100 def submission(): |
97 def submission(): |
101 filename = os.path.join("templates", get_locale(), "rst", "submission.rst") |
98 filename = os.path.join("templates", get_locale(), "rst", "iek-7.rst") |
102 content = get_content(filename) |
99 content = get_content(filename) |
103 return render_template("/content.html", act="submission", content=content) |
100 return render_template("/content.html", act="submission", content=content) |
104 |
101 |
105 @app.route("/coursematerial") |
|
106 def coursematerial(): |
|
107 filename = os.path.join("templates", get_locale(), "rst", "coursematerial.rst") |
|
108 content = get_content(filename) |
|
109 return render_template("/content.html", act="coursematerial", content=content) |
|
110 |
102 |
111 @app.route("/imprint") |
103 @app.route("/imprint") |
112 def imprint(): |
104 def imprint(): |
113 filename = os.path.join("templates", get_locale(), "rst", "imprint.rst") |
105 filename = os.path.join("templates", get_locale(), "rst", "imprint.rst") |
114 content = get_content(filename) |
106 content = get_content(filename) |
115 return render_template("/content.html", act="imprint", content=content) |
107 return render_template("/content.html", act="imprint", content=content) |
116 |
108 |
117 @app.route("/privacy") |
|
118 def privacy(): |
|
119 filename = os.path.join("templates", get_locale(), "rst", "privacy.rst") |
|
120 overrides = { |
|
121 'initial_header_level': 2, |
|
122 } |
|
123 content = get_content(filename, overrides=overrides) |
|
124 return render_template("/content.html", act="privacy", content=content) |
|
125 |
|
126 @app.route("/dates") |
|
127 def dates(): |
|
128 filename = os.path.join("templates", get_locale(), "rst", "dates.rst") |
|
129 content = get_content(filename) |
|
130 return render_template("/content.html", |
|
131 act="dates", content=content) |
|
132 |
|
133 @app.route("/prizes") |
|
134 def prizes(): |
|
135 filename = os.path.join("templates", get_locale(), "rst", "prizes.rst") |
|
136 overrides = { |
|
137 'initial_header_level': 2, |
|
138 } |
|
139 content = get_content(filename, overrides=overrides) |
|
140 return render_template("/prizes.html",act="prizes", content=content) |
|
141 |
|
142 |
|
143 |
|
144 @app.route("/competition/2013") |
|
145 def competition_2013(): |
|
146 competition = _(u'Competition 2013') |
|
147 introduction = _(u'The winners of the programming competition, ' |
|
148 u'showed at the PyCon.DE 2013 in Cologne their results. ' |
|
149 u'A short presentation inlcuding a movie about their work done.') |
|
150 article = [_(u'Both students presented to the astonished audience of over 250 Python developers their work.'), |
|
151 _(u'A long applause showed up.' |
|
152 u' Valentin had 9 months ago learned Python and Blender discovered earlier. ' |
|
153 u'His Skatsimulation even includes 3D sound.'), |
|
154 _(u'The preparatory courses were made by volunteers, such as the ' |
|
155 u'employees of the magazine "Time Online" performed. ' |
|
156 u'The following blog entry is a little impression of the success of the courses'), |
|
157 ] |
|
158 game_of_life = _(u'Anne a 15 year old girl showed a 3D-Version of the »Game of life«') |
|
159 skat_simulation = _(u'Valentin (13 years) demomstrates his »Skat-Simulation«') |
|
160 awards = _(u'The award ceremony') |
|
161 return render_template("/impressions_2013.html", |
|
162 act="competition_2013", |
|
163 competition=competition, |
|
164 introduction=introduction, |
|
165 article=article, |
|
166 game_of_life=game_of_life, |
|
167 skat_simulation=skat_simulation, |
|
168 awards=awards) |
|
169 |
109 |
170 |
110 |
171 @app.errorhandler(404) |
111 @app.errorhandler(404) |
172 def page_not_found(e): |
112 def page_not_found(e): |
173 msg = _(u"Url: %(url)s not found", url=request.url) |
113 msg = _(u"Url: %(url)s not found", url=request.url) |