/openshift/adei

To get this branch, use:
bzr branch http://darksoft.org/webbzr/openshift/adei

« back to all changes in this revision

Viewing changes to setups/katrin/xslt/katrin.xsl

  • Committer: Suren A. Chilingaryan
  • Date: 2012-02-07 22:44:15 UTC
  • Revision ID: csa@dside.dyndns.org-20120207224415-sy360wa1ammhd1ph
Use localization subsystem, updated Katrin configs

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
3
<xsl:output encoding="utf-8"/>
4
4
 
5
 
<xsl:variable name="service">
6
 
    services/katrin.php?target=file&amp;
7
 
</xsl:variable>
8
 
 
9
 
<xsl:template name="image">
10
 
    <xsl:param name="width" />
11
 
    <xsl:param name="height" />
12
 
 
13
 
    <xsl:variable name="link">
14
 
        <xsl:text>services/katrin.php?target=file&amp;</xsl:text>
15
 
        <xsl:if test="@run">kdb_run=<xsl:value-of select="@run" />&amp;</xsl:if>
16
 
        <xsl:if test="@hardware">kdb_hardware=<xsl:value-of select="@hardware" />&amp;</xsl:if>
17
 
        <xsl:text>name=</xsl:text><xsl:value-of select="@name" /><xsl:text>&amp;</xsl:text>
18
 
    </xsl:variable>
19
 
 
20
 
    <xsl:element name="a">
21
 
        <xsl:attribute name="href">
22
 
            <xsl:value-of select="$link" />
23
 
            <xsl:text>type=plot</xsl:text>
24
 
        </xsl:attribute>
25
 
        <xsl:attribute name="target">_blank</xsl:attribute>
26
 
        <xsl:element name="img">
27
 
            <xsl:attribute name="src">
28
 
                <xsl:value-of select="$link" />
29
 
                <xsl:text>type=preview</xsl:text>
30
 
            </xsl:attribute>
31
 
            <xsl:attribute name="border">0</xsl:attribute>
32
 
            <xsl:attribute name="alt">
33
 
                <xsl:value-of select="." />
34
 
            </xsl:attribute>
35
 
            <xsl:attribute name="width">
36
 
                <xsl:value-of select="$width" />
37
 
            </xsl:attribute>
38
 
            <xsl:attribute name="height">
39
 
                <xsl:value-of select="$height" />
40
 
            </xsl:attribute>
41
 
        </xsl:element>
42
 
    </xsl:element>
43
 
 
44
 
</xsl:template>
45
 
 
46
 
<xsl:template match="image" mode="small">
47
 
    <xsl:call-template name="image">
48
 
        <xsl:with-param name="width" select="'150'" />
49
 
        <xsl:with-param name="height" select="'100'" />
50
 
    </xsl:call-template>
51
 
</xsl:template>
52
 
 
53
 
<xsl:template match="image" mode="normal">
54
 
    <xsl:call-template name="image">
55
 
        <xsl:with-param name="width" select="'300'" />
56
 
        <xsl:with-param name="height" select="'200'" />
57
 
    </xsl:call-template>
58
 
</xsl:template>
59
 
 
60
 
<xsl:template match="image" mode="large">
61
 
    <xsl:call-template name="image">
62
 
        <xsl:with-param name="width" select="'600'" />
63
 
        <xsl:with-param name="height" select="'400'" />
64
 
    </xsl:call-template>
65
 
</xsl:template>
66
 
 
67
 
<xsl:template match="image" mode="table">
68
 
    <td>
69
 
        <xsl:apply-templates select="." mode="small" />
70
 
    </td>
71
 
</xsl:template>
72
 
 
73
 
<xsl:template match="image" mode="title">
74
 
    <th><xsl:value-of select="." /></th>
75
 
</xsl:template>
76
 
 
77
 
<xsl:template match="file">
78
 
    <p style="margin: 0">
79
 
        <xsl:element name="a">
80
 
            <xsl:attribute name="href">
81
 
                <xsl:text>services/katrin.php?target=file</xsl:text>
82
 
                <xsl:text>&amp;kdb_download=yes</xsl:text>
83
 
                <xsl:if test="@run">
84
 
                    <xsl:text>&amp;kdb_run=</xsl:text>
