From de6c96d13829dcaf47576a266284e399245bc427 Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Wed, 24 Jul 2019 12:38:29 +0200 Subject: [PATCH 01/11] Import product_properties/_product_properties_fields.html.erb from Spree to OFN --- .../_product_properties_fields.html.erb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app/views/spree/admin/product_properties/_product_properties_fields.html.erb diff --git a/app/views/spree/admin/product_properties/_product_properties_fields.html.erb b/app/views/spree/admin/product_properties/_product_properties_fields.html.erb new file mode 100644 index 0000000000..6c9d5d02cd --- /dev/null +++ b/app/views/spree/admin/product_properties/_product_properties_fields.html.erb @@ -0,0 +1,17 @@ + + + + <%= f.hidden_field :id %> + + + <%= f.text_field :property_name, :class => 'autocomplete' %> + + + <%= f.text_field :value, :class => 'autocomplete' %> + + + <% if f.object.persisted? %> + <%= link_to_delete f.object, :no_text => true %> + <% end %> + + From 3fc0d4a6660b036632705a1e1947694bce62718f Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Wed, 24 Jul 2019 12:40:24 +0200 Subject: [PATCH 02/11] Convert _product_properties_fields from ERB to Haml --- .../_product_properties_fields.html.erb | 17 ----------------- .../_product_properties_fields.html.haml | 11 +++++++++++ 2 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 app/views/spree/admin/product_properties/_product_properties_fields.html.erb create mode 100644 app/views/spree/admin/product_properties/_product_properties_fields.html.haml diff --git a/app/views/spree/admin/product_properties/_product_properties_fields.html.erb b/app/views/spree/admin/product_properties/_product_properties_fields.html.erb deleted file mode 100644 index 6c9d5d02cd..0000000000 --- a/app/views/spree/admin/product_properties/_product_properties_fields.html.erb +++ /dev/null @@ -1,17 +0,0 @@ - - - - <%= f.hidden_field :id %> - - - <%= f.text_field :property_name, :class => 'autocomplete' %> - - - <%= f.text_field :value, :class => 'autocomplete' %> - - - <% if f.object.persisted? %> - <%= link_to_delete f.object, :no_text => true %> - <% end %> - - diff --git a/app/views/spree/admin/product_properties/_product_properties_fields.html.haml b/app/views/spree/admin/product_properties/_product_properties_fields.html.haml new file mode 100644 index 0000000000..42c14632ad --- /dev/null +++ b/app/views/spree/admin/product_properties/_product_properties_fields.html.haml @@ -0,0 +1,11 @@ +%tr.product_property.fields{"data-hook" => "product_property", id: "spree_#{dom_id(f.object)}"} + %td.no-border + %span.handle + = f.hidden_field :id + %td.property_name + = f.text_field :property_name, :class => 'autocomplete' + %td.value + = f.text_field :value, :class => 'autocomplete' + %td.actions + - if f.object.persisted? + = link_to_delete f.object, :no_text => true From 1cfa499b0e858b7f5dd671b5921d62cafab280a3 Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Wed, 24 Jul 2019 13:01:50 +0200 Subject: [PATCH 03/11] De-deface _product_propery_fields --- .../replace_free_text_with_select.html.haml.deface | 6 ------ .../_product_properties_fields.html.haml | 11 ----------- .../_product_property_fields.html.haml | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 17 deletions(-) delete mode 100644 app/overrides/spree/admin/product_properties/_product_property_fields/replace_free_text_with_select.html.haml.deface delete mode 100644 app/views/spree/admin/product_properties/_product_properties_fields.html.haml create mode 100644 app/views/spree/admin/product_properties/_product_property_fields.html.haml diff --git a/app/overrides/spree/admin/product_properties/_product_property_fields/replace_free_text_with_select.html.haml.deface b/app/overrides/spree/admin/product_properties/_product_property_fields/replace_free_text_with_select.html.haml.deface deleted file mode 100644 index 486d35014e..0000000000 --- a/app/overrides/spree/admin/product_properties/_product_property_fields/replace_free_text_with_select.html.haml.deface +++ /dev/null @@ -1,6 +0,0 @@ -/ replace_contents "td.property_name" - -- if spree_current_user.admin? - = f.text_field :property_name, :class => 'autocomplete' -- else - = f.select :property_name, @properties, { :include_blank => true }, { class: 'select2 fullwidth' } diff --git a/app/views/spree/admin/product_properties/_product_properties_fields.html.haml b/app/views/spree/admin/product_properties/_product_properties_fields.html.haml deleted file mode 100644 index 42c14632ad..0000000000 --- a/app/views/spree/admin/product_properties/_product_properties_fields.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%tr.product_property.fields{"data-hook" => "product_property", id: "spree_#{dom_id(f.object)}"} - %td.no-border - %span.handle - = f.hidden_field :id - %td.property_name - = f.text_field :property_name, :class => 'autocomplete' - %td.value - = f.text_field :value, :class => 'autocomplete' - %td.actions - - if f.object.persisted? - = link_to_delete f.object, :no_text => true diff --git a/app/views/spree/admin/product_properties/_product_property_fields.html.haml b/app/views/spree/admin/product_properties/_product_property_fields.html.haml new file mode 100644 index 0000000000..d4362c4366 --- /dev/null +++ b/app/views/spree/admin/product_properties/_product_property_fields.html.haml @@ -0,0 +1,14 @@ +%tr.product_property.fields{"data-hook" => "product_property", id: "spree_#{dom_id(f.object)}"} + %td.no-border + %span.handle + = f.hidden_field :id + %td.property_name + - if spree_current_user.admin? + = f.text_field :property_name, class: 'autocomplete' + - else + = f.select :property_name, @properties, { include_blank: true }, { class: 'select2 fullwidth' } + %td.value + = f.text_field :value, class: 'autocomplete' + %td.actions + - if f.object.persisted? + = link_to_delete f.object, no_text: true From 1cb065f82944939a1c162e945f275896ae792623 Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Wed, 24 Jul 2019 13:09:04 +0200 Subject: [PATCH 04/11] Import product_properties/index.html.erb from spree_backend to ofn --- .../admin/product_properties/index.html.erb | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 app/views/spree/admin/product_properties/index.html.erb diff --git a/app/views/spree/admin/product_properties/index.html.erb b/app/views/spree/admin/product_properties/index.html.erb new file mode 100644 index 0000000000..a80293a598 --- /dev/null +++ b/app/views/spree/admin/product_properties/index.html.erb @@ -0,0 +1,59 @@ +<%= 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 %> +
    +
  • + <%= link_to_add_fields Spree.t(:add_product_properties), 'tbody#product_properties', :class => 'icon-plus button' %> +
  • +
  • + + <%= link_to Spree.t(:select_from_prototype), available_admin_prototypes_url, :remote => true, 'data-update' => 'prototypes', :class => 'button icon-copy' %> + +
  • +
