diff --git a/app/views/spree/admin/product_properties/index.html.erb b/app/views/spree/admin/product_properties/index.html.erb deleted file mode 100644 index a80293a598..0000000000 --- a/app/views/spree/admin/product_properties/index.html.erb +++ /dev/null @@ -1,59 +0,0 @@ -<%= render :partial => 'spree/admin/shared/product_sub_menu' %> - -<%= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Product Properties' } %> - -<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @product } %> - -<% content_for :page_actions do %> - -<% end %> - -<%= form_for @product, :url => admin_product_url(@product), :method => :put do |f| %> -
-
- -
- <%= image_tag 'select2-spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator' %> - - - - - - - - - - - <%= f.fields_for :product_properties do |pp_form| %> - <%= render :partial => 'product_property_fields', :locals => { :f => pp_form } %> - <% end %> - -
<%= Spree.t(:property) %><%= Spree.t(:value) %>
- - <%= render :partial => 'spree/admin/shared/edit_resource_links' %> - - <%= hidden_field_tag 'clear_product_properties', 'true' %> -
-<% end %> - -<%= javascript_tag do -%> - var properties = <%= raw(@properties.to_json) %>; - - $("#product_properties input.autocomplete").live("keydown", function(){ - already_auto_completed = $(this).is('ac_input'); - if (!already_auto_completed) { - $(this).autocomplete({source: properties}); - $(this).focus(); - } - }); -<% end -%> - diff --git a/app/views/spree/admin/product_properties/index.html.haml b/app/views/spree/admin/product_properties/index.html.haml new file mode 100644 index 0000000000..cf358233ee --- /dev/null +++ b/app/views/spree/admin/product_properties/index.html.haml @@ -0,0 +1,45 @@ += render :partial => 'spree/admin/shared/product_sub_menu' + += render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Product Properties' } + += render :partial => 'spree/shared/error_messages', :locals => { :target => @product } + +- content_for :page_actions do + %ul.tollbar.inline-menu + %li + = link_to_add_fields Spree.t(:add_product_properties), 'tbody#product_properties', :class => 'icon-plus button' + %li + %span#new_ptype_link + = link_to Spree.t(:select_from_prototype), available_admin_prototypes_url, :remote => true, 'data-update' => 'prototypes', :class => 'button icon-copy' + += form_for @product, :url => admin_product_url(@product), :method => :put do |f| + %fieldset.no-border-top + .add_product_properties{"data-hook" => "add_product_properties"} + #prototypes{"data-hook" => ""} + = image_tag 'select2-spinner.gif', :plugin => 'spree', :style => 'display:none;', :id => 'busy_indicator' + + %table.index.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= Spree.t(:value) + %th.actions + + %tbody#product_properties{"data-hook" => ""} + = f.fields_for :product_properties do |pp_form| + = render :partial => 'product_property_fields', :locals => { :f => pp_form } + + = render :partial => 'spree/admin/shared/edit_resource_links' + + = hidden_field_tag 'clear_product_properties', 'true' + += javascript_tag do + var properties = #{raw(@properties.to_json)}; + + $("#product_properties input.autocomplete").live("keydown", function(){ + already_auto_completed = $(this).is('ac_input'); + if (!already_auto_completed) { + $(this).autocomplete({source: properties}); + $(this).focus(); + } + });