index.html.erb 2.3 KB

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