biblesearch / mojo / lib / Mojolicious / templates / exception.development.html.ep /
Newer Older
226 lines | 7.147kb
add files
Yuki Kimoto authored on 2014-03-26
1
<!DOCTYPE html>
2
<html>
3
  <head>
4
    <title>Server error</title>
5
    <meta http-equiv="Pragma" content="no-cache">
6
    <meta http-equiv="Expires" content="-1">
7
    %= javascript '/mojo/jquery/jquery.js'
8
    %= javascript '/mojo/prettify/run_prettify.js'
9
    %= stylesheet '/mojo/prettify/prettify-mojo-dark.css'
10
    %= stylesheet begin
11
      a img { border: 0 }
12
      body {
13
        background: url(<%= url_for '/mojo/pinstripe-light.png' %>);
14
        color: #445555;
15
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
16
        font-weight: normal;
17
        line-height: 1.5em;
18
        margin: 0;
19
      }
20
      pre {
21
        font: 0.9em Consolas, Menlo, Monaco, Courier, monospace;
22
        margin: 0;
23
        white-space: pre-wrap;
24
      }
25
      table {
26
        border-collapse: collapse;
27
        margin-top: 1em;
28
        margin-bottom: 1em;
29
        width: 100%;
30
      }
31
      td { padding: 0.5em }
32
      .box {
33
        background-color: #fff;
34
        box-shadow: 0px 0px 2px #999;
35
        overflow: hidden;
36
        padding: 1em;
37
      }
38
      .code {
39
        background-color: #1a1a1a;
40
        background: url(<%= url_for '/mojo/pinstripe-dark.png' %>);
41
        color: #eee;
42
        text-shadow: #333 0 1px 0;
43
      }
44
      .important { background-color: rgba(47, 48, 50, .75) }
45
      .infobox { color: #333 }
46
      .infobox tr:nth-child(odd) .value { background-color: #ddeeff }
47
      .infobox tr:nth-child(even) .value { background-color: #eef9ff }
48
      .key { text-align: right }
49
      .spaced {
50
        margin-left: 5em;
51
        margin-right: 5em;
52
      }
53
      .striped { border-top: solid #cce4ff 1px }
54
      .tap {
55
        font: 0.5em Verdana, sans-serif;
56
        text-align: center;
57
      }
58
      .value {
59
        padding-left: 1em;
60
        width: 100%;
61
      }
62
      #footer {
63
        padding-top: 1em;
64
        text-align: center;
65
      }
66
      #nothing { padding-top: 60px }
67
      #showcase > pre {
68
        font: 1.5em 'Helvetica Neue', Helvetica, sans-serif;
69
        font-weight: 300;
70
        margin: 0;
71
        text-shadow: #333 0 1px 0;
72
      }
73
      #showcase td {
74
        padding-top: 0;
75
        padding-bottom: 0;
76
      }
77
      #showcase .key { padding-right: 0 }
78
      #more, #trace {
79
        border-bottom-left-radius: 5px;
80
        border-bottom-right-radius: 5px;
81
      }
82
      #more .tap, #trace .tap { text-shadow: #ddd 0 1px 0 }
83
      #request {
84
        border-top-left-radius: 5px;
85
        border-top-right-radius: 5px;
86
        margin-top: 1em;
87
      }
88
      #wrapperlicious {
89
        max-width: 1000px;
90
        margin: 0 auto;
91
      }
92
    % end
93
  </head>
94
  <body>
95
    %= include inline => app->renderer->_bundled('mojobar')
96
    <div id="wrapperlicious">
97
      <div id="nothing" class="box spaced"></div>
98
      % my $cv = begin
99
        % my ($key, $value, $i) = @_;
100
        %= tag 'tr', $i ? (class => 'important') : undef, begin
101
          <td class="key"><%= $key %></td>
102
          <td class="value"><pre class="prettyprint"><%= $value %></pre></td>
103
        % end
104
      % end
105
      % my $kv = begin
106
        % my ($key, $value) = @_;
107
        <tr>
108
          <td class="key"><%= $key %>:</td>
109
          <td class="striped value"><pre><%= $value %></pre></td>
110
        </tr>
