index.html.erb 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <% content_for :title, (@agent ? @agent.name + "'s " : "") + "Events" -%>
  2. <div class='container'>
  3. <div class='row'>
  4. <div class='col-md-12'>
  5. <div class="page-header">
  6. <h2>
  7. Your Events
  8. <% if @agent %>
  9. from <%= @agent.name %>
  10. <%= render 'agents/mini_action_menu', agent: @agent, return_to: request.path %>
  11. <% end %>
  12. </h2>
  13. </div>
  14. <div class='table-responsive'>
  15. <table class='table table-striped events'>
  16. <tr>
  17. <% unless @agent %>
  18. <th>Source</th>
  19. <% end %>
  20. <th>Created</th>
  21. <th>Payload</th>
  22. <th></th>
  23. </tr>
  24. <% @events.each do |event| %>
  25. <% next unless event.agent %>
  26. <%= content_tag :tr, class: (highlighted?(event.id) ? 'hl' : nil) do %>
  27. <% unless @agent %>
  28. <td><%= link_to event.agent.name, agent_path(event.agent, return: request.fullpath) %></td>
  29. <% end %>
  30. <td title='<%= event.created_at %>'><%= time_ago_in_words event.created_at %> ago</td>
  31. <td class='payload'><%= truncate event.payload.to_json, :length => 90, :omission => "" %></td>
  32. <td>
  33. <div class="btn-group btn-group-xs">
  34. <%= link_to 'Show', event_path(event, return: request.fullpath), class: "btn btn-default" %>
  35. <%= link_to 'Re-emit', reemit_event_path(event), method: :post, data: { confirm: 'Are you sure you want to duplicate this event and emit the new one now?' }, class: "btn btn-default" %>
  36. <%= link_to 'Delete', event_path(event), method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-default" %>
  37. </div>
  38. </td>
  39. <% end %>
  40. <% end %>
  41. </table>
  42. </div>
  43. <%= paginate @events, params: params.to_unsafe_h.slice(:hl), theme: 'twitter-bootstrap-3' %>
  44. <br />
  45. <% if @agent %>
  46. <div class="btn-group">
  47. <%= link_to icon_tag('glyphicon-chevron-left') + ' Back'.html_safe, filtered_agent_return_link || agents_path, class: "btn btn-default" %>
  48. <%= link_to icon_tag('glyphicon-random') + ' See all events'.html_safe, events_path, class: "btn btn-default" %>
  49. </div>
  50. <% end %>
  51. </div>
  52. </div>
  53. </div>