1
0

index.html.erb 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <% content_for :title, "Scenarios" -%>
  2. <div class='container'>
  3. <div class='row'>
  4. <div class='col-md-12'>
  5. <div class="page-header">
  6. <h2>
  7. Your Scenarios
  8. </h2>
  9. </div>
  10. <blockquote>Scenarios are named groups of Agents. Scenarios allow you to organize your agents,
  11. and to import and export sets of Agents to share.</blockquote>
  12. <table class='table table-striped'>
  13. <tr>
  14. <th><%= sortable_column 'name', 'asc' %></th>
  15. <th>Agents</th>
  16. <th><%= sortable_column 'public' %></th>
  17. <th></th>
  18. </tr>
  19. <% @scenarios.each do |scenario| %>
  20. <tr>
  21. <td>
  22. <% if scenario.icon.blank? %>
  23. <%= scenario_label(scenario, icon('gear'))%>
  24. <% else %>
  25. <%= scenario_label(scenario, icon(scenario.icon))%>
  26. <% end %>
  27. <%= link_to(scenario.name, scenario) %>
  28. </td>
  29. <td><%= link_to pluralize(scenario.agents.count, "agent"), scenario %></td>
  30. <td><%= scenario.public? ? "yes" : "no" %></td>
  31. <td>
  32. <div class="btn-group btn-group-xs" style="float: right">
  33. <%= link_to 'Show', scenario, class: "btn btn-default" %>
  34. <%= link_to 'Edit', edit_scenario_path(scenario), class: "btn btn-default" %>
  35. <%= link_to 'Share', share_scenario_path(scenario), class: "btn btn-default" %>
  36. <%= link_to 'Delete', '#', data: { toggle: 'modal', target: "#confirm-scenario-deletion-#{scenario.id}"}, class: "btn btn-default" %>
  37. </div>
  38. <%= render 'scenarios/confirm_deletion_modal', scenario: scenario %>
  39. </td>
  40. </tr>
  41. <% end %>
  42. </table>
  43. <%= paginate @scenarios, :theme => 'twitter-bootstrap-3' %>
  44. <br/>
  45. <div class="btn-group">
  46. <%= link_to icon_tag('glyphicon-plus') + ' New Scenario'.html_safe, new_scenario_path, class: "btn btn-default" %>
  47. <%= link_to icon_tag('glyphicon-cloud-upload') + ' Import Scenario'.html_safe, new_scenario_imports_path, class: "btn btn-default" %>
  48. </div>
  49. </div>
  50. </div>
  51. </div>