Sha256: 36f6f8dbe8c273dbcdf4a59385cf44b1c907facfe232d953ca3df5d51e5d8ee0

Contents?: true

Size: 1.86 KB

Versions: 19

Compression:

Stored size: 1.86 KB

Contents

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

<% content_for :page_actions do %>
  <%= 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

19 entries across 19 versions & 1 rubygems

Version Path
spree_backend-4.0.9 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.8 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.7.1 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.7 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.6 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.5 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.4 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.0 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.0.rc3 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.0.rc2 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.1.0.rc1 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.3 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.2 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.1 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.0 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.0.rc3 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.0.rc2 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.0.rc1 app/views/spree/admin/product_properties/index.html.erb
spree_backend-4.0.0.beta app/views/spree/admin/product_properties/index.html.erb