index.html.erb 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <div class='container'>
  2. <div class='row'>
  3. <div class='col-md-12'>
  4. <div class="page-header">
  5. <h2>
  6. Your Scenarios
  7. </h2>
  8. </div>
  9. <blockquote>Scenarios are named groups of Agents. Scenarios allow you to organize your agents,
  10. and to import and export sets of Agents to share.</blockquote>
  11. <table class='table table-striped'>
  12. <tr>
  13. <th><%= sortable_column 'name', 'asc' %></th>
  14. <th>Agents</th>
  15. <th><%= sortable_column 'public' %></th>
  16. <th></th>
  17. </tr>
  18. <% @scenarios.each do |scenario| %>
  19. <tr>
  20. <td>
  21. <%= scenario_label(scenario, content_tag(:i, '', class: 'glyphicon glyphicon-font')) %>
  22. <%= link_to(scenario.name, scenario) %>
  23. </td>
  24. <td><%= link_to pluralize(scenario.agents.count, "agent"), scenario %></td>
  25. <td><%= scenario.public? ? "yes" : "no" %></td>
  26. <td>
  27. <div class="btn-group btn-group-xs" style="float: right">
  28. <%= link_to 'Show', scenario, class: "btn btn-default" %>
  29. <%= link_to 'Edit', edit_scenario_path(scenario), class: "btn btn-default" %>
  30. <%= link_to 'Share', share_scenario_path(scenario), class: "btn btn-default" %>
  31. <%= link_to 'Delete', scenario_path(scenario), method: :delete, data: { confirm: "This will remove the '#{scenario.name}' Scenerio from all Agents and delete it. Are you sure?" }, class: "btn btn-default" %>
  32. </div>
  33. </td>
  34. </tr>
  35. <% end %>
  36. </table>
  37. <%= paginate @scenarios, :theme => 'twitter-bootstrap' %>
  38. <br/>
  39. <div class="btn-group">
  40. <%= link_to icon_tag('glyphicon-plus') + ' New Scenario'.html_safe, new_scenario_path, class: "btn btn-default" %>
  41. <%= link_to icon_tag('glyphicon-cloud-upload') + ' Import Scenario'.html_safe, new_scenario_imports_path, class: "btn btn-default" %>
  42. </div>
  43. </div>
  44. </div>
  45. </div>