bloodhound-trac / trac / templates / error.html

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns=""
  <xi:include href="layout.html" />
    <title>${title or _('Error')}</title>
    <link rel="stylesheet" type="text/css" href="${chrome.htdocs_location}css/code.css"/>
    <script py:if="frames" type="text/javascript">/*<![CDATA[*/
      jQuery(document).ready(function($) {
        $("#traceback a").click(function() {
          $("div", this.parentNode).slideToggle("fast");
          return false;
        $("#plugins td.file a").click(function() {
          var idx = parseInt($(this).attr("href").substring(6));
          $("#traceback li").eq(idx).children("div").slideDown("fast");
          return true;
        $("#tbtoggle").click(function() {
          if (this.value.indexOf("interactive") < 0) {
            this.value = "Switch to interactive view";
            $("#traceback ul").fadeOut("fast", function() {
              $("#traceback pre").fadeIn("fast");
          } else {
            this.value = "Switch to plain text view";
            $("#traceback pre").fadeOut("fast", function() {
              $("#traceback ul").fadeIn("fast");
          return false;
       /* Only activate interactive view if Javascript is enabled */
       $("#traceback ul").show();
       $("#traceback pre").hide();

       $("#systeminfo").append("<tr><th>jQuery</th><td>" + $().jquery + "</td></tr>");
       $("#systeminfo").before("<p>User Agent: <tt>" + navigator.userAgent + "</tt></p>");
    <script type="text/javascript">/*<![CDATA[*/
      jQuery(document).ready(function($) {
        $("form.newticket textarea").each(function() {
                             .replace(/#USER_AGENT#/m, navigator.userAgent)
                             .replace(/#JQUERY#/m, $().jquery));

  <py:def function="create_ticket(url=None)">
    <input type="hidden" name="reporter" value="${get_reporter_id(req)}" />
    <input py:if="url == trac.homepage.strip('/')" type="hidden" name="version"
           value="${trac.version.split('-', 1)[0] if 'dev' in trac.version else trac.version}" />
    <input type="hidden" name="summary" value="$message" />
    <textarea name="description" rows="3" cols="10">
${description_en if url else description}</textarea>
    <span class="inlinebuttons">
      <input type="submit" name="create" value="${_('Create')}" />

    <div id="content" class="error">
      <py:choose test="type">
        <py:when test="'TracError'">
          <py:choose test="">
            <p py:when="istext(message)" class="message">$message</p>
        <py:when test="'internal'">
          <div class="message">
            <strong>Trac detected an internal error:</strong>
            <py:when test="not defined('trac_error_rendering') and 'TRAC_ADMIN' not in perm">
              <p i18n:msg="">There was an internal error in Trac.
                It is recommended that you notify your local
                <a py:strip="not project.admin" href="mailto:${project.admin}">
                    Trac administrator</a> with the information needed to
                reproduce the issue.
              <form py:if="project.admin_href"
                    class="newticket" method="get" action="${project.admin_href.newticket()}#">
                <p i18n:msg="create">To that end, you could ${create_ticket()} a ticket.</p>
              <p>The action that triggered the error was:</p>
              <pre>${req.method}: ${req.path_info}</pre>
              <form class="newticket" method="get" action="${project.admin_href.newticket()}#">
                <p>This is probably a local installation issue.
                  <py:if test="project.admin_href and project.admin_trac_url != '.'"><i18n:msg params="create">
                    You should ${create_ticket()} a ticket at the admin Trac to report
                    the issue.
              <h2>Found a bug in Trac?</h2>
              <p>If you think this should work and you can reproduce the problem,
              you should consider creating a bug report.</p>
              <p py:if="faulty_plugins" py:choose="len(faulty_plugins)">
                <py:when test="1"><i18n:msg params="name">
                  Note that the ${faulty_plugins[0].name} plugin seems to be involved.
                  Note that the following plugins seem to be involved:
                  ${', '.join([ for p in faulty_plugins])}
                <strong>Please report this issue to the plugin maintainer.</strong>
              <p i18n:msg="" py:with="q = quote_plus(message[:80])">Before you do that, though, please first try
                <strong><a href="${tracker}/search?ticket=yes&amp;noquickjump=1&amp;q=$q">searching</a>
                for similar issues</strong>, as it is quite likely that this problem
                has been reported before. For questions about installation
                and configuration of Trac or its plugins, please try the
                <a href="${trac.homepage}wiki/MailingList">mailing list</a>
                instead of creating a ticket.
              <form class="newticket" method="get" action="${tracker}/newticket">
                <p i18n:msg="create">Otherwise, please ${create_ticket(tracker)} a new bug report
                describing the problem and explain how to reproduce it.</p>
              <py:if test="traceback">
                <h2>Python Traceback</h2>
                <div id="traceback">
                  Most recent call last:
                  <ul py:if="frames" style="display: none">
                    <li class="frame" py:for="idx, frame in enumerate(frames)">
                      <a href="#frame${idx}" id="frame${idx}"><span i18n:msg="file, line, function" py:strip="">
                        <span class="file">File "${frame.filename}",
                        line <b>${frame.lineno + 1}</b>, in</span>
                      <div py:if="frame.line" class="source" style="display: none">
                        <h3>Code fragment:</h3>
                        <table class="code">
                          <thead><tr><th class="lineno">Line</th><th class="content"></th></tr></thead>
                            <tr py:for="i, line in enumerate(frame.lines_before + [frame.line] + frame.lines_after)"
                                class="${'current' if i == len(frame.lines_before) else None}">
                              <th>${frame.lineno + i + 1 - len(frame.lines_before)}</th><td>${line or u'\xa0'}</td>
                      <div py:if="frame.vars" class="vars" style="display: none">
                        <h3>Local variables:</h3>
                        <table class="listing">
                            <tr py:for="idx, (name, value) in enumerate(sorted(frame.vars.items()))"
                                class="${'odd' if idx % 2 else None}">
                              <th scope="row"><var>$name</var></th>
                  <pre><py:for each="frame in frames"><i18n:msg params="file, line, function">File "${frame.filename}", line ${frame.lineno + 1}, in ${frame.function}</i18n:msg><py:if test="frame.line">
</py:if></py:for><py:if test="not frames">${traceback}</py:if></pre>
                  <p style="display: none"><input type="button" id="tbtoggle" value="${_('Switch to plain text view')}" /></p>
              <h2>System Information:</h2>
              <table class="listing" id="systeminfo">
                <tr py:for="name, value in get_systeminfo()">
              <py:if test="plugins">
                <h2>Enabled Plugins:</h2>
                <table class="listing" id="plugins">
                  <tr py:for="plugin in plugins">
                    <th py:with="url = or and 'mailto:' +">
                      <a py:strip="not url" href="$url">$</a>
                    <td>${plugin.version or _('N/A')}</td>
                    <td class="file"><a py:strip="'frame_idx' not in plugin" href="#frame$plugin.frame_idx">$plugin.path</a></td>
        <a href="${'TracGuide')}">TracGuide</a> &mdash; The Trac User and Administration Guide