index.mustache 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <%
  2. # Copyright (C) 2011 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <%
  19. content_for :page_title, t("#titles.error_reports", "Error Reports")
  20. add_crumb t("#crumbs.error_reports", "Error Reports")
  21. %>
  22. <%= form_for @current_user, :url => '/error_reports', :html => { :method => :get } do |f| %>
  23. <% if error_search_enabled? %>
  24. <%= t :message_contains, "Message contains" %>
  25. <input type="text" name="message" value="<%= @message %>" style="width: 250px;"/>
  26. <% end %>
  27. <select name="category">
  28. <%= options_for_select([[t(:all_categories, " - All Categories -"), nil]] + ErrorReport.categories, params[:category]) %>
  29. </select>
  30. <button type="submit" class="btn"><%= t "#buttons.search", "Search" %></button>
  31. <% end %>
  32. <% content_for :pagination do %>
  33. <% if params[:action] == 'index' %>
  34. <%= will_paginate(@reports, :page_links => false) %>
  35. <% end %>
  36. <% end %>
  37. <%= yield :pagination %>
  38. <% @reports.each do |report| %>
  39. <div style="margin-bottom: 20px;">
  40. <h3>
  41. <%= link_to "##{report.id}", error_url(report) %>
  42. <% if @reports.length > 1 %>
  43. <%= truncate(report.message, :length => 80) %>
  44. <% else %>
  45. <%= report.message %>
  46. <% end %>
  47. </h3>
  48. <div style="border: 1px solid #eee; -moz-border-radius: 5px; padding: 5px 20px;">
  49. <% if report.account_id %>
  50. <%= before_label :account, "account" %> <%= link_to report.account.try(:name), account_url(report.account_id) %><br />
  51. <% end %>
  52. <%= before_label :category, "category" %> <%= report.category || t(:default_category, 'default') %><br/>
  53. <%= before_label :created_at, "created at" %> <%= report.created_at %><br />
  54. <% if report.user_id %>
  55. <%= before_label :user, "user" %> <%= link_to report.user.try(:name), user_url(report.user_id) %><br />
  56. <% end %>
  57. <% if report.url.present? %>
  58. <%= before_label :url, "url" %>
  59. <%=
  60. if report.safe_url?
  61. link_to report.url, report.url
  62. else
  63. report.url
  64. end
  65. %><br />
  66. <% end %>
  67. <% if report.request_context_id %>
  68. <%= before_label :request_context_id, "request context id" %> <%= report.request_context_id %><br />
  69. <% end %>
  70. <% if report.comments %>
  71. <%= before_label :comments, "comments" %> <%= report.comments %><br />
  72. <% end %>
  73. <% (report.data || {}).to_a.sort.each do |k,v| %>
  74. <% next if k.to_s == "exception_message" %>
  75. <br><%= before_label k.to_s %> <%= v %>
  76. <% end %>
  77. <br />
  78. <pre style="font-size: 0.8em; margin-left: 20px; <%= "max-height: 150px;" if @reports.length > 1 %> overflow: auto;">
  79. <%= report.data.try(:[], "exception_message") %><br />
  80. <%= report.backtrace %>
  81. </pre>
  82. </div>
  83. </div>
  84. <% end %>
  85. <%= yield :pagination %>