1
0

index.html.erb 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. <%= scenario_label(scenario, icon('fa-solid', scenario.icon.presence || 'gear'))%>
  23. <%= link_to(scenario.name, scenario) %>
  24. </td>
  25. <td><%= link_to pluralize(scenario.agents.count, "agent"), scenario %></td>
  26. <td><%= scenario.public? ? "yes" : "no" %></td>
  27. <td>
  28. <div class="btn-group btn-group-xs" style="float: right">
  29. <%= link_to 'Show', scenario, class: "btn btn-default" %>
  30. <%= link_to 'Edit', edit_scenario_path(scenario), class: "btn btn-default" %>
  31. <%= link_to 'Share', share_scenario_path(scenario), class: "btn btn-default" %>
  32. <%= link_to 'Delete', '#', data: { toggle: 'modal', target: "#confirm-scenario-deletion-#{scenario.id}"}, class: "btn btn-default" %>
  33. </div>
  34. <%= render 'scenarios/confirm_deletion_modal', scenario: scenario %>
  35. </td>
  36. </tr>
  37. <% end %>
  38. </table>
  39. <%= paginate @scenarios, :theme => 'twitter-bootstrap-3' %>
  40. <br/>
  41. <div class="btn-group">
  42. <%= link_to icon_tag('glyphicon-plus') + ' New Scenario'.html_safe, new_scenario_path, class: "btn btn-default" %>
  43. <%= link_to icon_tag('glyphicon-cloud-upload') + ' Import Scenario'.html_safe, new_scenario_imports_path, class: "btn btn-default" %>
  44. </div>
  45. </div>
  46. </div>
  47. </div>