public
Description: Light stats
Homepage: http://rist.yreality.net
Clone URL: git://github.com/elliottcable/rist.git
rist / view / error.xhtml
100644 65 lines (58 sloc) 2.024 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<link rel="stylesheet" href="/css/ramaze_error.css" />
<script type="text/javascript" src="/js/jquery.js"></script>
 
<p>The backtrace gives filenames and line numbers for all parts of the call stack.<br />
Click on any of them to view the surrounding source code.</p>
 
<h3>#@title</h3>
 
<table class="main">
  <tr class="head">
    <td>File</td><td>Line</td><td>Method</td>
  </tr>
  <?r @backtrace.each do |lines, hash, file, lineno, meth| ?>
    <tr class="line" id="#{hash}">
      <td>#{file}</td><td class="lineno">#{lineno}</td><td><pre>#{meth}</pre></td>
    </tr>
    <tr id="source_#{hash}" style="display:none;">
      <td colspan="3">
        <div class="source">
          <table style="width:100%;">
            <tr>
              <td class="editor" colspan="2">
                #{@editor} #{file} +#{lineno}
                <div style="float: right">
                  <a href="txmt://open?url=file://#{file}&line=#{lineno}">open in textmate</a>
                </div>
              </td>
            </tr>
            <?r lines.each do |llineno, lcode, lcurrent| ?>
              <tr class="source" #{'style="background:#faa;"' if lcurrent}>
                <td class="lineno">#{llineno}</td>
                <td class="code"><pre>#{lcode.to_s.rstrip}</pre></td>
              </tr>
            <?r end ?>
          </table>
        </div>
      </td>
    </tr>
  <?r end ?>
</table>
 
<?r
  { 'Session' => Thread.current[:session],
    'Request' => Thread.current[:request],
    'Response' => Thread.current[:response],
    'Global' => Global,
  }.each do |title, content|
    hash = [title, content].object_id.abs
  ?>
  <div class="additional">
    <h3 id="#{hash}">#{title}</h3>
    <pre style="display:none" id="is_#{hash}">#{CGI.escapeHTML(content.pretty_inspect)}</pre>
  </div>
<?r end ?>
 
<script type="text/javascript">
  $("tr.line").click(function(){
    $("tr#source_"+this.id).toggle()
  });
 
  $("div.additional > h3").click(function(){
    $("pre#is_"+this.id).toggle()
  });
</script>