Commit 98db4dcfdbaa114fe1f3764291842708e5b63824

Authored by Nick Recobra
1 parent 7c74f710
Exists in master and in 1 other branch production

More information for feed entries.

app/helpers/notices_helper.rb 0 → 100644
... ... @@ -0,0 +1,6 @@
  1 +# encoding: utf-8
  2 +module NoticesHelper
  3 + def notice_atom_summary notice
  4 + render :partial => "notices/atom_entry.html.haml", :locals => {:notice => notice}
  5 + end
  6 +end
0 7 \ No newline at end of file
... ...
app/views/errs/index.atom.builder
... ... @@ -3,9 +3,16 @@ atom_feed do |feed|
3 3 feed.updated(@errs.first.created_at)
4 4  
5 5 for err in @errs
  6 + notice = err.notices.first
  7 +
6 8 feed.entry(err, :url => app_err_url(err.app, err)) do |entry|
7   - entry.title "[#{ err.environment }] #{ err.app.name } at \"#{ err.where }\""
8   - entry.summary(err.notices.first.try(:message))
  9 + entry.title "[#{ err.where }] #{err.message.to_s.truncate(27)}"
  10 + entry.author do |author|
  11 + author.name "#{ err.app.name } [#{ err.environment }]"
  12 + end
  13 + if notice
  14 + entry.summary(notice_atom_summary(notice), :type => "html")
  15 + end
9 16 end
10 17 end
11 18 end
... ...
app/views/notices/_atom_entry.html.haml 0 → 100644
... ... @@ -0,0 +1,41 @@
  1 +%h2= notice.message
  2 +%h3 Summary
  3 +- if notice.request['url'].present?
  4 + %p
  5 + %strong URL:
  6 + = link_to(notice.request['url'], notice.request['url'])
  7 +%p
  8 + %strong Where:
  9 + = notice.err.where
  10 +%p
  11 + %strong Occured:
  12 + = notice.created_at.to_s(:micro)
  13 +%p
  14 + %strong Similar:
  15 + = notice.err.notices.count - 1
  16 +
  17 +%h3 Params
  18 +%p= pretty_hash(notice.params)
  19 +
  20 +%h3 Session
  21 +%p= pretty_hash(notice.session)
  22 +
  23 +%h3 Backtrace
  24 +%table
  25 + - for line in notice.backtrace
  26 + %tr
  27 + %td
  28 + = "#{line['number']}:"
  29 +   
  30 + %td
  31 + = raw "#{h line['file'].sub(/^\[PROJECT_ROOT\]/, '')} -> #{content_tag :strong, h(line['method'])}"
  32 +
  33 +%h3 Environment
  34 +%table
  35 + - for key, val in notice.env_vars
  36 + %tr
  37 + %td
  38 + = h key
  39 + %td
  40 + = h val
  41 +
... ...