forked from Kitware/CDash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
filterdataTemplate.xsl
218 lines (202 loc) · 10.6 KB
/
filterdataTemplate.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<!-- filterdata template -->
<xsl:template name="filterdata">
<div id="div_showfilters">
<xsl:if test="cdash/filterdata/showfilters = 0">
<xsl:attribute name="style">display: none;</xsl:attribute>
</xsl:if>
<xsl:if test="cdash/filterdata/debug = 1">
Filter Definitions:<br/>
<xsl:for-each select="cdash/filterdata/filterdefinitions/def">
<xsl:value-of select="key"/>, <xsl:value-of select="uitext"/>, <xsl:value-of select="type"/>, <xsl:value-of select="valuelist"/>, <xsl:value-of select="defaultvalue"/><br/>
</xsl:for-each>
<br/>
</xsl:if>
<form method="post" action="">
<table id="tablefilters" cellpadding="0" cellspacing="0">
<tr class="table-heading0" >
<td colspan="10" class="nob">
<h3>Filters</h3>
</td>
</tr>
<tr class="trodd">
<td>
<span id="Match_filter">
<xsl:if test="count(cdash/filterdata/filters/filter) = 1">
Match the following rule:
<input type="hidden" name="filtercombine" id="id_filtercombine">
<xsl:attribute name="value"><xsl:value-of select="cdash/filterdata/filtercombine"/></xsl:attribute>
</input>
</xsl:if>
<xsl:if test="count(cdash/filterdata/filters/filter) > 1">
Match<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
<select name="filtercombine" id="id_filtercombine">
<option value="and">
<xsl:if test="cdash/filterdata/filtercombine != 'or'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
all
</option>
<option value="or">
<xsl:if test="cdash/filterdata/filtercombine = 'or'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
any
</option>
</select>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>of the following rules:
</xsl:if>
</span>
</td>
</tr>
<xsl:for-each select="cdash/filterdata/filters/filter">
<tr><xsl:attribute name="class"><xsl:if test="position() mod 2 = 0">trodd filterFields</xsl:if><xsl:if test="position() mod 2 = 1">treven filterFields</xsl:if></xsl:attribute>
<xsl:attribute name="number"><xsl:value-of select="position()"/></xsl:attribute>
<xsl:attribute name="id">filter<xsl:value-of select="position()"/></xsl:attribute>
<td>
<select onchange="filters_field_onchange(this)" onfocus="filters_field_onfocus(this)" onblur="filters_onblur(this)">
<xsl:attribute name="id">id_field<xsl:value-of select="position()"/></xsl:attribute>
<xsl:attribute name="name">field<xsl:value-of select="position()"/></xsl:attribute>
<xsl:variable name="xv_field" select="field"/>
<xsl:for-each select="../../filterdefinitions/def">
<option>
<xsl:attribute name="value"><xsl:value-of select="key"/>/<xsl:value-of select="type"/></xsl:attribute>
<xsl:if test="$xv_field = key">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:value-of select="uitext"/>
</option>
</xsl:for-each>
</select>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
<select onblur="filters_onblur(this)" onchange="filters_onchange(this)">
<xsl:attribute name="id">id_compare<xsl:value-of select="position()"/></xsl:attribute>
<xsl:attribute name="name">compare<xsl:value-of select="position()"/></xsl:attribute>
<xsl:choose>
<xsl:when test ="compare >= 80">
<option value="80"><xsl:if test="compare=80"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>-- choose comparison --</option>
<option value="81"><xsl:if test="compare=81"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is</option>
<option value="82"><xsl:if test="compare=82"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is not</option>
<option value="83"><xsl:if test="compare=83"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is after</option>
<option value="84"><xsl:if test="compare=84"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is before</option>
</xsl:when>
<xsl:when test ="compare >= 60">
<option value="60"><xsl:if test="compare=60"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>-- choose comparison --</option>
<option value="63"><xsl:if test="compare=63"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>contains</option>
<option value="64"><xsl:if test="compare=64"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>does not contain</option>
<option value="61"><xsl:if test="compare=61"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is</option>
<option value="62"><xsl:if test="compare=62"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is not</option>
<option value="65"><xsl:if test="compare=65"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>starts with</option>
<option value="66"><xsl:if test="compare=66"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>ends with</option>
</xsl:when>
<xsl:when test ="compare >= 40">
<option value="40"><xsl:if test="compare=40"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>-- choose comparison --</option>
<option value="41"><xsl:if test="compare=41"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is</option>
<option value="42"><xsl:if test="compare=42"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is not</option>
<option value="43"><xsl:if test="compare=43"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is greater than</option>
<option value="44"><xsl:if test="compare=44"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is less than</option>
</xsl:when>
<xsl:when test="compare >= 0">
<option value="0"><xsl:if test="compare=0"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>-- choose comparison --</option>
<option value="1"><xsl:if test="compare=1"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is true</option>
<option value="2"><xsl:if test="compare=2"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>is false</option>
</xsl:when>
</xsl:choose>
</select>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
<input type="text" size="60" onblur="filters_onblur(this)" onchange="filters_onchange(this)">
<xsl:attribute name="id">id_value<xsl:value-of select="position()"/></xsl:attribute>
<xsl:attribute name="name">value<xsl:value-of select="position()"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="value"/></xsl:attribute>
</input>
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
<input type="button" value="-">
<xsl:attribute name="name">remove<xsl:value-of select="position()"/></xsl:attribute>
<xsl:attribute name="onclick">removeFilter(<xsl:value-of select="position()"/>)</xsl:attribute>
<xsl:if test="last() = 1">
<xsl:attribute name="disabled">disabled</xsl:attribute>
</xsl:if>
</input>
<input type="button" value="+">
<xsl:attribute name="onclick">addFilter(<xsl:value-of select="position()"/>)</xsl:attribute>
<xsl:attribute name="name">add<xsl:value-of select="position()"/></xsl:attribute>
</input>
</td>
</tr>
<xsl:if test="../../debug != 0">
<tr><xsl:attribute name="class"><xsl:if test="position() mod 2 = 0">treven</xsl:if><xsl:if test="position() mod 2 = 1">trodd</xsl:if></xsl:attribute>
<td>
field<xsl:value-of select="position()"/>: <xsl:value-of select="field"/>,
compare<xsl:value-of select="position()"/>: <xsl:value-of select="compare"/>,
value<xsl:value-of select="position()"/>: <xsl:value-of select="value"/>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr>
<xsl:attribute name="class">
<xsl:if test="count(cdash/filterdata/filters/filter) mod 2 = 0">treven</xsl:if>
<xsl:if test="count(cdash/filterdata/filters/filter) mod 2 = 1">trodd</xsl:if>
</xsl:attribute>
<xsl:if test="cdash/filterdata/showlimit = 0">
<td>
<input type="hidden" id="id_limit" name="limit">
<xsl:attribute name="value"><xsl:value-of select="cdash/filterdata/limit"/></xsl:attribute>
</input>
</td>
</xsl:if>
<xsl:if test="cdash/filterdata/showlimit = 1">
<td>
Limit results to
<input type="text" size="3" onblur="filters_onblur(this)" onchange="filters_onchange(this)"
id="id_limit" name="limit" align="center">
<xsl:attribute name="value"><xsl:value-of select="cdash/filterdata/limit"/></xsl:attribute>
</input>
rows (0 for unlimited)
</td>
</xsl:if>
</tr>
<tr>
<xsl:attribute name="class">
<xsl:if test="count(cdash/filterdata/filters/filter) mod 2 = 0">
<xsl:if test="cdash/filterdata/showlimit = 0">treven</xsl:if>
<xsl:if test="cdash/filterdata/showlimit = 1">trodd</xsl:if>
</xsl:if>
<xsl:if test="count(cdash/filterdata/filters/filter) mod 2 = 1">
<xsl:if test="cdash/filterdata/showlimit = 0">trodd</xsl:if>
<xsl:if test="cdash/filterdata/showlimit = 1">treven</xsl:if>
</xsl:if>
</xsl:attribute>
<td>
<input type="hidden" name="filtercount" id="id_filtercount">
<xsl:attribute name="value"><xsl:value-of select="count(cdash/filterdata/filters/filter)"/></xsl:attribute>
</input>
<input type="hidden" name="showfilters" id="id_showfilters" value="1" />
<input type="submit" name="apply" value="Apply" />
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
<input type="submit" name="clear" value="Clear" />
<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>
<input type="button" onclick="filters_create_hyperlink()" name="create_hyperlink" value="Create Hyperlink"/>
</td>
</tr>
<tr>
<xsl:attribute name="class">
<xsl:if test="count(cdash/filterdata/filters/filter) mod 2 = 0">
<xsl:if test="cdash/filterdata/showlimit = 0">trodd</xsl:if>
<xsl:if test="cdash/filterdata/showlimit = 1">treven</xsl:if>
</xsl:if>
<xsl:if test="count(cdash/filterdata/filters/filter) mod 2 = 1">
<xsl:if test="cdash/filterdata/showlimit = 0">treven</xsl:if>
<xsl:if test="cdash/filterdata/showlimit = 1">trodd</xsl:if>
</xsl:if>
</xsl:attribute>
<td>
<div id="div_filtersAsUrl"/>
</td>
</tr>
</table>
</form>
</div>
</xsl:template>
</xsl:stylesheet>