~ubuntu-branches/ubuntu/precise/trac/precise

« back to all changes in this revision

Viewing changes to trac/templates/error.html

  • Committer: Bazaar Package Importer
  • Author(s): Luis Matos
  • Date: 2008-07-13 23:46:20 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20080713234620-13ynpdpkbaymfg1z
Tags: 0.11-2
* Re-added python-setup-tools to build dependences. Closes: #490320 #468705
* New upstream release Closes: 489727
* Added sugestion for other vcs support available: git bazaar mercurial 
* Added spamfilter plugin to sugests
* Moved packaging from python-support to python-central
* Added an entry to the NEWS about the cgi Closes: #490275
* Updated 10_remove_trac_suffix_from_title patch to be used in 0.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html
 
2
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 
3
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml"
 
5
      xmlns:py="http://genshi.edgewall.org/"
 
6
      xmlns:xi="http://www.w3.org/2001/XInclude">
 
7
  <xi:include href="layout.html" />
 
8
  <head>
 
9
    <title>${title or 'Error'}</title>
 
10
    <script py:if="frames" type="text/javascript">/*<![CDATA[*/
 
11
      jQuery(document).ready(function($) {
 
12
        $("#traceback a").click(function() {
 
13
          $("div", this.parentNode).slideToggle("fast");
 
14
          return false;
 
15
        });
 
16
        $("#tbtoggle").click(function() {
 
17
          if (this.value.indexOf("interactive") < 0) {
 
18
            this.value = "Switch to interactive view";
 
19
            $("#traceback ul").fadeOut("fast", function() {
 
20
              $("#traceback pre").fadeIn("fast");
 
21
            });
 
22
          } else {
 
23
            this.value = "Switch to plain text view";
 
24
            $("#traceback pre").fadeOut("fast", function() {
 
25
              $("#traceback ul").fadeIn("fast");
 
26
            });
 
27
          }
 
28
          return false;
 
29
        });
 
30
       /* Only activate interactive view if Javascript is enabled */
 
31
       $("#traceback ul").show();
 
32
       $("#traceback pre").hide();
 
33
       $("#tbtoggle").parent().show();
 
34
       
 
35
       $("#systeminfo").append("<tr><th>jQuery:</th><td>"+$().jquery+"</td></tr>");
 
36
       $("#systeminfo").before("<p>User Agent: <tt>"+navigator.userAgent+"</tt></p>");
 
37
      });
 
38
    /*]]>*/</script>
 
39
    <script type="text/javascript">/*<![CDATA[*/
 
40
      jQuery(document).ready(function($) {
 
41
       var descr = $("#description").text();
 
42
       descr = descr.replace(/==== System Information ====\s+/m,
 
43
         "User Agent was: `" + navigator.userAgent + "`\n\n$&"
 
44
       );
 
45
       descr = descr.replace(/\|\|\s+==== Python Traceback ====/m,
 
46
         "||\n|| '''jQuery:''' || `" + $().jquery + "` $&"
 
47
       );
 
48
       $("#description").text(descr);
 
49
      });
 
50
    /*]]>*/</script>
 
51
  </head>
 
52
 
 
53
  <py:def function="create_ticket(teo=False)">
 
54
    <input type="hidden" name="reporter" value="${get_reporter_id(req)}" />
 
55
    <input py:if="teo" type="hidden" name="version"
 
56
           value="${'dev' in trac.version and 'devel' or trac.version}" />
 
57
    <input type="hidden" name="summary" value="$message" />
 
58
    <textarea id="description" name="description" rows="3" cols="10">
 
59
 
 
60
==== How to Reproduce ====
 
61
 
 
62
While doing a $req.method operation on `$req.path_info`, Trac issued an internal error.
 
63
 
 
64
''(please provide additional details here)''
 
65
 
 
66
<py:if test="req.args">
 
67
Request parameters:
 
68
{{{
 
69
${pprint(req.args)}
 
70
}}}
 
71
</py:if>
 
72
 
 
73
==== System Information ====
 
74
<py:for each="k, v in trac.systeminfo">
 
75
|| '''$k''' || ${'`%s`' % (v and v.replace('\n', '` [[br]] `'))} ||</py:for>
 
76
 
 
77
==== Python Traceback ====
 
78
{{{
 
79
${traceback}
 
80
}}}
 
81
    </textarea>
 
82
    <span class="inlinebuttons">
 
83
      <input type="submit" name="create" value="Create" />
 
84
    </span>
 
85
  </py:def>
 
86
 
 
87
  <body>
 
88
    <div id="content" class="error">
 
89
      <py:choose test="type">
 
90
        <py:when test="'TracError'">
 
91
          <h1>$title</h1>
 
92
          <py:choose test="">
 
93
            <p py:when="istext(message)" class="message">$message</p>
 
94
            <py:otherwise>$message</py:otherwise>
 
95
          </py:choose>
 
96
        </py:when>
 
97
        <py:when test="'internal'">
 
98
          <h1>Oops&hellip;</h1>
 
