/dev/adei-asec

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/adei-asec

« back to all changes in this revision

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

  • Committer: Suren A. Chilingaryan
  • Date: 2010-08-13 14:18:27 UTC
  • Revision ID: csa@dside.dyndns.org-20100813141827-u3o97425ppvd5g7y
Revert back to SetConfiguration from SetCustomProperties while handling certain property in search; trully support HTML content in description field within search results; support execution in XMLModule; support for setup-specific javascript code; KATRIN update

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
    <xsl:variable name="link">
14
14
        <xsl:text>services/katrin.php?target=file&amp;</xsl:text>
15
 
        <xsl:if test="@run">run=<xsl:value-of select="@run" />&amp;</xsl:if>
16
 
        <xsl:if test="@hardware">hardware=<xsl:value-of select="@hardware" />&amp;</xsl:if>
 
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
17
        <xsl:text>name=</xsl:text><xsl:value-of select="@name" /><xsl:text>&amp;</xsl:text>
18
18
    </xsl:variable>
19
19
 
79
79
        <xsl:element name="a">
80
80
            <xsl:attribute name="href">
81
81
                <xsl:text>services/katrin.php?target=file</xsl:text>
82
 
                <xsl:text>&amp;download=yes</xsl:text>
 
82
                <xsl:text>&amp;kdb_download=yes</xsl:text>
83
83
                <xsl:if test="@run">
84
 
                    <xsl:text>&amp;run=</xsl:text>
 
84
                    <xsl:text>&amp;kdb_run=</xsl:text>
85
85
                    <xsl:value-of select="@run" />
86
86
                </xsl:if>
87
87
                <xsl:if test="@type">
88
 
                    <xsl:text>&amp;type=</xsl:text>
 
88
                    <xsl:text>&amp;kdb_type=</xsl:text>
89
89
                    <xsl:value-of select="@type" />
90
90
                </xsl:if>
91
91
                <xsl:if test="@filename">
92
 
                    <xsl:text>&amp;name=</xsl:text>
 
92
                    <xsl:text>&amp;kdb_name=</xsl:text>
93
93
                    <xsl:value-of select="@name" />
94
94
                </xsl:if>
95
95
                <xsl:if test="@hardware">
96
 
                    <xsl:text>&amp;hardware=</xsl:text>
 
96
                    <xsl:text>&amp;kdb_hardware=</xsl:text>
97
97
                    <xsl:value-of select="@hardware" />
98
98
                </xsl:if>
99
99
            </xsl:attribute>
100
100
            <xsl:value-of select="." />
101
101
        </xsl:element>
102
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>
 
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
108
        </xsl:if>
109
109
    </p>
110
110
</xsl:template>
393
393
</xsl:template>
394
394
 
395
395
<xsl:template match="run">
396
 
    <h2>Run <xsl:value-of select="identifier" /></h2>
397
 
    <div style="padding: 0 10px"><xsl:apply-templates select="streams" /></div>
 
396
    
398
397
    <table>
399
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>
400
414
            <td rowspan="2" style="width:600px; padding: 0 10px 0 0">
401
415
                <xsl:apply-templates select="plots/transmission" />
402
416
                <div class="properties">
449
463
        <tr>
450
464
            <td style="vertical-align:bottom">
451
465
                <div>
452
 
                    <a href="javascript:katrin.SetCustomProperties('run=xxx0')">
453
 
                        Go back to run overview
454
 
                    </a>
455
 
                </div>
456
 
                <div>
457
466
                    <xsl:if test="../subruns">
458
 
                        <a href="javascript:katrin.SetCustomProperties('subruns=0')">
 
467
                        <a href="javascript:katrin.SetCustomProperties('kdb_subruns=0')">
459
468
                            Hide subruns
460
469
                        </a>
461
470
                    </xsl:if>
462
471
                    <xsl:if test="not(../subruns)">
463
 
                        <a href="javascript:katrin.SetCustomProperties('subruns=1')">
 
472
                        <a href="javascript:katrin.SetCustomProperties('kdb_subruns=1')">
464
473
                            Show subruns
465
474
                        </a>
466
475
                    </xsl:if>
513
522
    <xsl:if test="not($page=$current)">
514
523
        <xsl:element name="a">
