Mercurial > dive4elements > river
changeset 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 | 0de61fc9d281 |
files | flys-client/ChangeLog flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl |
diffstat | 2 files changed, 39 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Sat Jul 21 18:05:58 2012 +0000 +++ b/flys-client/ChangeLog Sat Jul 21 19:54:20 2012 +0000 @@ -1,3 +1,9 @@ +2012-07-21 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl: + Catch the case that a previous gauge is before the start of the + events. This led to a broken layout. + 2012-07-21 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl:
--- 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 < $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) < $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) > $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) < $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) > $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)"/>