85
 
                    <xsl:value-of select="@run" />
86
 
                </xsl:if>
87
 
                <xsl:if test="@type">
88
 
                    <xsl:text>&amp;kdb_type=</xsl:text>
89
 
                    <xsl:value-of select="@type" />
90
 
                </xsl:if>
91
 
                <xsl:if test="@filename">
92
 
                    <xsl:text>&amp;kdb_name=</xsl:text>
93
 
                    <xsl:value-of select="@name" />
94
 
                </xsl:if>
95
 
                <xsl:if test="@hardware">
96
 
                    <xsl:text>&amp;kdb_hardware=</xsl:text>
97
 
                    <xsl:value-of select="@hardware" />
98
 
                </xsl:if>
99
 
            </xsl:attribute>
100
 
            <xsl:value-of select="." />
101
 
        </xsl:element>
102
 
        <xsl:if test="@filesize">
103
 
            <span style="font-size: small">
104
 
                <xsl:text> (</xsl:text>
105
 
                <xsl:value-of select="@filesize" />
106
 
                <xsl:text>)</xsl:text>
107
 
            </span>
108
 
        </xsl:if>
109
 
    </p>
110
 
</xsl:template>
111
 
 
112
 
<!-- ADEI links and images -->
113
 
<xsl:template match="adei">
114
 
    <xsl:text>db_server=</xsl:text>
115
 
    <xsl:value-of select="@server" />
116
 
    <xsl:text>&amp;db_name=</xsl:text>
117
 
    <xsl:value-of select="@database" />
118
 
    <xsl:text>&amp;db_group=</xsl:text>
119
 
    <xsl:value-of select="@group" />
120
 
    <xsl:if test="@mask">
121
 
        <xsl:text>&amp;db_mask=</xsl:text>
122
 
        <xsl:value-of select="@mask" />
123
 
    </xsl:if>
124
 
    <xsl:if test="@window">
125
 
        <xsl:text>&amp;window=</xsl:text>
126
 
        <xsl:value-of select="@window" />
127
 
    </xsl:if>
128
 
</xsl:template>
129
 
 
130
 
<xsl:template match="adeiimage" mode="image">
131
 
    <xsl:variable name="url">
132
 
        <xsl:apply-templates select="adei" />
133
 
    </xsl:variable>
134
 
    <td>
135
 
        <xsl:element name="a">
136
 
            <xsl:attribute name="href">
