canvas-lms/app/views/errors/index.html.erb

43 lines
1.4 KiB
Plaintext
Raw Normal View History

<%
content_for :page_title, "Error Reports"
add_crumb "Error Reports"
%>
<% form_for @current_user, :url => '/error_reports', :html => { :method => :get } do |f| %>
Message contains
<input type="text" name="message" value="<%= @message %>" style="width: 250px;"/>
<select name="category">
<%= options_for_select(([['- All Categories -', nil]] + ErrorReport.all(:select => 'DISTINCT category').map(&:category)).compact, params[:category]) %>
</select>
<button type="submit" class="button">Search</button>
<% end %>
<%= will_paginate(@reports) %>
2011-02-01 09:57:29 +08:00
<% @reports.each do |report| %>
<div style="margin-bottom: 20px;">
<h3>
<%= link_to "##{report.id}", error_url(report) %>
<% if @reports.length > 1 %>
<%= truncate(report.message, :length => 80) %>
<% else %>
<%= report.message %>
<% end %>
</h3>
<div style="border: 1px solid #eee; -moz-border-radius: 5px; padding: 5px 20px;">
category: <%= report.category || 'default' %><br/>
<%= report.created_at %><br />
<%= report.url %><br/>
<% if report.user_id %>
<%= link_to report.user.try(:name), user_url(report.user_id) %>
<% end %>
<% (report.data || {}).each do |k,v| %>
<br><%= k %>: <%= v %>
<% end %>
<pre style="font-size: 0.8em; margin-left: 20px; <%= "max-height: 150px;" if @reports.length > 1 %> overflow: auto;">
<%= report.backtrace %>
2011-02-01 09:57:29 +08:00
</pre>
</div>
</div>
<% end %>