diff -r b732704e750d -r bdf11bb4cb98 eskp.py --- a/eskp.py Tue May 13 12:32:22 2014 +0200 +++ b/eskp.py Thu May 15 11:06:22 2014 +0200 @@ -4,7 +4,7 @@ import codecs from docutils.core import publish_parts -from flask import Flask +from flask import Flask, Response from flask import render_template from flask import request from flask.ext.babel import gettext as _ @@ -22,7 +22,6 @@ app.config['BABEL_DEFAULT_LOCALE'] = 'de' - def get_content(filename, overrides=None): content = u"" filename = os.path.join(ESKP_PATH, filename) @@ -62,6 +61,12 @@ app.jinja_env.globals.update(get_o3lossclams_dates=get_o3lossclams_dates) app.jinja_env.globals.update(get_vpsc_dates=get_vpsc_dates) +def author_info(name, filename): + content = get_content(filename) + html = render_template("/author_info.html", act="author", title=name, content=content, exit=_(u"Close")) + return html + + @babel.localeselector def get_locale(): """ToDo: if translation is completed, switch to en """ @@ -126,7 +131,10 @@ def ozoneloss(): filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") content = get_content(filename) - return render_template("/ozoneloss.html", act="ozoneloss", content=content) + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_author.rst") + author = author_info(_(u"Ozoneloss"), filename) + return render_template("/ozoneloss.html", act="ozoneloss", content=content, + author=author, contact = u"Dr. Jens-Uwe Grooß", publications=u"Publications" ) @app.route("/ozoneloss/clams") def ozoneloss_clams(): @@ -144,7 +152,10 @@ def institute(): filename = os.path.join("templates", get_locale(), "rst", "iek-7.rst") content = get_content(filename) - return render_template("/iek-7.html", act="iek-7", content=content) + filename = os.path.join("templates", get_locale(), "rst", "iek-7_author.rst") + author = author_info(_(u"IEK-7"), filename) + return render_template("/iek-7.html", act="iek-7", content=content, + author=author, contact = u"Sandra Stein") @app.route("/imprint") @@ -155,6 +166,8 @@ + + @app.errorhandler(404) def page_not_found(e): msg = _(u"Url: %(url)s not found", url=request.url)