_navigation.html.erb 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <div class="navbar-header">
  2. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
  3. <span class="sr-only">Toggle navigation</span>
  4. <span class="icon-bar"></span>
  5. <span class="icon-bar"></span>
  6. <span class="icon-bar"></span>
  7. </button>
  8. <%= link_to "Huginn", root_path, :class => 'navbar-brand' %>
  9. </div>
  10. <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  11. <% if user_signed_in? %>
  12. <ul class='nav navbar-nav'>
  13. <%= nav_link "Agents", agents_path do %>
  14. <ul class='dropdown-menu' role='menu'>
  15. <%= nav_link "New Agent", new_agent_path, glyphicon: "plus" %>
  16. <%= nav_link "Run event propagation", propagate_agents_path, method: 'post', glyphicon: "refresh" %>
  17. <%= nav_link "View Diagram", diagram_path, glyphicon: 'random' %>
  18. </ul>
  19. <% end %>
  20. <%= nav_link "Scenarios", scenarios_path %>
  21. <%= nav_link "Events", events_path %>
  22. <%= nav_link "Credentials", user_credentials_path %>
  23. <%= nav_link "Services", services_path %>
  24. </ul>
  25. <% end %>
  26. <ul class="nav navbar-nav navbar-right">
  27. <% if user_signed_in? %>
  28. <form class="navbar-form navbar-left visible-lg" role="search">
  29. <div class="form-group">
  30. <input type="text" class="form-control" id='agent-navigate' autocomplete="off" placeholder="Search">
  31. <%= image_tag "spinner-arrows.gif", :class => "spinner" %>
  32. </div>
  33. </form>
  34. <li class='job-indicator' role='pending'>
  35. <%= link_to current_user.admin? ? jobs_path : '#', class: 'visible-lg' do %>
  36. <span class="badge"><span class="glyphicon glyphicon-refresh icon-white"></span> <span class='number'>0</span></span>
  37. <% end %>
  38. </li>
  39. <li class='job-indicator' role='awaiting_retry'>
  40. <%= link_to current_user.admin? ? jobs_path : '#', class: 'visible-lg' do %>
  41. <span class="badge"><span class="glyphicon glyphicon-question-sign icon-yellow"></span> <span class='number'>0</span></span>
  42. <% end %>
  43. </li>
  44. <li class='job-indicator' role='recent_failures'>
  45. <%= link_to current_user.admin? ? jobs_path : '#', class: 'hidden-sm hidden-xs' do %>
  46. <span class="badge"><span class="glyphicon glyphicon-exclamation-sign icon-white"></span> <span class='number'>0</span></span>
  47. <% end %>
  48. </li>
  49. <li id='event-indicator'>
  50. <a href="#" class='hidden-sm hidden-xs'>
  51. <span class="badge"><span class="glyphicon glyphicon-random icon-white"></span> <span class='number'>0</span> new events</span>
  52. </a>
  53. </li>
  54. <% end %>
  55. <li class="dropdown">
  56. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  57. Account
  58. <b class="caret"></b>
  59. </a>
  60. <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
  61. <li>
  62. <% if user_signed_in? %>
  63. <%= link_to 'Account', edit_user_registration_path, :tabindex => "-1" %>
  64. <% else %>
  65. <%= link_to 'Sign up', new_user_registration_path, :tabindex => "-1" %>
  66. <% end %>
  67. </li>
  68. <% if user_signed_in? && current_user.admin %>
  69. <li>
  70. <%= link_to 'Job Management', jobs_path, :tabindex => '-1' %>
  71. </li>
  72. <% end %>
  73. <li>
  74. <%= link_to 'About', 'https://github.com/cantino/huginn', :tabindex => "-1" %>
  75. </li>
  76. <li>
  77. <% if user_signed_in? %>
  78. <%= link_to 'Logout', destroy_user_session_path, :method => :delete, :tabindex => "-1" %>
  79. <% else %>
  80. <%= link_to 'Login', new_user_session_path, :tabindex => "-1" %>
  81. <% end %>
  82. </li>
  83. </ul>
  84. </li>
  85. </ul>
  86. </div>