diff flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl @ 3378:c8193b600d9b

FixA: Overview: Catch the case that a previous gauge is before the start of the events. flys-client/trunk@5096 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 21 Jul 2012 19:54:20 +0000
parents a5c790ed09bd
children a3b170869c77
line wrap: on
line diff
--- a/flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl	Sat Jul 21 18:05:58 2012 +0000
+++ b/flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl	Sat Jul 21 19:54:20 2012 +0000
@@ -194,7 +194,15 @@
             <xsl:value-of select="$global-min"/>
           </xsl:when>
           <xsl:otherwise>
-            <xsl:value-of select="number($preds[last()]/@to)"/>
+            <xsl:variable name="prev-to" select="number($preds[last()]/@to)"/>
+            <xsl:choose>
+              <xsl:when test="$prev-to &lt; $global-min">
+                <xsl:value-of select="$global-min"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="$prev-to"/>
+              </xsl:otherwise>
+            </xsl:choose>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
@@ -273,29 +281,8 @@
     <xsl:call-template name="emit-gap-gauge">
       <xsl:with-param name="gauge" select="."/>
     </xsl:call-template>
+
     <div>
-      <xsl:variable name="start">
-        <xsl:choose>
-          <xsl:when test="number(@from) &lt; $global-min">
-            <xsl:value-of select="$global-min"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="number(@from)"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
-
-      <xsl:variable name="end">
-        <xsl:choose>
-          <xsl:when test="number(@to) &gt; $global-max">
-            <xsl:value-of select="$global-max"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:value-of select="number(@to)"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:variable>
-
       <xsl:attribute name="style">
         <xsl:text>overflow:hidden;background:</xsl:text>
         <xsl:choose>
@@ -309,7 +296,30 @@
         <xsl:text>%</xsl:text>
         <xsl:text>;float:left</xsl:text>
       </xsl:attribute>
+
       <xsl:attribute name="title">
+        <xsl:variable name="start">
+          <xsl:choose>
+            <xsl:when test="number(@from) &lt; $global-min">
+              <xsl:value-of select="$global-min"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="number(@from)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
+        <xsl:variable name="end">
+          <xsl:choose>
+            <xsl:when test="number(@to) &gt; $global-max">
+              <xsl:value-of select="$global-max"/>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="number(@to)"/>
+            </xsl:otherwise>
+          </xsl:choose>
+        </xsl:variable>
+
         <xsl:value-of select="@name"/>
         <xsl:text>: km </xsl:text>
         <xsl:value-of select="format-number($start, $km-pattern, $locale)"/>

http://dive4elements.wald.intevation.org