eskp.py
changeset 1057 53622e770eca
parent 1056 cdd6167a71de
child 1116 0559fcb555f1
     1.1 --- a/eskp.py	Mon Feb 03 23:07:26 2020 +0100
     1.2 +++ b/eskp.py	Tue Feb 04 08:47:05 2020 +0100
     1.3 @@ -309,7 +309,7 @@
     1.4  def ozoneloss_uvi():
     1.5      filename = os.path.join("templates", get_locale(), "rst", "ozoneloss_uvi.rst")
     1.6      content = get_content(filename)
     1.7 -    htmlfile = os.path.join("templates", get_locale(), "html", "ozoneloss_uvi_form.html")
     1.8 +    htmlfile = os.path.join("templates", get_locale(), "html", "ozoneloss_uvi_form_start.html")
     1.9      html_content = get_html_content(htmlfile)
    1.10      htmlfile = os.path.join("templates", get_locale(), "html", "uvi_table.html")
    1.11      html_table = get_html_content(htmlfile)
    1.12 @@ -317,11 +317,10 @@
    1.13      lat = 50.
    1.14      o3offset = 50.
    1.15      figname = "uvincr_lat%0.3i_do3%0.3i.svg" % (lat, o3offset)
    1.16 -    button_text = _("Graph anzeigen")
    1.17  
    1.18      return render_template('ozoneloss_uvi.html', act="ozoneloss/uvi", content=content, figname=figname,
    1.19                             alt=_(u"UV increase at {{lat}} degrees N for {{o3offset}} DU ozone depletion"),
    1.20 -                                 html_content=html_content, html_table=html_table, button_text=button_text)
    1.21 +                                 html_content=html_content, html_table=html_table)
    1.22  
    1.23  
    1.24  @app.route("/ozoneloss/uvi_graph", methods=['POST'])
    1.25 @@ -337,21 +336,20 @@
    1.26      o3offsetstr = request.form['Dobson-Unit']
    1.27  
    1.28      latstr2 = latstr.replace(u'\xb0', '')
    1.29 -
    1.30      if latstr2.endswith(u'N'):
    1.31          latstr2 = latstr2.replace(u'N', '')
    1.32          lat = float(latstr2)
    1.33      if latstr2.endswith(u'S'):
    1.34          latstr2 = latstr2.replace(u'S', '')
    1.35          lat = -float(latstr2)
    1.36 +        
    1.37 +    html_content = html_content.replace('{{latstr}}', latstr)
    1.38 +    html_content = html_content.replace('{{o3offsetstr}}', o3offsetstr)
    1.39 +    figname = "uvincr_lat%0.3i_do3%0.3i.svg" % (lat, float(o3offsetstr))
    1.40  
    1.41 -    figname = "uvincr_lat%0.3i_do3%0.3i.svg" % (lat, float(o3offsetstr))
    1.42 -    button_text = _("Graph anzeigen")
    1.43 -
    1.44 -    return render_template('graph.html', act="ozoneloss_uvi_graph", content=content, figname=figname,
    1.45 +    return render_template('ozoneloss_uvi.html', act="ozoneloss_uvi_graph", content=content, figname=figname,
    1.46                             alt=_(u"UV increase at {{lat}} degrees N for {{o3offset}} DU ozone depletion"),
    1.47 -                           o3offsetstr=o3offsetstr, latstr=latstr, html_content=html_content,
    1.48 -                           html_table=html_table, button_text=button_text)
    1.49 +                           html_content=html_content, html_table=html_table)
    1.50  
    1.51  @app.route("/ozoneloss/decadal")
    1.52  def ozoneloss_decadal():
Impressum Datenschutzerklärung