From ec6f6056a88a99331e4d07441bfd78825ed2a46e Mon Sep 17 00:00:00 2001 From: Hugo Daniel Date: Thu, 25 Jul 2019 14:34:06 +0200 Subject: [PATCH] Remove data-hooks --- app/views/spree/admin/variants/_form.html.haml | 4 ++-- app/views/spree/admin/variants/index.html.haml | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/spree/admin/variants/_form.html.haml b/app/views/spree/admin/variants/_form.html.haml index 236aa4579e..6f96acb020 100644 --- a/app/views/spree/admin/variants/_form.html.haml +++ b/app/views/spree/admin/variants/_form.html.haml @@ -21,7 +21,7 @@ %div - @product.option_types.each do |option_type| - unless variant_unit_option_type?(option_type) - .field{"data-hook" => "presentation"} + .field = label :new_variant, option_type.presentation - if @variant.new_record? = select(:new_variant, option_type.presentation, option_type.option_values.collect {|ov| [ ov.presentation, ov.id ] }, {}, {class: 'select2 fullwidth'}) @@ -52,7 +52,7 @@ .right.six.columns.omega.label-block - if @product.variant_unit != 'weight' - .field{"data-hook" => 'weight'} + .field = f.label 'weight', t('weight')+' (kg)' - value = number_with_precision(@variant.weight, precision: 2) = f.text_field 'weight', value: value, class: 'fullwidth' diff --git a/app/views/spree/admin/variants/index.html.haml b/app/views/spree/admin/variants/index.html.haml index 72f35ac13e..d5aa3a499b 100644 --- a/app/views/spree/admin/variants/index.html.haml +++ b/app/views/spree/admin/variants/index.html.haml @@ -12,7 +12,7 @@ %col{style: "width: 20%"}/ %col{style: "width: 15%"}/ %col{style: "width: 15%"}/ - %thead{"data-hook" => "variants_header"} + %thead %tr %th{colspan: "2"}= Spree.t(:options) %th= Spree.t(:price) @@ -20,7 +20,7 @@ %th.actions %tbody - @variants.each do |variant| - %tr{id: spree_dom_id(variant), "data-hook" => "variants_row", class: cycle('odd', 'even'), style: "#{"color:red;" if variant.deleted? }" } + %tr{id: spree_dom_id(variant), class: cycle('odd', 'even'), style: "#{"color:red;" if variant.deleted? }" } %td.no-border %span.handle %td= variant.full_name @@ -39,7 +39,7 @@ \. - if @product.empty_option_values? - %p.first_add_option_types.no-objects-found{"data-hook" => "first_add_option_types"} + %p.first_add_option_types.no-objects-found = Spree.t(:to_add_variants_you_must_first_define) = link_to Spree.t(:option_types), admin_product_url(@product) = Spree.t(:and) @@ -47,8 +47,8 @@ - else - content_for :page_actions do - %ul.inline-menu{"data-hook" => "toolbar"} - %li#new_var_link{"data-hook" => ""} + %ul.inline-menu + %li#new_var_link = link_to_with_icon('icon-plus', Spree.t(:new_variant), new_admin_product_variant_url(@product), remote: true, 'data-update' => 'new_variant', class: 'button') %li= link_to_with_icon('icon-filter', @deleted.blank? ? Spree.t(:show_deleted) : Spree.t(:show_active), admin_product_variants_url(@product, deleted: @deleted.blank? ? "on" : "off"), class: 'button')