diff --git a/app/helpers/notices_helper.rb b/app/helpers/notices_helper.rb new file mode 100644 index 0000000..bd4974b --- /dev/null +++ b/app/helpers/notices_helper.rb @@ -0,0 +1,6 @@ +# encoding: utf-8 +module NoticesHelper + def notice_atom_summary notice + render :partial => "notices/atom_entry.html.haml", :locals => {:notice => notice} + end +end \ No newline at end of file diff --git a/app/views/errs/index.atom.builder b/app/views/errs/index.atom.builder index 256d5d5..1183f66 100644 --- a/app/views/errs/index.atom.builder +++ b/app/views/errs/index.atom.builder @@ -3,9 +3,16 @@ atom_feed do |feed| feed.updated(@errs.first.created_at) for err in @errs + notice = err.notices.first + feed.entry(err, :url => app_err_url(err.app, err)) do |entry| - entry.title "[#{ err.environment }] #{ err.app.name } at \"#{ err.where }\"" - entry.summary(err.notices.first.try(:message)) + entry.title "[#{ err.where }] #{err.message.to_s.truncate(27)}" + entry.author do |author| + author.name "#{ err.app.name } [#{ err.environment }]" + end + if notice + entry.summary(notice_atom_summary(notice), :type => "html") + end end end end diff --git a/app/views/notices/_atom_entry.html.haml b/app/views/notices/_atom_entry.html.haml new file mode 100644 index 0000000..7396862 --- /dev/null +++ b/app/views/notices/_atom_entry.html.haml @@ -0,0 +1,41 @@ +%h2= notice.message +%h3 Summary +- if notice.request['url'].present? + %p + %strong URL: + = link_to(notice.request['url'], notice.request['url']) +%p + %strong Where: + = notice.err.where +%p + %strong Occured: + = notice.created_at.to_s(:micro) +%p + %strong Similar: + = notice.err.notices.count - 1 + +%h3 Params +%p= pretty_hash(notice.params) + +%h3 Session +%p= pretty_hash(notice.session) + +%h3 Backtrace +%table + - for line in notice.backtrace + %tr + %td + = "#{line['number']}:" +    + %td + = raw "#{h line['file'].sub(/^\[PROJECT_ROOT\]/, '')} -> #{content_tag :strong, h(line['method'])}" + +%h3 Environment +%table + - for key, val in notice.env_vars + %tr + %td + = h key + %td + = h val + -- libgit2 0.21.2