1
0

index.html.erb 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <div class='container'>
  2. <div class='row'>
  3. <div class='col-md-12'>
  4. <div class="page-header">
  5. <h2>
  6. Your Events <%= @agent && "from #{@agent.name}" %>
  7. </h2>
  8. </div>
  9. <div class='table-responsive'>
  10. <table class='table table-striped events'>
  11. <tr>
  12. <th>Source</th>
  13. <th>Created</th>
  14. <th>Payload</th>
  15. <th></th>
  16. </tr>
  17. <% @events.each do |event| %>
  18. <% next unless event.agent %>
  19. <%= content_tag :tr, class: (highlighted?(event.id) ? 'hl' : nil) do %>
  20. <td><%= link_to event.agent.name, agent_path(event.agent) %></td>
  21. <td title='<%= event.created_at %>'><%= time_ago_in_words event.created_at %> ago</td>
  22. <td class='payload'><%= truncate event.payload.to_json, :length => 90, :omission => "" %></td>
  23. <td>
  24. <div class="btn-group btn-group-xs">
  25. <%= link_to 'Show', event_path(event), class: "btn btn-default" %>
  26. <%= 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" %>
  27. <%= link_to 'Delete', event_path(event), method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-default" %>
  28. </div>
  29. </td>
  30. <% end %>
  31. <% end %>
  32. </table>
  33. </div>
  34. <%= paginate @events, params: params.slice(:hl), theme: 'twitter-bootstrap-3' %>
  35. <br />
  36. <% if @agent %>
  37. <div class="btn-group">
  38. <%= link_to icon_tag('glyphicon-chevron-left') + ' Back'.html_safe, agents_path, class: "btn btn-default" %>
  39. <%= link_to icon_tag('glyphicon-random') + ' See all events'.html_safe, events_path, class: "btn btn-default" %>
  40. </div>
  41. <% end %>
  42. </div>
  43. </div>
  44. </div>