~ubuntu-branches/ubuntu/oneiric/checkbox/oneiric-updates

« back to all changes in this revision

Viewing changes to report/checkbox.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Marc Tardif
  • Date: 2010-08-13 16:23:16 UTC
  • Revision ID: james.westby@ubuntu.com-20100813162316-vuvxkco2tc8kxfgp
Tags: 0.10.2
New upstream release (LP: #617583):
* Fixed sleep_test to check the connection if using network-manager.
* Fixed reporting bugs against alsa-base and xorg (LP: #607214)
* Fixed apport dialog no longer appearing (LP: #607217)
* Reduced data file size for the desktop image.
* Updated report to be more pretty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0"?>
 
2
 
2
3
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4
<xsl:template match="/">
4
5
    <html>
5
6
    <head>
6
 
        <title>Checkbox Report</title>
7
 
        <link rel="stylesheet" type="text/css" href="file:///usr/share/checkbox/report/checkbox.css" media="all" />
 
7
        <title>System Testing Report</title>
 
8
        <link rel="stylesheet" type="text/css" href="%(CHECKBOX_SHARE)s/report/styles.css" />
 
9
        <script type="text/javascript" src="%(CHECKBOX_SHARE)s/report/checkbox.js">
 
10
        </script>
8
11
    </head>
9
12
    <body>
10
 
    <h1>Checkbox Report</h1>
11
 
    <h2 id="toc">Table Of Contents</h2>
12
 
    <ol>
13
 
        <li><a href="#summary">Summary</a></li>
14
 
        <li>Hardware
15
 
        <ul>
16
 
            <li><a href="#udev">udev</a></li>
17
 
            <li><a href="#dmi">dmi</a></li>
18
 
            <li><a href="#sysfs-attributes">sysfs-attributes</a></li>
19
 
            <li><a href="#processors">Processors</a></li>
20
 
        </ul></li>
21
 
        <li>Software
22
 
        <ul>
23
 
            <li><a href="#packages">Packages</a></li>
24
 
            <li><a href="#lsbrelease">LSB</a></li>
25
 
        </ul></li>
26
 
        <li><a href="#questions">Questions</a></li>
27
 
        <li><a href="#context">Contextual Information</a></li>
28
 
        <xsl:apply-templates select=".//context" mode="navigation" />
29
 
     </ol>
30
 
    <xsl:apply-templates select=".//summary" />
31
 
    <xsl:apply-templates select=".//hardware/udev" />
32
 
    <xsl:apply-templates select=".//hardware/dmi" />
33
 
    <xsl:apply-templates select=".//hardware/sysfs-attributes" />
34
 
    <xsl:apply-templates select=".//hardware/processors" />
35
 
    <xsl:apply-templates select=".//hardware/lspci" />
36
 
    <xsl:apply-templates select=".//software/packages" />
37
 
    <xsl:apply-templates select=".//software/lsbrelease" />
38
 
    <xsl:apply-templates select=".//questions" />
39
 
    <xsl:apply-templates select=".//context" />
 
13
        <!-- Quick and dirty preload to have disclosure triangle images cached -->
 
14
        <img src="%(CHECKBOX_SHARE)s/report/images/open.png" style="display: none;" /><img src="%(CHECKBOX_SHARE)s/report/images/closed.png" style="display: none;" />
 
15
        <div id="container">
 
16
            <div id="container-inner">
 
17
 
 
18
                <div id="title">
 
19
                    <h1>System Testing<span class="grey"> Report</span></h1>
 
20
                </div>
 
21
                <div id="content" class="clearfix">
 
22
                    <h2>Hardware Information</h2>
 
23
                    <xsl:apply-templates select=".//hardware/dmi" />
 
24
                    <xsl:apply-templates select=".//hardware/sysfs-attributes" />
 
25
                    <xsl:apply-templates select=".//hardware/processors" />
 
26
                    <xsl:apply-templates select=".//hardware/lspci" />
 
27
                </div>
 
28
                <div id="content" class="clearfix">
 
29
                    <h2>Software Information</h2>
 
30
                    <xsl:apply-templates select=".//software/packages" />
 
31
                    <xsl:apply-templates select=".//software/lsbrelease" />
 
32
                </div>
 
33
                <div id="content" class="clearfix">
 
34
                    <h2>Tests Performed</h2>
 
35
                    <xsl:apply-templates select=".//questions" />
 
36
                </div>
 
37
                <div id="content" class="clearfix">
 
38
                    <h2>Log Files and Environment Information</h2>
 
39
                    <xsl:apply-templates select=".//context" />
 
40
                </div>
 
41
            </div>
 
42
        </div>
40
43
    </body>
41
44
    </html>
42
45
</xsl:template>
43
46
 
44
47
<xsl:template match="summary">
45
 
    <h2 id="summary">Summary</h2>
 
48
    <h3 id="summary">Summary</h3>
46
49
    <p>This report was created using <xsl:value-of select="client/@name" /> <xsl:text> </xsl:text><xsl:value-of select="client/@version" /> on <xsl:value-of select="date_created/@value" />, on <xsl:value-of select="distribution/@value" /><xsl:text> </xsl:text><xsl:value-of select="distroseries/@value" /> (<xsl:value-of select="architecture/@value" />).</p>
47
50
    <p>You can view other reports for this system <a href="https://launchpad.net/+hwdb/+fingerprint/{system_id/@value}">here</a>.</p>
48
51
</xsl:template>
49
52
 
50
53
<xsl:template match="hardware/udev">
51
 
    <h2 id="udev">udev</h2>
52
 
    <pre><xsl:value-of select="." /></pre>
 
54
    <div onClick="showHide('udev');">
 
55
        <h3 id="udev"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />Devices detected in the system (udev)</h3>
 
56
    </div>
 
57
    <div class="data" id="udev-contents">
 
58
        <pre><xsl:value-of select="." /></pre>
 
59
    </div>
53
60
</xsl:template>
54
61
 
55
62
<xsl:template match="hardware/dmi">
56
 
    <h2 id="dmi">dmi</h2>
57
 
    <pre><xsl:value-of select="." /></pre>
 
63
    <span onClick="showHide('dmi');"><h3 id="dmi"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />Desktop Management Interface information</h3></span>
 
64
    <div class="data" id="dmi-contents" style="overflow: auto;">
 
65
        <pre><xsl:value-of select="." /></pre>
 
66
    </div>
58
67
</xsl:template>
59
68
 
60
69
<xsl:template match="hardware/sysfs-attributes">
61
 
    <h2 id="sysfs-attributes">sysfs-attributes</h2>
62
 
    <pre><xsl:value-of select="." /></pre>
 
70
    <span onClick="showHide('sysfs-attributes');"><h3 id="sysfs-attributes"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />sysfs-attributes</h3></span>
 
71
    <div class="data" id="sysfs-attributes-contents">
 
72
        <pre><xsl:value-of select="." /></pre>
 
73
    </div>
63
74
</xsl:template>
64
75
 
65
76
<xsl:template match="hardware/processors">
66
 
    <h2 id="processors">Processors</h2>
 
77
    <span onClick="showHide('processors');"><h3 id="processors"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />Processors</h3></span>
 
78
    <div class="data" id="processors-contents">
67
79
    <xsl:for-each select="processor">
68
 
        <h3><xsl:value-of select='@name' /></h3>
 
80
        <h3><u>Processor <xsl:value-of select='@name' /></u></h3>
69
81
        <table>
70
82
            <tr>
71
83
                <th>Property</th>
78
90
            </tr>
79
91
        </xsl:for-each>
80
92
        </table>
 
93
        <br />
81
94
    </xsl:for-each>
82
 
    <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
 
95
    </div>
83
96
</xsl:template>
84
97
 
 
98
<xsl:template match="software/lsbrelease">
 
99
    <h3 id="lsbrelease">Installed version of Ubuntu</h3>
 
100
    <table>
 
101
        <xsl:for-each select="property">
 
102
            <tr>
 
103
                <td class="label"><xsl:value-of select="@name" /></td>
 
104
                <td><xsl:value-of select="." /></td>
 
105
            </tr>
 
106
        </xsl:for-each>
 
107
    </table>
 
108
</xsl:template>
85
109
<xsl:template match="software/packages">
86
 
    <h2 id="packages">Packages</h2>
 
110
    <span onClick="showHide('packages');"><h3 id="packages"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />Packages Installed</h3></span>
 
111
    <div class="data" id="packages-contents">
87
112
    <table>
88
113
        <tr>
89
114
            <th>Name</th>
90
 
            <th>Version</th>
 
115
            <th>Description</th>
91
116
        </tr>
92
117
        <xsl:for-each select="package">
93
118
            <tr>
96
121
            </tr>
97
122
        </xsl:for-each>
98
123
    </table>
99
 
    <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
 
124
    </div>
100
125
</xsl:template>
101
126
 
102
 
<xsl:template match="software/lsbrelease">
103
 
    <h2 id="lsbrelease">LSB</h2>
104
 
    <table>
105
 
        <xsl:for-each select="property">
106
 
            <tr>
107
 
                <td class="label"><xsl:value-of select="@name" /></td>
108
 
                <td><xsl:value-of select="." /></td>
109
 
            </tr>
110
 
        </xsl:for-each>
111
 
    </table>
112
 
    <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
113
 
</xsl:template>
114
127
 
115
128
<xsl:template match="questions">
116
 
    <h2 id="questions">Questions</h2>
117
 
        <table>
 
129
    <h3 id="questions">Tests</h3>
 
130
        <table style="width: 700px">
118
131
        <tr>
 
132
            <th> </th>
119
133
            <th>Name</th>
120
 
            <th>Answer</th>
 
134
            <th style="width: 15em;">Result</th>
121
135
            <th>Comment</th>
122
136
        </tr>
123
137
        <xsl:for-each select="question">
124
138
            <tr>
125
 
                <td class="label"><xsl:value-of select="@name" /></td>
126
 
                <td><xsl:value-of select="answer" /></td>
127
 
                <td><xsl:value-of select="comment" /></td>
 
139
                <xsl:choose>
 
140
                    <xsl:when test="normalize-space(answer) = 'fail'">
 
141
                        <td><img class='resultimg' src='%(CHECKBOX_SHARE)s/report/images/fail.png' /></td>
 
142
                        <td class="label"><xsl:value-of select="@name" /></td>
 
143
                        <td style='background-color: #f00'>FAILED</td>
 
144
                        <td><xsl:value-of select="comment" /></td>
 
145
                    </xsl:when>
 
146
                    <xsl:when test="normalize-space(answer) = 'pass'">
 
147
                        <td><img class='resultimg' src='%(CHECKBOX_SHARE)s/report/images/pass.png' /></td>
 
148
                        <td class="label"><xsl:value-of select="@name" /></td>
 
149
                        <td style='background-color: #0f0'>PASSED</td>
 
150
                        <td><xsl:value-of select="comment" /></td>
 
151
                    </xsl:when>
 
152
                    <xsl:when test="normalize-space(answer) = 'unsupported'">
 
153
                        <td></td>
 
154
                        <td class="label"><xsl:value-of select="@name" /></td>
 
155
                        <td style='background-color: #888'>not required on this system</td>
 
156
                        <td><xsl:value-of select="comment" /></td>
 
157
                    </xsl:when>
 
158
                    <xsl:when test="normalize-space(answer) = 'untested'">
 
159
                        <td><img class='resultimg' src='%(CHECKBOX_SHARE)s/report/images/skip.png' /></td>
 
160
                        <td class="label"><xsl:value-of select="@name" /></td>
 
161
                        <td style='background-color: #888'>skipped</td>
 
162
                        <td><xsl:value-of select="comment" /></td>
 
163
                    </xsl:when>
 
164
                    <xsl:otherwise>
 
165
                        <td></td>
 
166
                        <td class="label"><xsl:value-of select="@name" /></td>
 
167
                        <td><xsl:value-of select="answer" /></td>
 
168
                        <td><xsl:value-of select="comment" /></td>
 
169
                    </xsl:otherwise>
 
170
                </xsl:choose>
128
171
            </tr>
129
172
        </xsl:for-each>
130
173
    </table>
131
 
    <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
132
 
</xsl:template>
133
 
 
134
 
<xsl:template match="context" mode="navigation">
135
 
    <ul>
136
 
    <xsl:for-each select="info">
137
 
        <li>
138
 
            <a href="#{generate-id(.)}"><xsl:value-of select="@command" /></a>
139
 
        </li>
140
 
    </xsl:for-each>
141
 
    </ul>
142
174
</xsl:template>
143
175
 
144
176
<xsl:template match="context">
145
 
    <h2 id="context">Contextual Information</h2>
 
177
    <div id="packages-contents">    
146
178
    <xsl:for-each select="info">
147
 
        <h3 id="{generate-id(.)}"><xsl:value-of select="@command" /></h3>
148
 
        <pre><xsl:value-of select="." /></pre>
149
 
        <p class="navigation"><a href="#toc">Back to Table of Contents</a></p>
 
179
        <span onClick="showHide('{generate-id(.)}');"><h3 id="{generate-id(.)}"><img class="disclosureimg" src="%(CHECKBOX_SHARE)s/report/images/closed.png" />
 
180
        <xsl:value-of select="@command" /></h3></span>
 
181
        <div class="data" id="{generate-id(.)}-contents" style="overflow: auto;">
 
182
                <pre><xsl:value-of select="." /></pre>
 
183
        </div>
150
184
    </xsl:for-each>
 
185
    </div>
151
186
</xsl:template>
152
187
 
153
188
</xsl:stylesheet>