137
 
                <xsl:text>javascript:adei.config.Load('</xsl:text>
138
 
                <xsl:value-of select="$url" />
139
 
                <xsl:text>&amp;module=graph&amp;setup=katrin', true)</xsl:text>
140
 
            </xsl:attribute>
141
 
            <xsl:element name="img">
142
 
                <xsl:attribute name="src">
143
 
                    <xsl:text>services/getimage.php?</xsl:text>
144
 
                    <xsl:value-of select="$url" />
145
 
                    <xsl:text>&amp;hide_axes=1&amp;precision=LOW&amp;width=</xsl:text>
146
 
                    <xsl:value-of select="@width" />
147
 
                    <xsl:text>&amp;height=</xsl:text>
148
 
                    <xsl:value-of select="@height" />
149
 
                </xsl:attribute>
150
 
                <xsl:attribute name="alt">
151
 
                    <xsl:value-of select="@text" />
152
 
                </xsl:attribute>
153
 
                <xsl:attribute name="width">
154
 
                    <xsl:value-of select="@width" />
155
 
                </xsl:attribute>
156
 
                <xsl:attribute name="height">
157
 
                    <xsl:value-of select="@height" />
158
 
                </xsl:attribute>
159
 
                <xsl:attribute name="border">
160
 
                    <xsl:text>0</xsl:text>
161
 
                </xsl:attribute>
162
 
            </xsl:element>
163
 
        </xsl:element>
164
 
    </td>
165
 
</xsl:template>
166
 
 
167
 
<xsl:template match="adeiimage" mode="title">
168
 
    <th><xsl:value-of select="@text" /></th>
169
 
</xsl:template>
170
 
 
171
 
<xsl:template match="plots">
172
 
    <table style="margin:10px 0">
173
 
        <tr>
174
 
            <xsl:apply-templates select="image" mode="title" />
175
 
        </tr>
176
 
        <tr>
177
 
            <xsl:apply-templates select="image" mode="table" />
178
 
        </tr>
179
 
    </table>
180
 
</xsl:template>
181
 
 
182
5
<xsl:template match="streams">
183
6
    <xsl:for-each select="type">
184
7
        <xsl:variable name="title">
205
28
            <xsl:attribute name="title">
206
29
                <xsl:value-of select="$title" />
207
30
            </xsl:attribute>
208
 
            <xsl:attribute name="style">
209
 
                <xsl:text>margin: 0 5px</xsl:text>
210
 
            </xsl:attribute>
 
31
            <xsl:attribute name="style">
 
32
                <xsl:text>margin: 0 5px; vertical-align: middle</xsl:text>
 
33
            </xsl:attribute>
211
34
        </xsl:element>
212
35
    </xsl:for-each>
213
36
</xsl:template>
214
37
 
215
 
<xsl:template match="downloads">
216
 
    <h4>Downloads</h4>
217
 
    <xsl:apply-templates select="file" />
218
 
</xsl:template>
219
 
 
220
 
<xsl:template match="parameters">
221
 
    <xsl:if test="magnet_west or magnet_east">
222
 
        <div style="background-color:#ccffcc">
223
 
            <xsl:if test="magnet_west">
224
 
                West magnet:
225
 
                <b><xsl:value-of select="magnet_west" />A (<xsl:value-of select="field_west" />T)</b>
226
 
            </xsl:if>
227
 
            <xsl:if test="magnet_east">
228
 
                East magnet:
229
 
                <b><xsl:value-of select="magnet_east" />A (<xsl:value-of select="field_east" />T)</b>
230
 
            </xsl:if>
231
 
        </div>
232
 
    </xsl:if>
233
 
    <xsl:if test="det_ps or ps_egun">
234
 
        <div>
235
 
            <xsl:if test="det_ps">
236
 
                Valve Det/PS:
237
 
                <b>
238
 
                    <xsl:value-of select="det_ps" />
239
 
                    <xsl:text> </xsl:text>
240
 
                </b>
241
 
            </xsl:if>
242
 
            <xsl:if test="ps_egun">
243
 
                Valve PS/egun:
244
 
                <b>
245
 
                    <xsl:value-of select="ps_egun" />
246
 
                    <xsl:text> </xsl:text>
247
 
                </b>
248
 
            </xsl:if>
249
 
        </div>
250
 
    </xsl:if>
251
 
    <xsl:if test="t or s1 or s2 or s3 or s4 or d1 or d2">
252
 
        <div style="background-color:#ffcc99">
253
 
            <xsl:if test="t">
254
 
                T:
255
 
                <b>
256
 
                    <xsl:value-of select="t" />
257
 
                    <xsl:text> </xsl:text>
258
 
                </b>
259
 
            </xsl:if>
260
 
            <xsl:if test="s1">
261
 
                S1:
262
 
                <b>
263
 
                    <xsl:value-of select="s1" />
264
 
                    <xsl:text> </xsl:text>
265
 
                </b>
266
 
            </xsl:if>
267
 
            <xsl:if test="s2">
268
 
                S2:
269
 
                <b>
270
 
                    <xsl:value-of select="s2" />
271
 
                    <xsl:text> </xsl:text>
272
 
                </b>
273
 
            </xsl:if>
274
 
            <xsl:if test="s3">
275
 
                S3:
276
 
                <b>
277
 
                    <xsl:value-of select="s3" />
278
 
                    <xsl:text> </xsl:text>
279
 
                </b>
280
 
            </xsl:if>
281
 
            <xsl:if test="s4">
282
 
                S4:
283
 
                <b>
284
 
                    <xsl:value-of select="s4" />
285
 
                    <xsl:text> </xsl:text>
286
 
                </b>
287
 
            </xsl:if>
288
 
            <xsl:if test="d1">
289
 
                D1:
290
 
                <b>
291
 
                    <xsl:value-of select="d1" />
292
 
                    <xsl:text> </xsl:text>
293
 
                </b>
294
 
            </xsl:if>
295
 
            <xsl:if test="d2">
296
 
                D2:
297
 
                <b>
298
 
                    <xsl:value-of select="d2" />
299
 
                    <xsl:text> </xsl:text>
300
 
                </b>
301
 
            </xsl:if>
302
 
        </div>
303
 
    </xsl:if>
304
 
    <xsl:if test="fug1 or fug2 or fug3 or fug4 or fug5">
305
 
        <div style="background-color:#ffcc99">
306
 
            <xsl:if test="fug1">
307
 
                FUG1:
308
 
                <b><xsl:value-of select="fug1" />kV </b>
309
 
            </xsl:if>
310
 
            <xsl:if test="fug2">
311
 
                FUG2:
312
 
                <b><xsl:value-of select="fug2" />kV </b>
313
 
            </xsl:if>
314
 
            <xsl:if test="fug3">
315
 
                FUG3:
316
 
                <b><xsl:value-of select="fug3" />kV </b>
317
 
            </xsl:if>
318
 
            <xsl:if test="fug4">
319
 
                FUG4:
320
 
                <b><xsl:value-of select="fug4" />kV </b>
321
 
            </xsl:if>
322
 
            <xsl:if test="fug5">
323
 
                FUG5:
324
 
                <b><xsl:value-of select="fug5" />kV </b>
325
 
            </xsl:if>
326
 
        </div>
327
 
    </xsl:if>
328
 
    <xsl:if test="pressure">
329
 
        <div style="background-color:#ffcc99">
330
 
            Pressure:
331
 
            <b><xsl:value-of select="pressure" />mbar </b>
332
 
        </div>
333
 
    </xsl:if>
334
 
    <xsl:if test="egun_uv or egun_shutter or egun_hv or egun_x or egun_y">
335
 
        <div style="background-color:#99ccff">
336
 
            <xsl:if test="egun_uv">
337
 
                UV light:
338
 
                <b>
339
 
                    <xsl:value-of select="egun_uv" />
340
 
                    <xsl:text> </xsl:text>
341
 
                </b>
342
 
            </xsl:if>
343
 
            <xsl:if test="egun_shutter">
344
 
                Shutter:
345
 
                <b>
346
 
                    <xsl:value-of select="egun_shutter" />
347
 
                    <xsl:text> </xsl:text>
348
 
                </b>
349
 
            </xsl:if>
350
 
            <xsl:if test="egun_hv">
351
 
                Voltage:
352
 
                <b><xsl:value-of select="egun_hv" />kV </b>
353
 
            </xsl:if>
354
 
            <xsl:if test="egun_x">
355
 
                X:
356
 
                <b><xsl:value-of select="egun_x" />° </b>
357
 
            </xsl:if>
358
 
            <xsl:if test="egun_y">
359
 
                Y:
360
 
                <b><xsl:value-of select="egun_y" />° </b>
361
 
            </xsl:if>
362
 
        </div>
363
 
    </xsl:if>
364
 
</xsl:template>
365
 
 
366
 
<xsl:template match="transmission">
367
 
    <div>
368
 
        <h4>
369
 
            <xsl:text>Transmission (</xsl:text>
370
 
            <xsl:value-of select="@parameter" />
371
 
            <xsl:text>):</xsl:text>
372
 
        </h4>
373
 
        <xsl:apply-templates select="image" mode="large" />
374
 
    </div>
375
 
</xsl:template>
376
 
 
377
 
<xsl:template match="parameter">
378
 
    <div>
379
 
        <h4>
380
 
            <xsl:text>Control parameter (</xsl:text>
381
 
            <xsl:value-of select="@parameter" />
382
 
            <xsl:text>):</xsl:text>
383
 
        </h4>
384
 
        <xsl:apply-templates select="image" mode="normal" />
385
 
    </div>
386
 
</xsl:template>
387
 
 
388
 
<xsl:template match="countrate">
389
 
    <div>
390
 
        <h4>Eventrate:</h4>
391
 
        <xsl:apply-templates select="image" mode="normal" />
392
 
    </div>
393
 
</xsl:template>
394
 
 
395
 
<xsl:template match="run">
396
 
    
397
 
    <table>
398
 
        <tr>
399
 
            <td>
400
 
                <h2>Run <xsl:value-of select="identifier" /></h2>
401
 
            </td>
402
 
            <td>
403
 
                <a href="javascript:katrin.SetCustomProperties('kdb_run=')">
404
 
                    Back to run overview
405
 
                </a>
406
 
            </td>
407
 
        </tr>
408
 
        <tr>
409
 
            <td colspan="2" style="padding: 0 10px">
410
 
                <xsl:apply-templates select="streams" />
411
 
            </td>
412
 
        </tr>
413
 
        <tr>
414
 
            <td rowspan="2" style="width:600px; padding: 0 10px 0 0">
415
 
                <xsl:apply-templates select="plots/transmission" />
416
 
                <div class="properties">
417
 
                    <div style="background-color:silver">
418
 
                        Date:
419
 
                        <b>
420
 
                            <xsl:value-of select="date" />
421
 
                            <xsl:text> </xsl:text>
422
 
                        </b>
423
 
                        Timestamp:
424
 
                        <b><xsl:value-of select="start" /> - <xsl:value-of select="end" /></b>
425
 
                    </div>
426
 
                    <div style="background-color:#ffff99">
427
 
                        Detector:
428
 
                        <b>
429
 
                            <xsl:value-of select="detector" />
430
 
                            <xsl:text> </xsl:text>
431
 
                        </b>
432
 
                        X:
433
 
                        <b><xsl:value-of select="detector_x" />cm </b>
434
 
                        Y:
435
 
                        <b><xsl:value-of select="detector_y" />cm </b>
436
 
                        Z:
437
 
                        <b><xsl:value-of select="detector_z" />cm </b>
438
 
                    </div>
439
 
                    <div style="background-color:#ffff99">
440
 
                        Configuration:
441
 
                        <b>
442
 
                            <xsl:value-of select="configuration" />
443
 
                            <xsl:text> </xsl:text>
444
 
                        </b>
445
 
                        ORCA version:
446
 
                        <b><xsl:value-of select="orca_version" /> </b>
447
 
                    </div>
448
 
                    <xsl:apply-templates select="parameters" />
449
 
                    <div style="background-color:black; color:white">
450
 
                        Comment:
451
 
                    </div>
452
 
                    <div style="background-color:black; color:white">
453
 
                        <b><xsl:value-of select="comment" /></b>
454
 
                    </div>
455
 
                </div>
456
 
            </td>
457
 
            <td>
458
 
                <xsl:apply-templates select="plots/countrate" />
459
 
                <xsl:apply-templates select="plots/parameter" />
460
 
                <xsl:apply-templates select="downloads" />
461
 
            </td>
462
 
        </tr>
463
 
        <tr>
464
 
            <td style="vertical-align:bottom">
465
 
                <div>
466
 
                    <xsl:if test="../subruns">
467
 
                        <a href="javascript:katrin.SetCustomProperties('kdb_subruns=0')">
468
 
                            Hide subruns
469
 
                        </a>
470
 
                    </xsl:if>
471
 
                    <xsl:if test="not(../subruns)">
472
 
                        <a href="javascript:katrin.SetCustomProperties('kdb_subruns=1')">
473
 
                            Show subruns
474
 
                        </a>
475
 
                    </xsl:if>
476
 
                </div>
477
 
            </td>
478
 
        </tr>
479
 
    </table>
480
 
</xsl:template>
481
 
 
482
 
<xsl:template match="subruns">
483
 
    <div>
484
 
        <xsl:apply-templates select="subrun" />
485
 
    </div>
486
 
</xsl:template>
487
 
 
488
 
<xsl:template match="subrun">
489
 
    <div style="margin: 20px 0">
490
 
        <h4>Subrun <xsl:value-of select="identifier" /></h4>
491
 
        <div class="properties" style="width:600px">
492
 
            <div style="background-color:silver">
493
 
                Timestamp:
494
 
                <b><xsl:value-of select="start" /> - <xsl:value-of select="end" /></b>
495
 
            </div>
496
 
            <xsl:apply-templates select="parameters" />
497
 
            <div style="background-color:black; color:white">
498
 
                Comment:
499
 
            </div>
500
 
            <div style="background-color:black; color:white">
501
 
                <b><xsl:value-of select="comment" /></b>
502
 
            </div>
503
 
        </div>
504
 
        <xsl:apply-templates select="plots" />
505
 
    </div>
506
 
</xsl:template>
507
 
 
508
38
<!-- Helper template for page links in last runs view -->
509
39
<xsl:template name="page_link">
510
40
    <xsl:param name="page" />
569
99
    </xsl:if>
570
100
</xsl:template>
571
101
 
 
102
<xsl:template match="status">
 
103
    <xsl:variable name="color">
 
104
        <xsl:choose>
 
105
            <xsl:when test=". = 'Ok'">
 
106
                <xsl:text>#008000</xsl:text>
 
107
            </xsl:when>
 
108
            <xsl:when test=". = 'Error'">
 
109
                <xsl:text>#800000</xsl:text>
 
110
            </xsl:when>
 
111
            <xsl:otherwise>
 
112
                <xsl:text>#000000</xsl:text>
 
113
            </xsl:otherwise>
 
114
        </xsl:choose>
 
115
    </xsl:variable>
 
116
 
 
117
    <xsl:element name="span">
 
118
        <xsl:attribute name="style">
 
119
            <xsl:text>font-weight: bold; color: </xsl:text>
 
120
            <xsl:value-of select="$color" />
 
121
        </xsl:attribute>
 
122
        <xsl:value-of select="." />
 
123
    </xsl:element>
 
124
</xsl:template>
 
125
 
572
126
<!-- Template for runs list in last runs view -->
573
127
<xsl:template match="runs">
574
 
    <script type="text/javascript">
575
 
        filter.SetParameters(htmlEntityDecode('<xsl:value-of select="@parameters"/>'));
576
 
    </script>
577
 
    <div style="padding:25px">
578
 
        <table width="100%">
579
 
            <tr>
580
 
                <td style="text-align:left">
581
 
                    <xsl:call-template name="navigation" />
582
 
                </td>
583
 
                <td style="text-align:right">
584
 
                    <xsl:if test="string-length(@filter) > 0">
585
 
                        <a href="javascript:adei.OpenControl('filter')">
586
 
                            <xsl:text>Filter</xsl:text>
587
 
                        </a>
588
 
                        <xsl:text>: </xsl:text>
589
 
                        <span class="search">
590
 
                            <xsl:value-of select="@filter" />
591
 
                        </span>
592
 
                    </xsl:if>
593
 
                    <br />
594
 
                    <xsl:if test="string-length(@search) > 0">
595
 
                        <xsl:text>Search: "</xsl:text>
596
 
                        <span class="search">
597
 
                            <xsl:value-of select="@search" />
598
 
                        </span>
599
 
                        <xsl:text>" (</xsl:text>
600
 
                        <a href="javascript:katrin.SetCustomProperties('kdb_search=&amp;kdb_date=')">
601
 
                            <xsl:text>Clear</xsl:text>
602
 
                        </a>
603
 
                        <xsl:text>)</xsl:text>
