state_change.html.erb 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <html>
  2. <head>
  3. </head>
  4. <body style="font-family: 'Helvetica Neue', Arial, Helvetica; font-size: 14px; color: #333;">
  5. <p><%= link_to "View", query_url(@check.query_id) %></p>
  6. <% if @error %>
  7. <p><%= @error %></p>
  8. <% elsif @rows_count > 0 && @check_type == "bad_data" %>
  9. <p><%= pluralize(@rows_count, "row") %></p>
  10. <p><strong>Sample</strong></p>
  11. <table style="width: 100%; border-spacing: 0; border-collapse: collapse;">
  12. <thead>
  13. <% @columns.first(5).each do |column| %>
  14. <th style="padding: 8px; line-height: 1.4; text-align: left; vertical-align: bottom; border-bottom: 2px solid #ddd; width: <%= (100 / @columns.size).round(2) %>%;">
  15. <%= column %>
  16. </th>
  17. <% end %>
  18. </thead>
  19. <tbody>
  20. <% @rows.first(10).each do |row| %>
  21. <tr>
  22. <% @columns.first(5).each_with_index do |column, i| %>
  23. <td style="padding: 8px; line-height: 1.4; vertical-align: top; border-top: 1px solid #ddd;">
  24. <% value = row[i] %>
  25. <% if @column_types[i] == "time" && value.to_s.length > 10 %>
  26. <% value = Time.parse(value).in_time_zone(Blazer.time_zone) rescue value %>
  27. <% end %>
  28. <%= value %>
  29. </td>
  30. <% end %>
  31. </tr>
  32. <% end %>
  33. </tbody>
  34. </table>
  35. <% end %>
  36. </body>
  37. </html>