index.html.erb 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <% title "Checks" %>
  2. <p style="float: right;"><%= link_to "New Check", new_check_path, class: "btn btn-info" %></p>
  3. <p>
  4. <%= link_to "Home", root_path, class: "btn btn-primary", style: "margin-right: 10px;" %>
  5. </p>
  6. <% colors = {failing: "red", passing: "#5cb85c", error: "#666"} %>
  7. <table class="table">
  8. <thead>
  9. <tr>
  10. <th>Query</th>
  11. <th style="width: 15%;">State</th>
  12. <th style="width: 20%;">Emails</th>
  13. <th style="width: 15%;"></th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <% @checks.each do |check| %>
  18. <tr>
  19. <td><%= link_to check.blazer_query.name, check.blazer_query %></td>
  20. <td>
  21. <% if check.state %>
  22. <small style="font-weight: bold; color: <%= colors[check.state.to_sym] %>;"><%= check.state.upcase %></small>
  23. <% end %>
  24. </td>
  25. <td>
  26. <ul class="list-unstyled" style="margin-bottom: 0;">
  27. <% check.split_emails.each do |email| %>
  28. <li><%= email %></li>
  29. <% end %>
  30. </ul>
  31. </td>
  32. <td style="text-align: right; padding: 1px;">
  33. <%= link_to "Edit", edit_check_path(check), class: "btn btn-info" %>
  34. <%= link_to "Run Now", run_check_path(check), class: "btn btn-primary" %>
  35. </td>
  36. </tr>
  37. <% end %>
  38. </tbody>
  39. </table>