604
 
                    </xsl:if>
605
 
                </td>
 
128
    <table width="100%">
 
129
        <tr>
 
130
            <td style="text-align:left">
 
131
                <xsl:call-template name="navigation" />
 
132
            </td>
 
133
            <td style="text-align:right">
 
134
                <xsl:if test="string-length(@filter) > 0">
 
135
                    <a href="javascript:adei.OpenControl('filter')">
 
136
                        <xsl:text>Filter</xsl:text>
 
137
                    </a>
 
138
                    <xsl:text>: </xsl:text>
 
139
                    <span class="search">
 
140
                        <xsl:value-of select="@filter" />
 
141
                    </span>
 
142
                    <br />
 
143
                </xsl:if>
 
144
                <xsl:if test="string-length(@search) > 0">
 
145
                    <xsl:text>Search: "</xsl:text>
 
146
                    <span class="search">
 
147
                        <xsl:value-of select="@search" />
 
148
                    </span>
 
149
                    <xsl:text>" (</xsl:text>
 
150
                    <a href="javascript:katrin.SetCustomProperties('kdb_search=&amp;kdb_parameters=&amp;kdb_date=')">
 
151
                        <xsl:text>Clear</xsl:text>
 
152
                    </a>
 
153
                    <xsl:text>)</xsl:text>
 