111
      % end
112
      <div id="showcase" class="box code spaced">
113
        <pre><%= $exception->message %></pre>
114
        <div id="context">
115
          <table>
116
            % for my $line (@{$exception->lines_before}) {
117
              %= $cv->($line->[0], $line->[1])
118
            % }
119
            % if (defined $exception->line->[1]) {
120
              %= $cv->($exception->line->[0], $exception->line->[1], 1)
121
            % }
122
            % for my $line (@{$exception->lines_after}) {
123
              %= $cv->($line->[0], $line->[1])
124
            % }
125
          </table>
126
        </div>
127
        % if (defined $exception->line->[2]) {
128
          <div id="insight">
129
            <table>
130
              % for my $line (@{$exception->lines_before}) {
131
                %= $cv->($line->[0], $line->[2])
132
              % }
133
              %= $cv->($exception->line->[0], $exception->line->[2], 1)
134
              % for my $line (@{$exception->lines_after}) {
135
                %= $cv->($line->[0], $line->[2])
136
              % }
137
            </table>
138
          </div>
139
          <div class="tap">tap for more</div>
140
          %= javascript begin
141
            var current = '#context';
142
            $('#showcase').click(function() {
143
              $(current).slideToggle('slow', function() {
144
                if (current == '#context') {
145
                  current = '#insight';
146
                }
147
                else {
148
                  current = '#context';
149
                }
150
                $(current).slideToggle('slow');
151
              });
152
            });
153
            $('#insight').toggle();
154
          % end
155
        % }
156
      </div>
157
      <div id="trace" class="box spaced">
158
        % if (@{$exception->frames}) {
159
          <div class="infobox" id="frames">
160
            <table>
161
              % for my $frame (@{$exception->frames}) {
162
                <tr>
163
                  <td class="striped value">
164
                    <pre><%= $frame->[1] . ':' . $frame->[2] %></pre>
165
                  </td>
166
                </tr>
167
              % }
168
            </table>
169
          </div>
170
          <div class="tap">tap for more</div>
171
          %= javascript begin
172
            $('#trace').click(function() {
173
              $('#frames').slideToggle('slow');
174
            });
175
            $('#frames').toggle();
176
          % end
177
        % }
178
      </div>
179
      <div id="request" class="box infobox spaced">
180
        <table>
181
          % my $req = $self->req;
182
          %= $kv->(Method => $req->method)
183
          % my $url = $req->url;
184
          %= $kv->(URL => $url->to_string)
185
          %= $kv->('Base URL' => $url->base->to_string)
186
          %= $kv->(Parameters => dumper $req->params->to_hash)
187
          %= $kv->(Stash => dumper $snapshot)
188
          %= $kv->(Session => dumper session)
189
          %= $kv->(Version => $req->version)
190
          % for my $name (sort @{$self->req->headers->names}) {
191
            % my $value = $self->req->headers->header($name);
192
            %= $kv->($name, $value)
193
          % }
194
        </table>
195
      </div>
196
      <div id="more" class="box infobox spaced">
197
        <div id="infos">
198
          <table>
199
            %= $kv->(Perl => "$^V ($^O)")
200
            % my $version  = $Mojolicious::VERSION;
201
            % my $codename = $Mojolicious::CODENAME;
202
            %= $kv->(Mojolicious => "$version ($codename)")
203
            %= $kv->(Home => app->home)
204
            %= $kv->(Include => dumper \@INC)
205
            %= $kv->(PID => $$)
206
            %= $kv->(Name => $0)
207
            %= $kv->(Executable => $^X)
208
            %= $kv->(Time => scalar localtime(time))
209
          </table>
210
        </div>
211
        <div class="tap">tap for more</div>
212
      </div>
213
    </div>
214
    <div id="footer">
215
      %= link_to 'http://mojolicio.us' => begin
216
        %= image '/mojo/logo-black.png', alt => 'Mojolicious logo'
217
      % end
218
    </div>
219
    %= javascript begin
220
      $('#more').click(function() {
221
        $('#infos').slideToggle('slow');
222
      });
223
      $('#infos').toggle();
224
    % end
225
  </body>
226
</html>