comparison 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
comparison
equal deleted inserted replaced
3377:a5c790ed09bd 3378:c8193b600d9b
192 <xsl:choose> 192 <xsl:choose>
193 <xsl:when test="count($preds) &lt; 1"> 193 <xsl:when test="count($preds) &lt; 1">
194 <xsl:value-of select="$global-min"/> 194 <xsl:value-of select="$global-min"/>
195 </xsl:when> 195 </xsl:when>
196 <xsl:otherwise> 196 <xsl:otherwise>
197 <xsl:value-of select="number($preds[last()]/@to)"/> 197 <xsl:variable name="prev-to" select="number($preds[last()]/@to)"/>
198 <xsl:choose>
199 <xsl:when test="$prev-to &lt; $global-min">
200 <xsl:value-of select="$global-min"/>
201 </xsl:when>
202 <xsl:otherwise>
203 <xsl:value-of select="$prev-to"/>
204 </xsl:otherwise>
205 </xsl:choose>
198 </xsl:otherwise> 206 </xsl:otherwise>
199 </xsl:choose> 207 </xsl:choose>
200 </xsl:variable> 208 </xsl:variable>
201 209
202 <xsl:if test="$prev-end &lt; $global-max"> 210 <xsl:if test="$prev-end &lt; $global-max">
271 279
272 <xsl:template match="gauge" mode="gauges"> 280 <xsl:template match="gauge" mode="gauges">
273 <xsl:call-template name="emit-gap-gauge"> 281 <xsl:call-template name="emit-gap-gauge">
274 <xsl:with-param name="gauge" select="."/> 282 <xsl:with-param name="gauge" select="."/>
275 </xsl:call-template> 283 </xsl:call-template>
284
276 <div> 285 <div>
277 <xsl:variable name="start">
278 <xsl:choose>
279 <xsl:when test="number(@from) &lt; $global-min">
280 <xsl:value-of select="$global-min"/>
281 </xsl:when>
282 <xsl:otherwise>
283 <xsl:value-of select="number(@from)"/>
284 </xsl:otherwise>
285 </xsl:choose>
286 </xsl:variable>
287
288 <xsl:variable name="end">
289 <xsl:choose>
290 <xsl:when test="number(@to) &gt; $global-max">
291 <xsl:value-of select="$global-max"/>
292 </xsl:when>
293 <xsl:otherwise>
294 <xsl:value-of select="number(@to)"/>
295 </xsl:otherwise>
296 </xsl:choose>
297 </xsl:variable>
298
299 <xsl:attribute name="style"> 286 <xsl:attribute name="style">
300 <xsl:text>overflow:hidden;background:</xsl:text> 287 <xsl:text>overflow:hidden;background:</xsl:text>
301 <xsl:choose> 288 <xsl:choose>
302 <xsl:when test="(count(preceding::*) mod 2) = 0">#ada96e</xsl:when> 289 <xsl:when test="(count(preceding::*) mod 2) = 0">#ada96e</xsl:when>
303 <xsl:otherwise>silver</xsl:otherwise> 290 <xsl:otherwise>silver</xsl:otherwise>
307 <xsl:with-param name="sector" select="."/> 294 <xsl:with-param name="sector" select="."/>
308 </xsl:call-template> 295 </xsl:call-template>
309 <xsl:text>%</xsl:text> 296 <xsl:text>%</xsl:text>
310 <xsl:text>;float:left</xsl:text> 297 <xsl:text>;float:left</xsl:text>
311 </xsl:attribute> 298 </xsl:attribute>
299
312 <xsl:attribute name="title"> 300 <xsl:attribute name="title">
301 <xsl:variable name="start">
302 <xsl:choose>
303 <xsl:when test="number(@from) &lt; $global-min">
304 <xsl:value-of select="$global-min"/>
305 </xsl:when>
306 <xsl:otherwise>
307 <xsl:value-of select="number(@from)"/>
308 </xsl:otherwise>
309 </xsl:choose>
310 </xsl:variable>
311
312 <xsl:variable name="end">
313 <xsl:choose>
314 <xsl:when test="number(@to) &gt; $global-max">
315 <xsl:value-of select="$global-max"/>
316 </xsl:when>
317 <xsl:otherwise>
318 <xsl:value-of select="number(@to)"/>
319 </xsl:otherwise>
320 </xsl:choose>
321 </xsl:variable>
322
313 <xsl:value-of select="@name"/> 323 <xsl:value-of select="@name"/>
314 <xsl:text>: km </xsl:text> 324 <xsl:text>: km </xsl:text>
315 <xsl:value-of select="format-number($start, $km-pattern, $locale)"/> 325 <xsl:value-of select="format-number($start, $km-pattern, $locale)"/>
316 <xsl:text> - </xsl:text> 326 <xsl:text> - </xsl:text>
317 <xsl:value-of select="format-number($end, $km-pattern, $locale)"/> 327 <xsl:value-of select="format-number($end, $km-pattern, $locale)"/>

http://dive4elements.wald.intevation.org