%h1=@title

%h2 Error details
%code.signature{class: "#{@report.source}-signature"}=@report.signature
%code.backtrace{class: "#{@report.source}-backtrace"}=@report.backtrace.gsub(/\n+\s+/, '<br>&nbsp;&nbsp;').html_safe

%h2 Request details
.request-details
  %table
    %tr
      %th Response code
      %td=@request.response
    - @request.data.each do |key, value|
      - if key.to_s == 'user'
        - if @user
          %tr
            %th User ID
            %td=@user.id
          %tr
            %th User Email
            %td=@user.email
          %tr
            %th User Name
            %td=@user.firstname
        - else
          %tr
            %th User ID
            %td NULL
        %tr.spacer
          %td{ colspan: 2 }
      - else
        %tr
          %th=key.to_s.titlecase
          %td
            - if value.is_a?(Hash)
              %table
                - value.each do |k, v|
                  %tr
                    %th=k
                    %td=v
            - else
              = value.to_s