99
          <div class="message">
 
100
            <strong>Trac detected an internal error:</strong>
 
101
            <pre>$message</pre>
 
102
          </div>
 
103
          <py:choose>
 
104
            <py:when test="'TRAC_ADMIN' not in perm">
 
105
              <p>There was an internal error in Trac. It is recommended
 
106
              that you inform your local
 
107
              <a py:strip="not project.admin" href="mailto:${project.admin}">Trac
 
108
              administrator</a> and give him all the information he needs to
 
109
              reproduce the issue.
 
110
              </p>
 
111
              <py:if test="not project.admin">
 
112
                <form class="newticket" method="get" action="${href.newticket()}#">
 
113
                  <p>To that end, you could ${create_ticket()} a ticket at this
 
114
                  site.</p>
 
115
                </form>
 
116
              </py:if>
 
117
              <p>
 
118
                The action that triggered the error was:
 
119
                <pre>${req.method}: ${req.path_info}</pre>
 
120
              </p>
 
121
            </py:when>
 
122
            <py:otherwise>
 
123
              <p>If you think this should work you can reproduce the problem,
 
124
              you should consider reporting this to the Trac team.</p>
 
125
              <p>Before you do that, though, please first try
 
126
                <a py:with="q = quote_plus(message[:80])"
 
127
                   href="${trac.homepage}search?ticket=yes&amp;noquickjump=1&amp;q=$q">searching</a>
 
128
                for similar issues, as it is quite likely that this problem
 
129
                has been reported before. For questions about installation
 
130
                and configuration of Trac, please try the
 
131
                <a href="${trac.homepage}wiki/MailingList">mailing list</a>
 
132
                instead of filing a ticket.
 
133
              </p>
 
134
              <form class="newticket" method="get" action="${trac.homepage}newticket">
 
135
                <p>Otherwise, please ${create_ticket(True)} a new ticket at
 
136
                the Trac project site, where you can describe the problem and
 
137
                explain how to reproduce it.</p>
 
138
              </form>
 
139
              <py:if test="traceback">
 
140
                <h2>Python Traceback</h2>
 
141
                <div id="traceback">
 
142
                  Most recent call last:
 
143
                  <ul py:if="frames" style="display: none">
 
144
                    <li class="frame" py:for="idx, frame in enumerate(frames)">
 
145
                      <a href="#frame${idx}" id="frame${idx}">
 
146
                        <span class="file">File "${frame.filename}",
 
147
                        line <b>${frame.lineno + 1}</b>, in</span>
 
148
                        <var>${frame.function}</var>
 
149
                      </a>
 
150
                      <div py:if="frame.line" class="source" style="display: none">
 
151
                        <h3>Code fragment:</h3>
 
152
                        <ol start="${frame.lineno + 1 - len(frame.lines_before)}">
 
153
                          <li py:for="line in frame.lines_before"><code>${line or u'\xa0'}</code></li>
 
154
                          <li class="current"><code>${frame.line or u'\xa0'}</code></li>
 
155
                          <li py:for="line in frame.lines_after"><code>${line or u'\xa0'}</code></li>
 
156
                        </ol>
 
157
                      </div>
 
158
                      <div py:if="frame.vars" class="vars" style="display: none">
 
159
                        <h3>Local variables:</h3>
 
160
                        <table class="listing">
 
161
                          <thead><tr><th>Name</th><th>Value</th></tr></thead>
 
162
                          <tbody>
 
163
                            <tr py:for="idx, (name, value) in enumerate(sorted(frame.vars.items()))"
 
164
                                class="${idx % 2 and 'odd' or None}">
 
165
                              <th scope="row"><var>$name</var></th>
 
166
                              <td><code>${shorten_line(repr(value))}</code></td>
 
167
                            </tr>
 
168
                          </tbody>
 
169
                        </table>
 
170
                      </div>
 
171
                    </li>
 
172
                  </ul>
 
173
                  <pre><py:for each="frame in frames">File "${frame.filename}", line ${frame.lineno + 1}, in ${frame.function}<py:if test="frame.line">
 
174
  ${frame.line.lstrip()}
 
175
</py:if></py:for><py:if test="not frames">${traceback}</py:if></pre>
 
176
                  <p style="display: none"><input type="button" id="tbtoggle" value="Switch to plain text view" /></p>
 
177
                </div>
 
178
              </py:if>
 
179
              <h2>System Information:</h2>
 
180
              <table class="listing" id="systeminfo">
 
181
                <tr py:for="name, value in trac.systeminfo">
 
182
                  <th>$name:</th>
 
183
                  <td>$value</td>
 
184
                </tr>
 
185
              </table>
 
186
            </py:otherwise>
 
187
          </py:choose>
 
188
        </py:when>
 
189
      </py:choose>
 
190
      <p>
 
191
        <a href="${href.wiki('TracGuide')}">TracGuide</a> &mdash; The Trac User and Administration Guide
 
192
      </p>
 
193
    </div>
 
194
  </body>
 
195
</html>