From 280fd79d4600cf7e40b988148f636b088c505d50 Mon Sep 17 00:00:00 2001 From: Cesar Carruitero Date: Sat, 9 Sep 2017 13:30:05 -0500 Subject: [PATCH] Use classes alongside data-hook attrs for gateway partial --- .../views/spree/checkout/payment/_gateway.html.erb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/app/views/spree/checkout/payment/_gateway.html.erb b/frontend/app/views/spree/checkout/payment/_gateway.html.erb index fc245dbad17..77d05d6f529 100644 --- a/frontend/app/views/spree/checkout/payment/_gateway.html.erb +++ b/frontend/app/views/spree/checkout/payment/_gateway.html.erb @@ -1,14 +1,15 @@ <%= image_tag 'credit_cards/credit_card.gif', id: 'credit-card-image' %> <% param_prefix = "payment_source[#{payment_method.id}]" %> -
+
<%= label_tag "name_on_card_#{payment_method.id}", t('spree.name_on_card') %> - <%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}", autocomplete: "cc-name" } %> + <%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}", autocomplete: "cc-name", class: 'cardName' } %>
-
+
<%= label_tag "card_number", t('spree.card_number') %> <%= text_field_tag "#{param_prefix}[number]", '', {id: 'card_number', class: 'required cardNumber', size: 19, maxlength: 19, autocomplete: "cc-number", type: "tel" } %> +
-
+
<%= label_tag "card_expiry", t('spree.expiration') %> <%= text_field_tag "#{param_prefix}[expiry]", '', id: 'card_expiry', class: "required cardExpiry", placeholder: "MM / YY", type: "tel" %>
-
+
<%= label_tag "card_code", t('spree.card_code') %> <%= text_field_tag "#{param_prefix}[verification_value]", '', {id: 'card_code', class: 'required cardCode', size: 5, type: "tel", autocomplete: "off" } %> <%= link_to "(#{t('spree.what_is_this')})", spree.cvv_path, target: '_blank', "data-hook" => "cvv_link", id: "cvv_link" %>