515
524
            <xsl:attribute name="href">
516
 
                <xsl:text>javascript:katrin.SetCustomProperties('page=</xsl:text>
 
525
                <xsl:text>javascript:katrin.SetCustomProperties('kdb_page=</xsl:text>
517
526
                <xsl:value-of select="$page" />
518
527
                <xsl:text>')</xsl:text>
519
528
            </xsl:attribute>
522
531
    </xsl:if>
523
532
</xsl:template>
524
533
 
 
534
<xsl:template name="navigation">
 
535
    <xsl:text>Page: </xsl:text>
 
536
    <xsl:call-template name="page_link">
 
537
        <xsl:with-param name="page" select="1" />
 
538
        <xsl:with-param name="current" select="@page" />
 
539
    </xsl:call-template>
 
540
    <xsl:if test="number(@page)&gt;3">
 
541
        <xsl:text> ... </xsl:text>
 
542
    </xsl:if>
 
543
    <xsl:if test="number(@page)&gt;2">
 
544
        <xsl:call-template name="page_link">
 
545
            <xsl:with-param name="page" select="number(@page)-1" />
 
546
            <xsl:with-param name="current" select="@page" />
 
547
        </xsl:call-template>
 
548
    </xsl:if>
 
549
    <xsl:if test="number(@page)&gt;1">
 
550
        <xsl:call-template name="page_link">
 
551
            <xsl:with-param name="page" select="@page" />
 
552
            <xsl:with-param name="current" select="@page" />
 
553
        </xsl:call-template>
 
554
    </xsl:if>
 
555
    <xsl:if test="number(@page)&lt;number(@pages)">
 
556
        <xsl:call-template name="page_link">
 
557
            <xsl:with-param name="page" select="number(@page)+1" />
 
558
            <xsl:with-param name="current" select="@page" />
 
559
        </xsl:call-template>
 
560
    </xsl:if>
 
561
    <xsl:if test="number(@page)&lt;number(@pages)-2">
 
562
        <xsl:text> ... </xsl:text>
 
563
    </xsl:if>
 
564
    <xsl:if test="number(@page)&lt;number(@pages)-1">
 
565
        <xsl:call-template name="page_link">
 
566
            <xsl:with-param name="page" select="@pages" />
 
567
            <xsl:with-param name="current" select="@page" />
 
568
        </xsl:call-template>
 
569
    </xsl:if>
 
570
</xsl:template>
 
571
 
525
572
<!-- Template for runs list in last runs view -->
526
573
<xsl:template match="runs">
 
574
    <script type="text/javascript">
 
575
        filter.SetParameters(htmlEntityDecode('<xsl:value-of select="@parameters"/>'));
 
576
    </script>
527
577
    <div style="padding:25px">
528
 
        <form name="form" onsubmit="return false">
529
 
            <table width="100%">
530
 
                <tr>
531
 
                    <td style="text-align:left">
532
 
                        <xsl:text>Page: </xsl:text>
533
 
                        <xsl:call-template name="page_link">
534
 
                            <xsl:with-param name="page" select="1" />
535
 
                            <xsl:with-param name="current" select="@page" />
536
 
                        </xsl:call-template>
537
 
                        <xsl:if test="number(@page)&gt;3">
538
 
                            <xsl:text> ... </xsl:text>
539
 
                        </xsl:if>
540
 
                        <xsl:if test="number(@page)&gt;2">
541
 
                            <xsl:call-template name="page_link">
542
 
                                <xsl:with-param name="page" select="number(@page)-1" />
543
 
                                <xsl:with-param name="current" select="@page" />
544
 
                            </xsl:call-template>
545
 
                        </xsl:if>
546
 
                        <xsl:if test="number(@page)&gt;1">
547
 
                            <xsl:call-template name="page_link">
548
 
                                <xsl:with-param name="page" select="@page" />
549
 
                                <xsl:with-param name="current" select="@page" />
550
 
                            </xsl:call-template>
551
 
                        </xsl:if>
552
 
                        <xsl:if test="number(@page)&lt;number(@pages)">
553
 
                            <xsl:call-template name="page_link">
554
 
                                <xsl:with-param name="page" select="number(@page)+1" />
555
 
                                <xsl:with-param name="current" select="@page" />
556
 
                            </xsl:call-template>
557
 
                        </xsl:if>
558
 
                        <xsl:if test="number(@page)&lt;number(@pages)-2">
559
 
                            <xsl:text> ... </xsl:text>
560
 
                        </xsl:if>
561
 
                        <xsl:if test="number(@page)&lt;number(@pages)-1">
562
 
                            <xsl:call-template name="page_link">
563
 
                                <xsl:with-param name="page" select="@pages" />
564
 
                                <xsl:with-param name="current" select="@page" />
565
 
                            </xsl:call-template>
566
 
                        </xsl:if>
567
 
                    </td>
568
 
                    <td style="text-align:right">
569
 
                        <span>Filter:</span>
570
 
                        <xsl:element name="input">
571
 
                            <xsl:attribute name="name">filter</xsl:attribute>
572
 
                            <xsl:attribute name="type">text</xsl:attribute>
573
 
                            <xsl:attribute name="size">60</xsl:attribute>
574
 
                            <xsl:if test="@filter">
575
 
                                <xsl:attribute name="value">
576
 
                                    <xsl:value-of select="@filter" />
 
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>
 
606
            </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>
 
617
                </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>
577
626
                                </xsl:attribute>
578
 
                            </xsl:if>
579
 
                        </xsl:element>
580
 
                        <input type="submit" value="Apply" onclick="katrin.SetCustomProperties('filter=' + encodeURIComponent(document.form.filter.value))" />
581
 
                    </td>
582
 
                </tr>
 
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>
 
645
                    </tr>
 
646
                </xsl:for-each>
583
647
            </table>
584
 
        </form>
585
 
        <table style="border:1px solid black; border-collapse: collapse; font-size: small" border="1" cellspacing="0" cellpadding="5" width="100%">
586
 
            <tr style="background-color:silver">
587
 
                <th class="overview">Identifier</th>
588
 
                <th class="overview">Start (UTC)</th>
589
 
                <th class="overview">Duration</th>
590
 
                <th class="overview">Subruns</th>
591
 
                <th class="overview">Data</th>
592
 
                <th>Comment</th>
 
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>
593
659
            </tr>
594
 
            <xsl:for-each select="run">
595
 
                <tr>
596
 
                    <td class="overview">
597
 
                        <xsl:element name="a">
598
 
                            <xsl:attribute name="href">
599
 
                                <xsl:text>javascript:katrin.SetCustomProperties('run=</xsl:text>
600
 
                                <xsl:value-of select="identifier" />
601
 
                                <xsl:text>&amp;subruns=0')</xsl:text>
602
 
                            </xsl:attribute>
603
 
                            <xsl:value-of select="identifier" />
604
 
                        </xsl:element>
605
 
                    </td>
606
 
                    <td class="overview date">
607
 
                        <xsl:value-of select="start" />
608
 
                    </td>
609
 
                    <td class="overview">
610
 
                        <xsl:value-of select="duration" />
611
 
                    </td>
612
 
                    <td class="overview">
613
 
                        <xsl:value-of select="subruns" />
614
 
                    </td>
615
 
                    <td class="overview">
616
 
                        <xsl:apply-templates select="streams" />
617
 
                    </td>
618
 
                    <td class="overview" style="text-align: left">
619
 
                        <xsl:value-of select="comment" />
620
 
                    </td>
621
 
                </tr>
622
 
            </xsl:for-each>
623
660
        </table>
624
661
    </div>
625
662
</xsl:template>
626
663
 
 
664
<xsl:template match="loading">
 
665
    <script type="text/javascript">
 
666
        filter.SetSearch(htmlEntityDecode('<xsl:value-of select="@search"/>'));
 
667
    </script>
 
668
</xsl:template>
 
669
 
627
670
<xsl:template match="/result">
628
671
    <div style="margin-left: 20px">
629
672
        <xsl:choose>
634
677
            <xsl:when test="runs">
635
678
                <xsl:apply-templates select="runs" />
636
679
            </xsl:when>
 
680
            <xsl:when test="loading">
 
681
                <xsl:apply-templates select="loading" />
 
682
            </xsl:when>
637
683
            <xsl:otherwise>
638
684
                <xsl:apply-templates select="run" />
639
685
                <xsl:apply-templates select="subruns" />