Edgewall Software

Ticket #2618: templates_patch.2.txt

File templates_patch.2.txt, 983 bytes (added by bboisvert@…, 6 years ago)

patch for installed 0.9.5 templates to display the submitted fields on a "mid air collision" error - formatted as an HTML table, rather than an HDF dump

Line 
1--- original_templates/error.cs 2006-04-25 12:01:03.000000000 -0700
2+++ templates/error.cs  2006-04-27 09:00:18.000000000 -0700
3@@ -10,6 +10,37 @@
4   <?cs var:error.message ?>
5   </p>
6
7+<?cs
8+def:dump(item) ?><?cs
9+ var:item ?><?cs
10+ if:subcount(item) > 0 ?>
11+  <table border="1" cellspacing="0" cellpadding="3" class="dump">
12+  <thead>
13+   <tr>
14+    <th colspan="2"><?cs var:name(item) ?></th>
15+   </tr>
16+  </thead>
17+  <tbody>
18+   <?cs each:child = item ?>
19+    <tr>
20+     <td class="label"><?cs var:name(child) ?></td>
21+     <td class="pre"><?cs call:dump(child) ?></td>
22+    </tr>
23+   <?cs /each ?>
24+  </tbody>
25+  </table><?cs
26+ /if ?><?cs
27+/def ?>
28+
29+  <?cs if:error.show_params ?>
30+   <style type="text/css">
31+    .dump th { font-weight: bold; }
32+    .dump .label { vertical-align: top; }
33+    .dump .pre { white-space: pre; }
34+   </style>
35+   <?cs call:dump(error.params) ?>
36+  <?cs /if ?>
37+
38  <?cs elif error.type == "internal" ?>
39   <h3>Oops...</h3>
40   <div class="message">