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