154
                    <br />
 
155
                </xsl:if>
 
156
                <xsl:if test="string-length(@window) > 0">
 
157
                    <xsl:text>Selected time window (</xsl:text>
 
158
                    <a href="javascript:katrin.SetCustomProperties('kdb_window=&amp;kdb_date=')">
 
159
                        <xsl:text>Clear</xsl:text>
 
160
                    </a>
 
161
                    <xsl:text>)</xsl:text>
 
162
                </xsl:if>
 
163
            </td>
 
164
        </tr>
 
165
    </table>
 
166
    <xsl:if test="count(run) > 0">
 
167
        <table class="border" border="1" cellspacing="0" cellpadding="5" width="100%">
 
168
            <tr class="border">
 
169
                <th class="border overview">Identifier</th>
 
170
                <th class="border overview">Start (UTC)</th>
 
171
                <th class="border overview">Duration</th>
 
172
                <th class="border overview">Subruns</th>
 
173
                <th class="border overview">Data</th>
 
174
                <th class="border overview">Status</th>
 
175
                <th class="border" style="width:100%">Comment</th>
606
176
            </tr>
607
 
        </table>
608
 
        <xsl:if test="count(run) > 0">
609
 
            <table style="border:1px solid black; border-collapse: collapse; font-size: small" border="1" cellspacing="0" cellpadding="5" width="100%">
