application.html.erb 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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" : "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. <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
  13. <link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
  14. <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
  15. <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
  16. <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
  17. <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
  18. <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
  19. <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
  20. <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
  21. <link rel="icon" type="image/vnd.microsoft.icon" href="/favicon.ico" sizes="16x16">
  22. <link rel="icon" type="image/png" href="/android-chrome-48x48.png" sizes="48x48">
  23. <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
  24. <link rel="manifest" href="/manifest.json">
  25. <%= yield(:ace_editor_script) %>
  26. <%= yield(:head) %>
  27. </head>
  28. <body>
  29. <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
  30. <div class="container">
  31. <%= render 'layouts/navigation' %>
  32. </div>
  33. </nav>
  34. <div id="main" role="main">
  35. <div class="container">
  36. <div class="row">
  37. <%= render 'layouts/messages' %>
  38. </div>
  39. </div>
  40. <% if user_signed_in? %>
  41. <%= render "upgrade_warning" %>
  42. <% end %>
  43. <div id="main-content">
  44. <%= yield %>
  45. </div>
  46. </div>
  47. <script>
  48. window.agentPaths = {};
  49. window.agentNames = [];
  50. <% if current_user.present? -%>
  51. var myAgents = <%= Utils.jsonify(current_user.agents.pluck(:name, :id).inject({}) {|m, a| next if a.last.nil?; m[a.first] = agent_path(a.last); m }) %>;
  52. var myScenarios = <%= Utils.jsonify(current_user.scenarios.pluck(:name, :id).inject({}) {|m, s| m[s.first + " Scenario"] = scenario_path(s.last); m }) %>;
  53. $.extend(window.agentPaths, myAgents);
  54. $.extend(window.agentPaths, myScenarios);
  55. window.agentPaths["All Agents Index"] = <%= Utils.jsonify agents_path %>;
  56. window.agentPaths["New Agent"] = <%= Utils.jsonify new_agent_path %>;
  57. window.agentPaths["Account"] = <%= Utils.jsonify edit_user_registration_path %>;
  58. window.agentPaths["Events Index"] = <%= Utils.jsonify events_path %>;
  59. window.agentPaths["View Agent Diagram"] = <%= Utils.jsonify diagram_path %>;
  60. window.agentPaths["Run Event Propagation"] = { url: <%= Utils.jsonify propagate_agents_path %>, method: 'POST' };
  61. $.each(window.agentPaths, function(name, v) { window.agentNames.push(name); });
  62. <% end -%>
  63. </script>
  64. </body>
  65. </html>