application.html.erb 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  7. <title><%= Setting.get('product_name') %></title>
  8. <link rel="apple-touch-icon" href="apple-touch-icon.png" />
  9. <%= stylesheet_link_tag "application", :media => 'all' %>
  10. <%= stylesheet_link_tag "application-print", :media => 'print' %>
  11. <%= javascript_tag nonce: true do -%>
  12. if(window.MSInputMethodContext && document.documentMode){
  13. var polyfillScriptTag = document.createElement('script');
  14. polyfillScriptTag.setAttribute('src', '<%= path_to_javascript('ie11CustomProperties.min') %>');
  15. polyfillScriptTag.setAttribute('nonce', '<%= content_security_policy_nonce %>');
  16. document.head.appendChild(polyfillScriptTag);
  17. }
  18. try {
  19. if(window.matchMedia('(prefers-color-scheme: dark)').matches && localStorage.getItem('theme') != 'light' && !window.location.href.includes('/tests_') ){
  20. document.documentElement.dataset.theme = 'dark';
  21. }
  22. } catch (e) { };
  23. <% end -%>
  24. <% if Rails.configuration.assets.debug %>
  25. <%= javascript_include_tag "application", nonce: true %>
  26. <% else %>
  27. <%= javascript_include_tag "application", nonce: true, :defer => 'defer' %>
  28. <% end %>
  29. <%# Statically include external files with a nonce here to conform to CSP properly. %>
  30. <%# Required by form channel configuration preview. %>
  31. <%= javascript_include_tag "../assets/form/form.js", nonce: true, :defer => 'defer', :skip_pipeline => true, :id => "zammad_form_script" %>
  32. <%# Required for browser time mocking in tests. %>
  33. <% if Rails.env.test? %>
  34. <%= javascript_include_tag "../assets/tests/sinon-9.2.4.js", nonce: true, :skip_pipeline => true, :id => "zammad_form_script" %>
  35. <% end %>
  36. <%= csrf_meta_tags %>
  37. </head>
  38. <body>
  39. <%= content_for?(:content) ? yield(:content) : yield %>
  40. </body>
  41. </html>