2011-04-07 01:38:48 +08:00
|
|
|
<%
|
2011-06-10 02:42:30 +08:00
|
|
|
content_for :page_title, t("#titles.error_reports", "Error Reports")
|
|
|
|
add_crumb t("#crumbs.error_reports", "Error Reports")
|
2011-04-07 01:38:48 +08:00
|
|
|
%>
|
2011-04-29 04:41:33 +08:00
|
|
|
|
2011-09-13 03:09:07 +08:00
|
|
|
<% unless params[:action] == 'show' %>
|
2011-04-29 04:41:33 +08:00
|
|
|
<% form_for @current_user, :url => '/error_reports', :html => { :method => :get } do |f| %>
|
2011-06-10 02:42:30 +08:00
|
|
|
<%= t :message_contains, "Message contains" %>
|
2011-04-29 04:41:33 +08:00
|
|
|
<input type="text" name="message" value="<%= @message %>" style="width: 250px;"/>
|
2011-05-12 00:31:07 +08:00
|
|
|
<select name="category">
|
2011-06-10 02:42:30 +08:00
|
|
|
<%= options_for_select(([[t(:all_categories, " - All Categories -"), nil]] + ErrorReport.all(:select => 'DISTINCT category').map(&:category)).compact, params[:category]) %>
|
2011-05-12 00:31:07 +08:00
|
|
|
</select>
|
2011-06-10 02:42:30 +08:00
|
|
|
<button type="submit" class="button"><%= t "#buttons.search", "Search" %></button>
|
2011-04-29 04:41:33 +08:00
|
|
|
<% end %>
|
2011-09-13 03:09:07 +08:00
|
|
|
<% end %>
|
2011-04-29 04:41:33 +08:00
|
|
|
|
2011-06-24 23:08:40 +08:00
|
|
|
<% content_for :pagination do %>
|
2011-06-25 04:38:46 +08:00
|
|
|
<% if params[:action] == 'index' %>
|
2011-06-24 23:08:40 +08:00
|
|
|
<div class='pagination'>
|
|
|
|
<% if params[:page] > 1 %>
|
|
|
|
<%= link_to('< Prev', params.merge(:page => (params[:page] - 1))) %>
|
|
|
|
<% end %>
|
|
|
|
<%= link_to('Next >', params.merge(:page => (params[:page] + 1))) %>
|
|
|
|
</div>
|
2011-06-25 04:38:46 +08:00
|
|
|
<% end %>
|
2011-06-24 23:08:40 +08:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= yield :pagination %>
|
|
|
|
|
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-06-10 02:42:30 +08:00
|
|
|
<%= before_label :category, "category" %> <%= report.category || t(:default_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| %>
|
2011-06-10 02:42:30 +08:00
|
|
|
<br><%= before_label k.to_s %> <%= v %>
|
2011-05-11 00:48:37 +08:00
|
|
|
<% 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 %>
|
2011-06-24 23:08:40 +08:00
|
|
|
|
|
|
|
<%= yield :pagination %>
|