mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Move XSLT depth conversion to commonTemplates
Moving depth conversion template from MacDive specific XSLT to commonTemplates. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
This commit is contained in:
parent
e123fe912d
commit
405e5050a1
2 changed files with 17 additions and 16 deletions
|
@ -529,22 +529,6 @@
|
|||
</xsl:template>
|
||||
<!-- end convert time -->
|
||||
|
||||
<!-- convert depth to meters -->
|
||||
<xsl:template name="depthConvert">
|
||||
<xsl:param name="depth"/>
|
||||
<xsl:param name="units"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$units = 'Imperial'">
|
||||
<xsl:value-of select="concat(format-number(($depth * 0.3048), '#.##'), ' m')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat($depth, ' m')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<!-- end convert depth -->
|
||||
|
||||
<!-- convert weight to kg -->
|
||||
<xsl:template name="weightConvert">
|
||||
<xsl:param name="weight"/>
|
||||
|
|
|
@ -168,6 +168,23 @@
|
|||
<xsl:value-of select="concat(floor($depth div 1000), '.', format-number($depth mod 1000, '00'))"/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- convert depth to meters -->
|
||||
<xsl:template name="depthConvert">
|
||||
<xsl:param name="depth"/>
|
||||
<xsl:param name="units"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$units = 'Imperial'">
|
||||
<xsl:value-of select="concat(format-number(($depth * 0.3048), '#.##'), ' m')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat($depth, ' m')"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
<!-- end convert depth -->
|
||||
|
||||
|
||||
<!-- Convert date format "Sun Jan 19 11:02:56 2014 UTC" => 2014-1-19
|
||||
11:02 -->
|
||||
<xsl:template name="convertDate">
|
||||
|
|
Loading…
Add table
Reference in a new issue