+<% 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 -%> + From 110fd3ecdf97752de68f806551ffdc1f5425791c Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Wed, 24 Jul 2019 13:12:58 +0200 Subject: [PATCH 05/11] Convert erb to haml --- .../admin/product_properties/index.html.erb | 59 ------------------- .../admin/product_properties/index.html.haml | 45 ++++++++++++++ 2 files changed, 45 insertions(+), 59 deletions(-) delete mode 100644 app/views/spree/admin/product_properties/index.html.erb create mode 100644 app/views/spree/admin/product_properties/index.html.haml 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 %> -
    -
  • - <%= link_to_add_fields Spree.t(:add_product_properties), 'tbody#product_properties', :class => 'icon-plus button' %> -
  • -
  • - - <%= link_to Spree.t(:select_from_prototype), available_admin_prototypes_url, :remote => true, 'data-update' => 'prototypes', :class => 'button icon-copy' %> - -
  • -
-<% 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(); + } + }); From 4d6af57f79474ce6c75225d1892eb72d70105168 Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Wed, 24 Jul 2019 13:17:45 +0200 Subject: [PATCH 06/11] De-deface product_properties/index --- ...perties_warning_and_table.html.haml.deface | 26 ---------------- .../rename_form_headings.html.haml.deface | 5 --- .../admin/product_properties/index.html.haml | 31 +++++++++++++++++-- 3 files changed, 29 insertions(+), 33 deletions(-) delete mode 100644 app/overrides/spree/admin/product_properties/index/add_producer_properties_warning_and_table.html.haml.deface delete mode 100644 app/overrides/spree/admin/product_properties/index/rename_form_headings.html.haml.deface diff --git a/app/overrides/spree/admin/product_properties/index/add_producer_properties_warning_and_table.html.haml.deface b/app/overrides/spree/admin/product_properties/index/add_producer_properties_warning_and_table.html.haml.deface deleted file mode 100644 index 149f72015a..0000000000 --- a/app/overrides/spree/admin/product_properties/index/add_producer_properties_warning_and_table.html.haml.deface +++ /dev/null @@ -1,26 +0,0 @@ -/ insert_after 'table.index.sortable' - -=f.check_box :inherits_properties -=f.label :inherits_properties, t(".inherits_properties_checkbox_hint", supplier: @product.supplier.name) -%br -%br - -#inherited_properties - %table.index - %thead - %tr{"data-hook" => "producer_properties_header"} - %th= t('admin.products.properties.inherited_property') - %th= t('admin.description') - %th.actions - %tbody#producer_properties{"data-hook" => ""} - - @product.supplier.producer_properties.each do |producer_property| - %tr - %td= producer_property.property.presentation - %td= producer_property.value - %td.actions - -:coffee - $(document).ready -> - $("#inherited_properties").toggle $("input#product_inherits_properties").is(':checked') - $("input#product_inherits_properties").change -> - $("#inherited_properties").toggle $(this).is(':checked') diff --git a/app/overrides/spree/admin/product_properties/index/rename_form_headings.html.haml.deface b/app/overrides/spree/admin/product_properties/index/rename_form_headings.html.haml.deface deleted file mode 100644 index 011580c1bb..0000000000 --- a/app/overrides/spree/admin/product_properties/index/rename_form_headings.html.haml.deface +++ /dev/null @@ -1,5 +0,0 @@ -/ replace "tr[data-hook='product_properties_header']" -%tr{"data-hook" => "product_properties_header"} - %th= t('admin.products.properties.property_name') - %th= t('admin.description') - %th.actions diff --git a/app/views/spree/admin/product_properties/index.html.haml b/app/views/spree/admin/product_properties/index.html.haml index cf358233ee..809746b24b 100644 --- a/app/views/spree/admin/product_properties/index.html.haml +++ b/app/views/spree/admin/product_properties/index.html.haml @@ -21,18 +21,45 @@ %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.no-border + %th= t('admin.products.properties.property_name') + %th= t('admin.description') %th.actions %tbody#product_properties{"data-hook" => ""} = f.fields_for :product_properties do |pp_form| = render :partial => 'product_property_fields', :locals => { :f => pp_form } + =f.check_box :inherits_properties + =f.label :inherits_properties, t(".inherits_properties_checkbox_hint", supplier: @product.supplier.name) + %br + %br + + #inherited_properties + %table.index + %thead + %tr{"data-hook" => "producer_properties_header"} + %th= t('admin.products.properties.inherited_property') + %th= t('admin.description') + %th.actions + %tbody#producer_properties{"data-hook" => ""} + - @product.supplier.producer_properties.each do |producer_property| + %tr + %td= producer_property.property.presentation + %td= producer_property.value + %td.actions + + = render :partial => 'spree/admin/shared/edit_resource_links' = hidden_field_tag 'clear_product_properties', 'true' +:coffee + $(document).ready -> + $("#inherited_properties").toggle $("input#product_inherits_properties").is(':checked') + $("input#product_inherits_properties").change -> + $("#inherited_properties").toggle $(this).is(':checked') + = javascript_tag do var properties = #{raw(@properties.to_json)}; From 0a88738faa58111ef02ddb6e1ebca9dedf5ba5ed Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Wed, 24 Jul 2019 14:37:00 +0200 Subject: [PATCH 07/11] Replace old ruby syntax with new --- .../admin/product_properties/index.html.haml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/views/spree/admin/product_properties/index.html.haml b/app/views/spree/admin/product_properties/index.html.haml index 809746b24b..cf1faa590d 100644 --- a/app/views/spree/admin/product_properties/index.html.haml +++ b/app/views/spree/admin/product_properties/index.html.haml @@ -1,22 +1,22 @@ -= render :partial => 'spree/admin/shared/product_sub_menu' += render partial: 'spree/admin/shared/product_sub_menu' -= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Product Properties' } += render partial: 'spree/admin/shared/product_tabs', locals: { current: 'Product Properties' } -= render :partial => 'spree/shared/error_messages', :locals => { :target => @product } += 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' + = 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' + = 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| += 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' + = 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 @@ -28,10 +28,10 @@ %tbody#product_properties{"data-hook" => ""} = f.fields_for :product_properties do |pp_form| - = render :partial => 'product_property_fields', :locals => { :f => pp_form } + = render partial: 'product_property_fields', locals: { f: pp_form } - =f.check_box :inherits_properties - =f.label :inherits_properties, t(".inherits_properties_checkbox_hint", supplier: @product.supplier.name) + = f.check_box :inherits_properties + = f.label :inherits_properties, t(".inherits_properties_checkbox_hint", supplier: @product.supplier.name) %br %br @@ -50,7 +50,7 @@ %td.actions - = render :partial => 'spree/admin/shared/edit_resource_links' + = render partial: 'spree/admin/shared/edit_resource_links' = hidden_field_tag 'clear_product_properties', 'true' From 2d872c25bf16b8252ff43bc2710ca26e60d5bb8a Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Thu, 25 Jul 2019 11:20:51 +0200 Subject: [PATCH 08/11] Use Haml javascript tag to make autocomplete work --- .../spree/admin/product_properties/index.html.haml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/spree/admin/product_properties/index.html.haml b/app/views/spree/admin/product_properties/index.html.haml index cf1faa590d..895beef33a 100644 --- a/app/views/spree/admin/product_properties/index.html.haml +++ b/app/views/spree/admin/product_properties/index.html.haml @@ -60,13 +60,13 @@ $("input#product_inherits_properties").change -> $("#inherited_properties").toggle $(this).is(':checked') -= javascript_tag do +:javascript var properties = #{raw(@properties.to_json)}; - + console.log(properties) $("#product_properties input.autocomplete").live("keydown", function(){ - already_auto_completed = $(this).is('ac_input'); - if (!already_auto_completed) { - $(this).autocomplete({source: properties}); - $(this).focus(); - } + already_auto_completed = $(this).is('ac_input'); + if (!already_auto_completed) { + $(this).autocomplete({source: properties}); + $(this).focus(); + } }); From c83d249147b5a147b02b0da2b9607126d5082181 Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Thu, 25 Jul 2019 11:51:00 +0200 Subject: [PATCH 09/11] Impor missing partials from spree to ofn and convert to haml --- .../spree/admin/product_properties/index.html.haml | 1 - .../spree/admin/shared/_edit_resource_links.html.haml | 4 ++++ .../spree/admin/shared/_product_sub_menu.html.haml | 6 ++++++ app/views/spree/shared/_error_messages.html.haml | 11 +++++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 app/views/spree/admin/shared/_edit_resource_links.html.haml create mode 100644 app/views/spree/admin/shared/_product_sub_menu.html.haml create mode 100644 app/views/spree/shared/_error_messages.html.haml diff --git a/app/views/spree/admin/product_properties/index.html.haml b/app/views/spree/admin/product_properties/index.html.haml index 895beef33a..bcde9f77d5 100644 --- a/app/views/spree/admin/product_properties/index.html.haml +++ b/app/views/spree/admin/product_properties/index.html.haml @@ -62,7 +62,6 @@ :javascript var properties = #{raw(@properties.to_json)}; - console.log(properties) $("#product_properties input.autocomplete").live("keydown", function(){ already_auto_completed = $(this).is('ac_input'); if (!already_auto_completed) { diff --git a/app/views/spree/admin/shared/_edit_resource_links.html.haml b/app/views/spree/admin/shared/_edit_resource_links.html.haml new file mode 100644 index 0000000000..44db947bba --- /dev/null +++ b/app/views/spree/admin/shared/_edit_resource_links.html.haml @@ -0,0 +1,4 @@ +.form-buttons.filter-actions.actions + = button Spree.t('actions.update'), 'icon-refresh' + %span.or= Spree.t(:or) + = button_link_to Spree.t('actions.cancel'), collection_url, icon: 'icon-remove' diff --git a/app/views/spree/admin/shared/_product_sub_menu.html.haml b/app/views/spree/admin/shared/_product_sub_menu.html.haml new file mode 100644 index 0000000000..385fbd9993 --- /dev/null +++ b/app/views/spree/admin/shared/_product_sub_menu.html.haml @@ -0,0 +1,6 @@ +- content_for :sub_menu do + %ul#sub_nav.inline-menu + = tab :products, match_path: '/products' + = tab :option_types, match_path: '/option_types' + = tab :properties + = tab :prototypes diff --git a/app/views/spree/shared/_error_messages.html.haml b/app/views/spree/shared/_error_messages.html.haml new file mode 100644 index 0000000000..54fabd313e --- /dev/null +++ b/app/views/spree/shared/_error_messages.html.haml @@ -0,0 +1,11 @@ +- if target && target.errors.any? + #errorExplanation.errorExplanation + %h2 + = Spree.t(:errors_prohibited_this_record_from_being_saved, count: target.errors.count) + \: + %p + = Spree.t(:there_were_problems_with_the_following_fields) + \: + %ul + - target.errors.full_messages.each do |msg| + %li= msg From c464b21d7684a1af0ab1671e807b04ec5edf9a52 Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Thu, 25 Jul 2019 14:27:53 +0200 Subject: [PATCH 10/11] Remove data-hooks --- .../spree/admin/product_properties/index.html.haml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/spree/admin/product_properties/index.html.haml b/app/views/spree/admin/product_properties/index.html.haml index bcde9f77d5..e97d559111 100644 --- a/app/views/spree/admin/product_properties/index.html.haml +++ b/app/views/spree/admin/product_properties/index.html.haml @@ -14,19 +14,19 @@ = 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" => ""} + .add_product_properties + #prototypes = 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} + %table.index.sortable{"data-sortable-link" => update_positions_admin_product_product_properties_url} %thead - %tr{"data-hook" => "product_properties_header"} + %tr %th.no-border %th= t('admin.products.properties.property_name') %th= t('admin.description') %th.actions - %tbody#product_properties{"data-hook" => ""} + %tbody#product_properties = f.fields_for :product_properties do |pp_form| = render partial: 'product_property_fields', locals: { f: pp_form } @@ -38,11 +38,11 @@ #inherited_properties %table.index %thead - %tr{"data-hook" => "producer_properties_header"} + %tr %th= t('admin.products.properties.inherited_property') %th= t('admin.description') %th.actions - %tbody#producer_properties{"data-hook" => ""} + %tbody#producer_properties - @product.supplier.producer_properties.each do |producer_property| %tr %td= producer_property.property.presentation From 7d21d88dc958d69e3bae2590177e35d33e4f02ec Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Thu, 22 Aug 2019 10:32:07 +0200 Subject: [PATCH 11/11] Force hide the select2 close cross --- app/assets/stylesheets/admin/select2.css.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/admin/select2.css.scss b/app/assets/stylesheets/admin/select2.css.scss index 0acf00c088..ec8f3234b6 100644 --- a/app/assets/stylesheets/admin/select2.css.scss +++ b/app/assets/stylesheets/admin/select2.css.scss @@ -3,7 +3,7 @@ .select2-container { .select2-choice { .select2-search-choice-close { - display: none; + display: none !important; } .select2-arrow { width: 22px;