comparison gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl @ 577:60caaa265e2b

Render a matrix for measurement selection (measurement-parameter). gnv/trunk@714 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 26 Feb 2010 13:54:47 +0000
parents 59c6c7b62e43
children 97d90e314af5
comparison
equal deleted inserted replaced
576:b21fc7502750 577:60caaa265e2b
71 </xsl:template> 71 </xsl:template>
72 72
73 73
74 74
75 <xsl:template match="xform:group"> 75 <xsl:template match="xform:group">
76 <xsl:variable name="selectcount" select="count(xform:select)"/>
77
76 <legend> 78 <legend>
77 <xsl:value-of select="xform:label"/> 79 <xsl:value-of select="xform:label"/>
78 </legend> 80 </legend>
79 <table class="dynamic"> 81
80 <xsl:apply-templates/> 82 <xsl:choose>
83 <xsl:when test="$selectcount &lt; '2'">
84 <table class="dynamic">
85 <xsl:apply-templates/>
86 </table>
87 </xsl:when>
88 <xsl:otherwise>
89 <table class="static">
90 <tr>
91 <td><!-- nothing here --></td>
92 <xsl:for-each select="xform:select[1]/xform:item">
93 <td class="matrixHeader"><xsl:value-of select="position()"/>.</td>
94 </xsl:for-each>
95 </tr>
96 <xsl:apply-templates mode="matrix" />
97 </table>
98 <xsl:apply-templates select="xform:select[1]" mode="matrixLegend"/>
99 </xsl:otherwise>
100 </xsl:choose>
101 </xsl:template>
102
103 <!-- template for rendering parameter matrix -->
104 <xsl:template match="xform:select" mode="matrix">
105 <tr>
106 <td><xsl:value-of select="@label" /></td>
107 <xsl:apply-templates mode="matrix" />
108 </tr>
109 </xsl:template>
110
111 <!-- template for rendering parameter matrix -->
112 <xsl:template match="xform:select" mode="matrixLegend">
113 <table>
114 <xsl:for-each select="xform:item">
115 <tr>
116 <td><xsl:value-of select="position()" />.:</td>
117 <td><xsl:value-of select="@parameter" /></td>
118 </tr>
119 </xsl:for-each>
81 </table> 120 </table>
121 </xsl:template>
122
123 <!-- template for rendering parameter matrix -->
124 <xsl:template match="xform:item" mode="matrix">
125 <xsl:variable name="value" select="xform:value/text()"/>
126 <xsl:variable name="name" select="@ref"/>
127 <td>
128 <xsl:choose>
129 <xsl:when test="@disabled = 'true'">
130 <input type="checkbox" name="{$name}" value="{$value}" disabled="true"></input>
131 </xsl:when>
132 <xsl:otherwise>
133 <input type="checkbox" name="{$name}" value="{$value}"></input>
134 </xsl:otherwise>
135 </xsl:choose>
136 </td>
82 </xsl:template> 137 </xsl:template>
83 138
84 139
85 <xsl:template match="xform:input"> 140 <xsl:template match="xform:input">
86 <xsl:variable name="inputValue" select="xform:value"/> 141 <xsl:variable name="inputValue" select="xform:value"/>

http://dive4elements.wald.intevation.org