# HG changeset patch # User Reimar Bauer # Date 1400231442 -7200 # Node ID 64c9f7ecbac401d4511f2ba3ceb7aa4740e4f93e # Parent 1562f93c5c679bd0765d78a1b8a77c52e75eca1d refactored modal infos diff -r 1562f93c5c67 -r 64c9f7ecbac4 eskp.py --- a/eskp.py Fri May 16 10:18:42 2014 +0200 +++ b/eskp.py Fri May 16 11:10:42 2014 +0200 @@ -61,9 +61,11 @@ 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): + +def modal_info(template, act, title, filename): content = get_content(filename) - html = render_template("/author_info.html", act="author", title=name, content=content, exit=_(u"Close")) + print template + html = render_template(template, act=act, title=title, content=content, exit=_(u"Close")) return html @@ -126,9 +128,11 @@ filename = os.path.join("templates", get_locale(), "rst", "ozoneloss.rst") content = get_content(filename) filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_author.rst") - author = author_info(_(u"Ozoneloss"), filename) + author = modal_info("/author_info.html", "author", _(u"Ozoneloss"), filename) + filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_publications.rst") + publications = modal_info("/publications_info.html", "publications", _(u"Ozoneloss"), filename) return render_template("/ozoneloss.html", act="ozoneloss", content=content, - author=author, contact = u"Dr. Jens-Uwe Grooß", publications=u"Publications" ) + author=author, contact = u"Dr. Jens-Uwe Grooß", publications=publications ) @app.route("/ozoneloss/clams") def ozoneloss_clams(): @@ -147,7 +151,7 @@ filename = os.path.join("templates", get_locale(), "rst", "iek-7.rst") content = get_content(filename) filename = os.path.join("templates", get_locale(), "rst", "iek-7_author.rst") - author = author_info(_(u"IEK-7"), filename) + author = modal_info("/author_info.html", "author", _(u"IEK-7"), filename) return render_template("/iek-7.html", act="iek-7", content=content, author=author, contact = u"Sandra Stein") diff -r 1562f93c5c67 -r 64c9f7ecbac4 templates/author_info.html --- a/templates/author_info.html Fri May 16 10:18:42 2014 +0200 +++ b/templates/author_info.html Fri May 16 11:10:42 2014 +0200 @@ -1,6 +1,6 @@ - diff -r 1562f93c5c67 -r 64c9f7ecbac4 templates/author_info_link.html --- a/templates/author_info_link.html Fri May 16 10:18:42 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - diff -r 1562f93c5c67 -r 64c9f7ecbac4 templates/iek-7.html --- a/templates/iek-7.html Fri May 16 10:18:42 2014 +0200 +++ b/templates/iek-7.html Fri May 16 11:10:42 2014 +0200 @@ -8,6 +8,6 @@ {{ content|safe }} {{ author|safe }} +{% include "info_link.html" %} -{% include "author_info_link.html" %} {% endblock %} diff -r 1562f93c5c67 -r 64c9f7ecbac4 templates/info_link.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/info_link.html Fri May 16 11:10:42 2014 +0200 @@ -0,0 +1,17 @@ + + + diff -r 1562f93c5c67 -r 64c9f7ecbac4 templates/ozoneloss.html --- a/templates/ozoneloss.html Fri May 16 10:18:42 2014 +0200 +++ b/templates/ozoneloss.html Fri May 16 11:10:42 2014 +0200 @@ -13,9 +13,10 @@
Delta O3 column + {{ author|safe }} - +{{ publications|safe }} +{% include "info_link.html" %} -{% include "author_info_link.html" %} {% endblock %}