show.html.erb 1.3 KB

1234567891011121314151617181920212223242526272829
  1. <% content_for :title, (@scenario ? @scenario.name + "'s " : "") + "Agent event flow" -%>
  2. <% content_for :head do %>
  3. <%= javascript_include_tag "diagram" %>
  4. <% end %>
  5. <div class='container'>
  6. <div class='row'>
  7. <div class='col-md-12'>
  8. <div class="page-header">
  9. <h2>Agent Event Flow</h2>
  10. </div>
  11. <div class="btn-group">
  12. <%= link_to icon_tag('glyphicon-chevron-left') + ' Back'.html_safe, (@scenario ? scenario_path(@scenario) : agents_path), class: "btn btn-default" %>
  13. <% if (num_disabled = @disabled_agents.count).nonzero? -%>
  14. <% if params[:exclude_disabled] %>
  15. <%= link_to @scenario ? scenario_diagram_path(@scenario) : diagram_path, class: 'btn btn-default' do %><%= icon_tag('glyphicon-eye-open') %> Show <%= pluralize(num_disabled, 'disabled Agent') %><% end %>
  16. <% else %>
  17. <%= link_to @scenario ? scenario_diagram_path(@scenario, exclude_disabled: true) : diagram_path(exclude_disabled: true), class: 'btn btn-default' do %><%= icon_tag('glyphicon-eye-close') %> Hide <%= pluralize(num_disabled, 'disabled Agent') %><% end %>
  18. <% end %>
  19. <% end %>
  20. </div>
  21. <div class='digraph'>
  22. <%= render_agents_diagram(@agents, layout: params[:layout]) %>
  23. </div>
  24. </div>
  25. </div>
  26. </div>