[Dive4elements-commits] [PATCH] Workaround for flys/issue1161: Render gauge names into tooltip, too
Wald Commits
scm-commit at wald.intevation.org
Thu Apr 11 18:58:43 CEST 2013
# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1365699513 -7200
# Node ID a3b170869c7790dc0b6137eadff052b794b54452
# Parent 47c07faf388a1a9a00962d92befb057d7461d07d
Workaround for flys/issue1161: Render gauge names into tooltip, too.
diff -r 47c07faf388a -r a3b170869c77 flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl
--- a/flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl Thu Apr 11 16:39:29 2013 +0200
+++ b/flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl Thu Apr 11 18:58:33 2013 +0200
@@ -24,6 +24,13 @@
</xsl:choose>
</xsl:variable>
+ <xsl:variable name="i18n-gauge">
+ <xsl:choose>
+ <xsl:when test="$locale = 'de'">Pegel</xsl:when>
+ <xsl:otherwise>Gauge</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:variable name="i18n-event">
<xsl:choose>
<xsl:when test="$locale = 'de'">Ereignis</xsl:when>
@@ -255,6 +262,13 @@
<xsl:when test="@class = '2'"> / Q <xsl:value-of select="$i18n-around-mhq"/></xsl:when>
<xsl:when test="@class = '3'"> / Q <xsl:value-of select="$i18n-above-hq5"/></xsl:when>
</xsl:choose>
+ <xsl:text>
</xsl:text>
+ <xsl:value-of select="$i18n-gauge"/>
+ <xsl:text>:</xsl:text>
+ <xsl:call-template name="find-gauges">
+ <xsl:with-param name="start" select="@from"/>
+ <xsl:with-param name="stop" select="@to"/>
+ </xsl:call-template>
</xsl:attribute>
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
</div>
@@ -277,6 +291,18 @@
</tr>
</xsl:template>
+ <xsl:template match="text()" mode="gauge-list"/>
+ <xsl:template match="gauge" mode="gauge-list">
+ <xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:template>
+
+ <xsl:template name="find-gauges">
+ <xsl:param name="start"/>
+ <xsl:param name="stop"/>
+ <xsl:apply-templates mode="gauge-list"
+ select="/fixings/gauges/gauge[not((number(@to) < number($start)) or (number(@from) > number($stop)))]"/>
+ </xsl:template>
+
<xsl:template match="gauge" mode="gauges">
<xsl:call-template name="emit-gap-gauge">
<xsl:with-param name="gauge" select="."/>
More information about the Dive4elements-commits
mailing list