Nenhuma Descrição http://j1x-huginn.herokuapp.com

application.html.erb 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title><%= content_for?(:title) ? yield(:title) : "Huginn" %></title>
  7. <meta name="description" content="">
  8. <meta name="author" content="">
  9. <%= stylesheet_link_tag "application", :media => "all" %>
  10. <%= javascript_include_tag "application" %>
  11. <%= csrf_meta_tags %>
  12. <%= yield(:ace_editor_script) %>
  13. <%= yield(:head) %>
  14. </head>
  15. <body>
  16. <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
  17. <div class="container">
  18. <%= render 'layouts/navigation' %>
  19. </div>
  20. </nav>
  21. <div id="main" role="main">
  22. <div class="container">
  23. <div class="row">
  24. <%= render 'layouts/messages' %>
  25. </div>
  26. </div>
  27. <% if user_signed_in? %>
  28. <%= render "upgrade_warning" %>
  29. <% end %>
  30. <div id="main-content">
  31. <%= yield %>
  32. </div>
  33. </div>
  34. <script>
  35. window.agentPaths = {};
  36. window.agentNames = [];
  37. <% if current_user.present? -%>
  38. var myAgents = <%= Utils.jsonify(current_user.agents.pluck(:name, :id).inject({}) {|m, a| m[a.first] = agent_path(a.last); m }) %>;
  39. var myScenarios = <%= Utils.jsonify(current_user.scenarios.pluck(:name, :id).inject({}) {|m, s| m[s.first + " Scenario"] = scenario_path(s.last); m }) %>;
  40. $.extend(window.agentPaths, myAgents);
  41. $.extend(window.agentPaths, myScenarios);
  42. window.agentPaths["All Agents Index"] = <%= Utils.jsonify agents_path %>;
  43. window.agentPaths["New Agent"] = <%= Utils.jsonify new_agent_path %>;
  44. window.agentPaths["Account"] = <%= Utils.jsonify edit_user_registration_path %>;
  45. window.agentPaths["Events Index"] = <%= Utils.jsonify events_path %>;
  46. window.agentPaths["View Agent Diagram"] = <%= Utils.jsonify diagram_path %>;
  47. window.agentPaths["Run Event Propagation"] = { url: <%= Utils.jsonify propagate_agents_path %>, method: 'POST' };
  48. $.each(window.agentPaths, function(name, v) { window.agentNames.push(name); });
  49. <% end -%>
  50. </script>
  51. </body>
  52. </html>