Sha256: 53c5e554c18fa54ae7bb6543329429ff8653917ffe955773388d3085c2210d6b

Contents?: true

Size: 1.54 KB

Versions: 6

Compression:

Stored size: 1.54 KB

Contents

<!DOCTYPE html>
<html>
<head>
  <title><%= yield(:title) %></title>

  <script src="//cdn.shopify.com/s/assets/external/app.js?<%= Time.now.strftime('%Y%m%d%H') %>"></script>
  <script type="text/javascript">
    // Initialise the Shopify App.
    ShopifyApp.init({
      "apiKey": "<%= ShopifyApp.configuration.api_key %>",
      "shopOrigin": "<%= "https://#{ @shop_session.domain }" if @shop_session %>",
      "debug": <%= Rails.env.development? ? 'true' : 'false' %>
    });
  </script>

  <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload', 'data-turbolinks-eval': false %>
  <%= csrf_meta_tags %>

  <%= yield :extra_head %>
</head>
<body>
  <script type="text/javascript">
    window.DiscoApp = {
      INITIAL_TITLE: "<%= yield(:title) %>",
      INITIAL_ICON: "<%= image_url("disco_app/icon.svg") %>",
      INITIAL_BUTTONS: <%= content_for?(:buttons) ? content_for(:buttons) : '{}' %>,
      INITIAL_BREADCRUMB: <%= content_for?(:breadcrumb) ? content_for(:breadcrumb) : 'undefined' %>
    };
    ShopifyApp.Bar.initialize({
      title: DiscoApp.INITIAL_TITLE,
      icon: DiscoApp.INITIAL_ICON,
      buttons: DiscoApp.INITIAL_BUTTONS,
      breadcrumb: DiscoApp.INITIAL_BREADCRUMB
    });
  </script>

  <%= yield %>

  <% flash.each do |key, message| %>
  <script type="text/javascript">
    ShopifyApp.flash<%= (key == 'error') ? 'Error' : 'Notice' %>('<%= message %>');
  </script>
  <% end %>

  <%= render 'disco_app/shared/icons' %>
</body>
</html>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
disco_app-0.18.0 app/views/layouts/embedded_app.html.erb
disco_app-0.18.2 app/views/layouts/embedded_app.html.erb
disco_app-0.18.3 app/views/layouts/embedded_app.html.erb
disco_app-0.18.6 app/views/layouts/embedded_app.html.erb
disco_app-0.18.4 app/views/layouts/embedded_app.html.erb
disco_app-0.18.1 app/views/layouts/embedded_app.html.erb