Sha256: 42f024f50a24e02711d5c6aa49dfa2d7a4337139e00c50991102259afe656747

Contents?: true

Size: 1.9 KB

Versions: 16

Compression:

Stored size: 1.9 KB

Contents

<%= render 'spree/admin/shared/product_tabs', current: :properties %>
<%= render 'spree/admin/shared/error_messages', target: @product %>

<% content_for :page_actions do %>
  <%= product_preview_link(@product) %>

  <%= button_link_to(
    Spree.t(:add_product_properties),
    "javascript:;",
    { icon: 'add', :'data-target' => "tbody#product_properties", class: 'btn-success spree_add_fields' }) %>

  <span class="js-new-ptype-link">
    <%= button_link_to Spree.t(:select_from_prototype),
      available_admin_prototypes_url,
      { icon: 'properties', remote: true, 'data-update' => 'prototypes', class: 'btn-outline-secondary' } %>
  </span>
<% end if can? :create, Spree::ProductProperty %>

<%= form_for @product, url: spree.admin_product_url(@product), method: :put do |f| %>
  <fieldset>
    <div id="prototypes" data-hook></div>

    <table class="table sortable" data-hook data-sortable-link="<%= update_positions_admin_product_product_properties_url %>">
      <thead>
        <tr data-hook="product_properties_header">
          <th colspan="2"><%= Spree.t(:property) %></th>
          <th><%= Spree.t(:value) %></th>
          <th class="actions"></th>
        </tr>
      </thead>
      <tbody id="product_properties" data-hook>
        <%= f.fields_for :product_properties do |pp_form| %>
          <%= render 'product_property_fields', f: pp_form %>
        <% end %>
      </tbody>
    </table>

    <%= render('spree/admin/shared/edit_resource_links') if can? :update, Spree::ProductProperty %>

    <%= hidden_field_tag 'clear_product_properties', 'true' %>
  </fieldset>
<% end %>

<%= javascript_tag do %>
  var properties = <%= raw(@properties.to_json) %>;
  $('#product_properties').on('keydown', 'input.autocomplete', function() {
    already_auto_completed = $(this).is('ac_input');
    if (!already_auto_completed) {
      $(this).autocomplete({source: properties});
      $(this).focus();
    }
  });
<% end %>

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spree_backend-4.1.15 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.14 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.13.1 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.13 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.12 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.11 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.10 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.9 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.8 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.7 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.6 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.5 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.4 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.3 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.2 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.1 app/views/spree/admin/product_properties/index.html.erb