610
 
                <tr style="background-color:silver">
611
 
                    <th class="overview">Identifier</th>
612
 
                    <th class="overview">Start (UTC)</th>
613
 
                    <th class="overview">Duration</th>
614
 
                    <th class="overview">Subruns</th>
615
 
                    <th class="overview">Data</th>
616
 
                    <th>Comment</th>
 
177
            <xsl:for-each select="run">
 
178
                <tr>
 
179
                    <td class="border overview">
 
180
                        <xsl:element name="a">
 
181
                            <xsl:attribute name="href">
 
182
                                <xsl:text>javascript:katrin.SetCustomProperties('kdb_run=</xsl:text>
 
183
                                <xsl:value-of select="identifier" />
 
184
                                <xsl:text>&amp;kdb_subruns=')</xsl:text>
 
185
                            </xsl:attribute>
 
186
                            <xsl:value-of select="identifier" />
 
187
                        </xsl:element>
 
188
                    </td>
 
189
                    <td class="border overview date">
 
190
                        <xsl:value-of select="start" />
 
191
                    </td>
 
192
                    <td class="border overview">
 
193
                        <xsl:value-of select="duration" />
 
194
                    </td>
 
195
                    <td class="border overview">
 
196
                        <xsl:value-of select="subruns" />
 
197
                    </td>
 
198
                    <td class="border overview">
 
199
                        <xsl:apply-templates select="streams" />
 
200
                    </td>
 
201
                    <td class="border overview">
 
202
                        <xsl:apply-templates select="status" />
 
203
                    </td>
 
204
                    <td class="border overview" style="text-align: left">
 
205
                        <xsl:value-of select="comment" />
 
206
                    </td>
617
207
                </tr>
618
 
                <xsl:for-each select="run">
619
 
                    <tr>
620
 
                        <td class="overview">
621
 
                            <xsl:element name="a">
622
 
                                <xsl:attribute name="href">
623
 
                                    <xsl:text>javascript:katrin.SetCustomProperties('kdb_run=</xsl:text>
624
 
                                    <xsl:value-of select="identifier" />
625
 
                                    <xsl:text>&amp;kdb_subruns=0')</xsl:text>
626
 
                                </xsl:attribute>
627
 
                                <xsl:value-of select="identifier" />
628
 
                            </xsl:element>
629
 
                        </td>
630
 
                        <td class="overview date">
631
 
                            <xsl:value-of select="start" />
632
 
                        </td>
633
 
                        <td class="overview">
634
 
                            <xsl:value-of select="duration" />
635
 
                        </td>
636
 
                        <td class="overview">
637
 
                            <xsl:value-of select="subruns" />
638
 
                        </td>
639
 
                        <td class="overview">
640
 
                            <xsl:apply-templates select="streams" />
641
 
                        </td>
642
 
                        <td class="overview" style="text-align: left">
643
 
                            <xsl:value-of select="comment" />
644
 
                        </td>
 
208
            </xsl:for-each>
 
209
        </table>
 
210
    </xsl:if>
 
211
    <xsl:if test="count(run) = 0">
 
212
        <div>No runs found</div>
 
213
    </xsl:if>
 
214
    <table width="100%">
 
215
        <tr>
 
216
            <td style="text-align:left">
 
217
                <xsl:call-template name="navigation" />
 
218
            </td>
 
219
            <td style="text-align:right">
 
220
            </td>
 
221
        </tr>
 
222
    </table>
 
223
</xsl:template>
 
224
 
 
225
<xsl:template match="loading">
 
226
    <script type="text/javascript">
 
227
        adei.OpenControl('filter');
 
228
        filter.SetSearch('<xsl:value-of select="@search"/>', '<xsl:value-of select="@parameters"/>', '<xsl:value-of select="@window"/>');
 
229
    </script>
 
230
</xsl:template>
 
231
 
 
232
<xsl:template match="error">
 
233
    <h3>Invalid filter</h3>
 
234
    <p><xsl:value-of select="." /></p>
 
235
</xsl:template>
 
236
 
 
237
<xsl:template match="help">
 
238
    <script type="text/javascript">
 
239
        filter.FocusParameters();
 
240
    </script>
 
241
    <xsl:apply-templates select="error" />
 
242
    <h3>Filter Description</h3>
 
243
    <p>The run list can be filtered by defining a filter with predefined
 
244
        parameters.</p>
 
245
    <p>The general filter format is:</p>
 
246
    <p class="code">parameter OP value[, parameter OP value, ...]</p>
 
247
    <ul>
 
248
        <li>
 
249
            <span class="variable">OP</span> can be one of &lt;, &lt;=, =,
 
250
            &gt;= or &gt;
 
251
        </li>
 
252
        <li>
 
253
            <span class="variable">value</span> is a numeric value, scientific
 
254
            notation is allowed
 
255
        </li>
 
256
        <li>
 
257
            <span class="variable">parameter</span> is a predefined parameter
 
258
            name. Currently the following parameters are defined:
 
259
            <div style="padding=5px">
 
260
                <table class="border" border="1">
 
261
                    <tr class="border">
 
262
                        <th class="border">Parameter</th>
 
263
                        <th class="border">Description</th>
645
264
                    </tr>
646
 
                </xsl:for-each>
647
 
            </table>
648
 
        </xsl:if>
649
 
        <xsl:if test="count(run) = 0">
650
 
            <div>No runs found</div>
651
 
        </xsl:if>
652
 
        <table width="100%">
653
 
            <tr>
654
 
                <td style="text-align:left">
655
 
                    <xsl:call-template name="navigation" />
656
 
                </td>
657
 
                <td style="text-align:right">
658
 
                </td>
659
 
            </tr>
660
 
        </table>
661
 
    </div>
662
 
</xsl:template>
663
 
 
664
 
<xsl:template match="loading">
665
 
    <script type="text/javascript">
666
 
        filter.SetSearch(htmlEntityDecode('<xsl:value-of select="@search"/>'));
667
 
    </script>
 
265
                    <xsl:for-each select="parameter">
 
266
                        <tr class="border">
 
267
                            <td class="border">
 
268
                                <xsl:value-of select="name" />
 
269
                            </td>
 
270
                            <td class="border">
 
271
                                <xsl:value-of select="description" />
 
272
                            </td>
 
273
                        </tr>
 
274
                    </xsl:for-each>
 
275
                </table>
 
276
            </div>
 
277
        </li>
 
278
    </ul>
 
279
    <p>If more than one filter is specified they are combined using an AND
 
280
    operation.</p>
668
281
</xsl:template>
669
282
 
670
283
<xsl:template match="/result">
671
 
    <div style="margin-left: 20px">
 
284
    <div style="margin: 10px">
672
285
        <xsl:choose>
673
286
            <xsl:when test="Error">
674
287
                <h2>Error</h2>
680
293
            <xsl:when test="loading">
681
294
                <xsl:apply-templates select="loading" />
682
295
            </xsl:when>
683
 
            <xsl:otherwise>
684
 
                <xsl:apply-templates select="run" />
685
 
                <xsl:apply-templates select="subruns" />
686
 
            </xsl:otherwise>
 
296
            <xsl:when test="help">
 
297
                <xsl:apply-templates select="help" />
 
298
            </xsl:when>
687
299
        </xsl:choose>
688
300
    </div>
689
301
</xsl:template>