root/WebContent/WEB-INF/resources/templates/xhtml10.vm @ 833:b2d6f0de0404

Revision 833:b2d6f0de0404, 18.6 KB (checked in by tgambet, 4 years ago)

updated for group display

Line 
1#set ($title = "$ucn.evaluate($lang, 'result_for', $unicorncall.DocumentName)")
2#set ($css = ['base_ucn.css'])
3#set ($js = ['mootools-1.2.3-core-nc.js', 'mootools-1.2.3.1-more.js', 'w3c_unicorn_results.js'])
4#if ($unicorncall.isPassed())
5#set ($fav = "favicon_green.ico")
6#else
7#set ($fav = "favicon_red.ico")
8#end
9#parse('includes/head.vm')
10
11#set($observationList = $unicorncall.ObservationList)
12
13#if ($messages.size() > 0)
14#displayMessages($messages)
15#end
16<div id="don_program">
17        <script type="text/javascript" src="http://www.w3.org/QA/Tools/don_prog.js"></script>
18        <noscript>
19                <div><span id="don_program_img">
20                        <a href="http://www.w3.org/QA/Tools/Donate">
21                                <img alt="" src="http://www.w3.org/QA/Tools/I_heart_validator_lg" />
22                        </a>
23                </span>
24                <span id="don_program_text">
25                        The W3C validators rely on community support for hosting and development.<br />
26                        <a href="http://www.w3.org/QA/Tools/Donate">Donate</a> and help us build better tools for a better web.
27                </span></div>
28        </noscript>
29</div>
30<div id="observations">
31#foreach ($observationName in $observationList.keySet())
32#set ($observation = $observationList.get($observationName))
33#set ($infoCount = $observation.getInfoCount())
34#set ($errorCount = $observation.getErrorCount())
35#set ($warningCount = $observation.getWarningCount())
36<div class="observer section #if($observation.isPassed()) valid #else invalid #end" id="$observationName">
37        <h2 class="title">
38                <span class="icons">
39                        #if ($infoCount && $infoCount > 0)<a class="infos" href="#${observationName}_info" title="$info_label ($infoCount)"><span class="legend">$info_label</span><span class="count">$infoCount</span></a> #end
40                        #if ($errorCount && $errorCount > 0)<a class="errors" href="#${observationName}_error" title="$error_label ($errorCount)"><span class="legend">$error_label</span><span class="count">$errorCount</span></a> #end
41                        #if ($warningCount && $warningCount > 0)<a class="warnings" href="#${observationName}_warning" title="$warning_label ($warningCount)"><span class="legend">$warning_label</span><span class="count">$warningCount</span></a> #end
42                        <a class="anchor smooth" href="#$observationName" title="$anchor_observation">a</a>
43                </span>
44                #if($observation.isPassed()) #set($ref = "test_ok") #else #set($ref = "test_fail") #end
45                $ucn.evaluate($lang, $ref, "<span class=\"name\">$unicorncall.getObserverName($observationName, $lang)#if($observation.isSetRating()) ($observation.Rating/100)#end</span>")
46                #if ($unicorncall.getInputMethod() == "URI") <a class="direct_link" href="$esc.html($observation.getHTMLRequestUri())" title="$direct_link_title_1">$direct_link_label</a>
47                #else <a class="direct_link" href="$esc.html($observation.getHTMLIndexUri())" title="$direct_link_title_2">$direct_link_label</a>#end
48        </h2>
49       
50        <div class="results block">
51        #if ($observation.hasGroups())
52                #foreach($group in $observation.getGroups()) #if (!$group.hasParent())
53                <div class="section group">
54                        <h3 class="title"><a class="anchor">a</a>$group.getTitle()</h3>                                 
55                        <div class="block">
56                                <p>$group.getDescription()</p>
57                                <div class="messages">
58                                        #set ($messages = $observation.getURISortedMessages($group.getName()))
59                                        #if ($messages.size() > 0)
60                                        <table>
61                                                <tbody>
62                                                #foreach ($uri in $messages.keySet())
63                                                #set ($uriCount = $velocityCount)
64                                                        <tr>
65                                                                <td colspan="4" class="uri" id="${observationName}_${group.Name}_$uriCount">
66                                                                #if ($unicorncall.getInputMethod() == "URI")<span>$uri_token </span><a href="$esc.html($uri)">$esc.html($uri)</a>#end
67                                                                #if ($unicorncall.getInputMethod() == "UPLOAD")<span>$file_token </span>$esc.html($uri)#end
68                                                                #if ($unicorncall.getInputMethod() == "DIRECT")<span>$submitted_file</span>#end
69                                                                </td>
70                                                                <td class="anchor uri"><a class="smooth" title="$anchor_uri" href="#${observationName}_${group.Name}_$uriCount">a</a></td>
71                                                        </tr>
72                                                        #foreach ($message in $messages.get($uri))
73                                                                #if($message.getType()==2)#set($type="error")#elseif($message.getType()==1)#set($type="warning")#else#set($type="info")#end
74                                                                #set ($messageId = "${observationName}_${group.Name}_${uriCount}_$velocityCount")
75                                                                #set ($contextsCount = $message.getContexts().size())
76                                                                #if ($contextsCount == 0)
77                                                                        <tr>
78                                                                                <td class="linenumber" title=""></td>
79                                                                                <td class="colnumber" title=""></td>
80                                                                                <td class="codeContext" title=""></td>
81                                                                                <td class="$type level$message.Level" id="$messageId">
82                                                                                        <span class="msg#if($message.Description && $message.Description != "") desc#end">
83                                                                                                <span class="$type legend">$type</span>
84                                                                                                $!esc.html($message.Title)
85                                                                                        </span>
86                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
87                                                                                </td>
88                                                                                <td class="anchor"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
89                                                                        </tr>
90                                                                #else
91                                                                        #set ($b = true)
92                                                                        #foreach($context in $message.getContexts())
93                                                                        <tr>
94                                                                                <td class="linenumber" title="#if($context.Line)$line_token $context.Line#end">$!context.Line</td>
95                                                                                <td class="colnumber" title="#if($context.Column)$column_token $context.Column#end">$!context.Column</td>
96                                                                                <td class="codeContext" title="$context_token">
97                                                                                        #if($context.URI && $context.URI != $uri) <a class="direct_link" href="$context.URI" title="Resource referenced by this context: $context.URI"">link</a> #end
98                                                                                        $!esc.html($!{context.Context})
99                                                                                </td>
100                                                                                #if ($b)
101                                                                                #set ($b = false)
102                                                                                <td class="$type level$message.Level" id="$messageId" rowspan="$message.getContexts().size()">
103                                                                                        <span class="msg#if($message.Description && $message.Description != "") desc#end">
104                                                                                                <span class="$type legend">$type</span>
105                                                                                                $!esc.html($message.Title)
106                                                                                        </span>
107                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
108                                                                                </td>
109                                                                                <td class="anchor" rowspan="$message.getContexts().size()"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
110                                                                                #end
111                                                                        </tr>
112                                                                        #end                                                           
113                                                                #end
114                                                        #end
115                                                #end
116                                                </tbody>
117                                        </table>
118                                        #end
119                                </div>
120                               
121                                #foreach($group in $observation.getGroupChildren($group))
122                                <div class="section group">
123                                        <h3 class="title"><a class="anchor">a</a>$group.getTitle()</h3>
124                                        <div class="block">
125                                                <p>$group.getDescription()</p>
126                                                <div class="messages">
127                                                        #set ($messages = $observation.getURISortedMessages($group.getName()))
128                                                        #if ($messages.size() > 0)
129                                                        <table>
130                                                                <tbody>
131                                                                #foreach ($uri in $messages.keySet())
132                                                                #set ($uriCount = $velocityCount)
133                                                                        <tr>
134                                                                                <td colspan="4" class="uri" id="${observationName}_${group.Name}_$uriCount">
135                                                                                #if ($unicorncall.getInputMethod() == "URI")<span>$uri_token </span><a href="$esc.html($uri)">$esc.html($uri)</a>#end
136                                                                                #if ($unicorncall.getInputMethod() == "UPLOAD")<span>$file_token </span>$esc.html($uri)#end
137                                                                                #if ($unicorncall.getInputMethod() == "DIRECT")<span>$submitted_file</span>#end
138                                                                                </td>
139                                                                                <td class="anchor uri"><a class="smooth" title="$anchor_uri" href="#${observationName}_${group.Name}_$uriCount">a</a></td>
140                                                                        </tr>
141                                                                        #foreach ($message in $messages.get($uri))
142                                                                                #if($message.getType()==2)#set($type="error")#elseif($message.getType()==1)#set($type="warning")#else#set($type="info")#end
143                                                                                #set ($messageId = "${observationName}_${group.Name}_${uriCount}_$velocityCount")
144                                                                                #set ($contextsCount = $message.getContexts().size())
145                                                                                #if ($contextsCount == 0)
146                                                                                        <tr>
147                                                                                                <td class="linenumber" title=""></td>
148                                                                                                <td class="colnumber" title=""></td>
149                                                                                                <td class="codeContext" title=""></td>
150                                                                                                <td class="$type level$message.Level" id="$messageId">
151                                                                                                        <span class="msg#if($message.Description && $message.Description != "") desc#end">
152                                                                                                                <span class="$type legend">$type</span>
153                                                                                                                $!esc.html($message.Title)
154                                                                                                        </span>
155                                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
156                                                                                                </td>
157                                                                                                <td class="anchor"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
158                                                                                        </tr>
159                                                                                #else
160                                                                                        #set ($b = true)
161                                                                                        #foreach($context in $message.getContexts())
162                                                                                        <tr>
163                                                                                                <td class="linenumber" title="#if($context.Line)$line_token $context.Line#end">$!context.Line</td>
164                                                                                                <td class="colnumber" title="#if($context.Column)$column_token $context.Column#end">$!context.Column</td>
165                                                                                                <td class="codeContext" title="$context_token">                                                                                 
166                                                                                                        #if($context.URI && $context.URI != $uri) <a class="direct_link" href="$context.URI" title="Resource referenced by this context: $context.URI">link</a> #end
167                                                                                                        $!esc.html($!{context.Context})
168                                                                                                </td>
169                                                                                                #if ($b)
170                                                                                                #set ($b = false)
171                                                                                                <td class="$type level$message.Level" id="$messageId" rowspan="$message.getContexts().size()">
172                                                                                                        <span class="msg#if($message.Description && $message.Description != "") desc#end">
173                                                                                                                <span class="$type legend">$type</span>
174                                                                                                                $!esc.html($message.Title)
175                                                                                                        </span>
176                                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
177                                                                                                </td>
178                                                                                                <td class="anchor" rowspan="$message.getContexts().size()"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
179                                                                                                #end
180                                                                                        </tr>
181                                                                                        #end                                                           
182                                                                                #end
183                                                                        #end
184                                                                #end
185                                                                </tbody>
186                                                        </table>
187                                                        #end
188                                                </div>
189                                        </div>
190                                </div>
191                                #end
192                        </div>
193                </div>
194                #end#end
195       
196        #else
197       
198                #if ($infoCount && $infoCount > 0)
199                        <div class="section infos" id="${observationName}_info">
200                                <h3 class="title">
201                                        <a class="smooth anchor" title="$anchor_uri" href="#${observationName}_info">a</a>
202                                        $info_label ($infoCount)
203                                </h3>
204                                <div class="block result">
205                                        <table>
206                                                <tbody>
207                                                #set ($messages = $observation.getURISortedMessages(0))
208                                                #foreach ($uri in $messages.keySet())
209                                                #set ($uriCount = $velocityCount)
210                                                        <tr>
211                                                                <td colspan="4" class="uri" id="${observationName}_info_$uriCount">
212                                                                #if ($unicorncall.getInputMethod() == "URI")<span>$uri_token </span><a href="$esc.html($uri)">$esc.html($uri)</a>#end
213                                                                #if ($unicorncall.getInputMethod() == "UPLOAD")<span>$file_token </span>$esc.html($uri)#end
214                                                                #if ($unicorncall.getInputMethod() == "DIRECT")<span>$submitted_file</span>#end
215                                                                </td>
216                                                                <td class="anchor uri"><a class="smooth" title="$anchor_uri" href="#${observationName}_info_$uriCount">a</a></td>
217                                                        </tr>
218                                                        #foreach($message in $messages.get($uri))
219                                                        #set ($messageId = "${observationName}_info_${uriCount}_$velocityCount")
220                                                        #set ($contextsCount = $message.getContexts().size())
221                                                        #set ($b = true)
222                                                                #if ($contextsCount == 0)
223                                                                        <tr>
224                                                                                <td class="linenumber" title=""></td>
225                                                                                <td class="colnumber" title=""></td>
226                                                                                <td class="codeContext" title=""></td>
227                                                                                <td class="info level$message.Level" id="$messageId">
228                                                                                        <span class="msg">$!esc.html($message.Title)</span>
229                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
230                                                                                </td>
231                                                                                <td class="anchor"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
232                                                                        </tr>
233                                                                #else
234                                                                        #foreach($context in $message.getContexts())
235                                                                        <tr>
236                                                                                <td class="linenumber" title="#if($context.Line)$line_token $context.Line#end">$!context.Line</td>
237                                                                                <td class="colnumber" title="#if($context.Column)$column_token $context.Column#end">$!context.Column</td>
238                                                                                <td class="codeContext" title="$context_token">$!esc.html($!{context.Context})</td>
239                                                                               
240                                                                                #if ($b)
241                                                                                #set ($b = false)
242                                                                                <td class="info level$message.Level" id="$messageId" rowspan="$message.getContexts().size()">
243                                                                                        <span class="msg">$!esc.html($message.Title)</span>
244                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
245                                                                                </td>
246                                                                                <td class="anchor" rowspan="$message.getContexts().size()"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
247                                                                                #end
248                                                                        </tr>
249                                                                        #end                                                           
250                                                                #end
251                                                        #end
252                                                #end
253                                                </tbody>
254                                        </table>
255                                </div>
256                        </div>
257                #end
258               
259                #if ($errorCount && $errorCount > 0)
260                        <div class="section errors" id="${observationName}_error">
261                                <h3 class="title">
262                                        <a class="smooth anchor" title="$anchor_uri" href="#${observationName}_error">a</a>
263                                        $error_label ($errorCount)
264                                </h3>
265                                <div class="block result">
266                                        <table>
267                                                <tbody>
268                                                #set ($messages = $observation.getURISortedMessages(2))
269                                                #foreach ($uri in $messages.keySet())
270                                                #set ($uriCount = $velocityCount)
271                                                        <tr>
272                                                                <td colspan="4" class="uri" id="${observationName}_error_$uriCount">
273                                                                #if ($unicorncall.getInputMethod() == "URI")<span>$uri_token </span><a href="$esc.html($uri)">$esc.html($uri)</a>#end
274                                                                #if ($unicorncall.getInputMethod() == "UPLOAD")<span>$file_token </span>$esc.html($uri)#end
275                                                                #if ($unicorncall.getInputMethod() == "DIRECT")<span>$submitted_file</span>#end
276                                                                </td>
277                                                                <td class="anchor uri"><a class="smooth" title="$anchor_uri" href="#${observationName}_error_$uriCount">a</a></td>
278                                                        </tr>
279                                                        #foreach($message in $messages.get($uri))
280                                                        #set ($messageId = "${observationName}_error_${uriCount}_$velocityCount")
281                                                        #set ($contextsCount = $message.getContexts().size())
282                                                        #set ($b = true)
283                                                                #if ($contextsCount == 0)
284                                                                        <tr>
285                                                                                <td class="linenumber" title=""></td>
286                                                                                <td class="colnumber" title=""></td>
287                                                                                <td class="codeContext" title=""></td>
288                                                                                <td class="error level$message.Level" id="$messageId">
289                                                                                        <span class="msg">$!esc.html($message.Title)</span>
290                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
291                                                                                </td>
292                                                                                <td class="anchor"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
293                                                                        </tr>
294                                                                #else
295                                                                        #foreach($context in $message.getContexts())
296                                                                        <tr>
297                                                                                <td class="linenumber" title="#if($context.Line)$line_token $context.Line#end">$!context.Line</td>
298                                                                                <td class="colnumber" title="#if($context.Column)$column_token $context.Column#end">$!context.Column</td>
299                                                                                <td class="codeContext" title="$context_token">$!esc.html($!{context.Context})</td>
300                                                                               
301                                                                                #if ($b)
302                                                                                #set ($b = false)
303                                                                                <td class="error level$message.Level" id="$messageId" rowspan="$message.getContexts().size()">
304                                                                                        <span class="msg">$!esc.html($message.Title)</span>
305                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
306                                                                                </td>
307                                                                                <td class="anchor" rowspan="$message.getContexts().size()"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
308                                                                                #end
309                                                                        </tr>
310                                                                        #end                                                           
311                                                                #end
312                                                        #end
313                                                #end
314                                                </tbody>
315                                        </table>
316                                </div>
317                        </div>
318                #end
319               
320                #if ($warningCount && $warningCount > 0)
321                        <div class="section warnings" id="${observationName}_warning">
322                                <h3 class="title">
323                                        <a class="smooth anchor" title="$anchor_uri" href="#${observationName}_warning">a</a>
324                                        $warning_label ($warningCount)
325                                </h3>
326                                <div class="block result">
327                                        <table>
328                                                <tbody>
329                                                #set ($messages = $observation.getURISortedMessages(1))
330                                                #foreach ($uri in $messages.keySet())
331                                                #set ($uriCount = $velocityCount)
332                                                        <tr>
333                                                                <td colspan="4" class="uri" id="${observationName}_warning_$uriCount">
334                                                                #if ($unicorncall.getInputMethod() == "URI")<span>$uri_token </span><a href="$esc.html($uri)">$esc.html($uri)</a>#end
335                                                                #if ($unicorncall.getInputMethod() == "UPLOAD")<span>$file_token </span>$esc.html($uri)#end
336                                                                #if ($unicorncall.getInputMethod() == "DIRECT")<span>$submitted_file</span>#end
337                                                                </td>
338                                                                <td class="anchor uri"><a class="smooth" title="$anchor_uri" href="#${observationName}_warning_$uriCount">a</a></td>
339                                                        </tr>
340                                                        #foreach($message in $messages.get($uri))
341                                                        #set ($messageId = "${observationName}_warning_${uriCount}_$velocityCount")
342                                                        #set ($contextsCount = $message.getContexts().size())
343                                                        #set ($b = true)
344                                                                #if ($contextsCount == 0)
345                                                                        <tr>
346                                                                                <td class="linenumber" title=""></td>
347                                                                                <td class="colnumber" title=""></td>
348                                                                                <td class="codeContext" title=""></td>
349                                                                                <td class="warning level$message.Level" id="$messageId">
350                                                                                        <span class="msg">$!esc.html($message.Title)</span>
351                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
352                                                                                </td>
353                                                                                <td class="anchor"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
354                                                                        </tr>
355                                                                #else
356                                                                        #foreach($context in $message.getContexts())
357                                                                        <tr>
358                                                                                <td class="linenumber" title="#if($context.Line)$line_token $context.Line#end">$!context.Line</td>
359                                                                                <td class="colnumber" title="#if($context.Column)$column_token $context.Column#end">$!context.Column</td>
360                                                                                <td class="codeContext" title="$context_token">$!esc.html($!{context.Context})</td>
361                                                                               
362                                                                                #if ($b)
363                                                                                #set ($b = false)
364                                                                                <td class="warning level$message.Level" id="$messageId" rowspan="$message.getContexts().size()">
365                                                                                        <span class="msg">$!esc.html($message.Title)</span>
366                                                                                        #if($message.Description && $message.Description != "")<div class="description">$!message.Description</div>#end
367                                                                                </td>
368                                                                                <td class="anchor" rowspan="$message.getContexts().size()"><a class="smooth" title="$anchor_message" href="#$messageId">a</a></td>
369                                                                                #end
370                                                                        </tr>
371                                                                        #end                                                           
372                                                                #end
373                                                        #end
374                                                #end
375                                                </tbody>
376                                        </table>
377                                </div>
378                        </div>
379                #end
380       
381        #end
382        </div>
383</div>
384#end
385</div>
386#parse('includes/footer.vm')
Note: See TracBrowser for help on using the browser.