From 3e32abe64f56fefd5ead778f4c0d181e2ca98d0e Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Sun, 13 Jun 2021 16:51:45 -0700 Subject: [PATCH] add colors and translations for requires_authorization state --- app/assets/stylesheets/admin/globals/variables.scss | 8 +++++--- app/views/spree/admin/payments/_list.html.haml | 2 +- config/locales/en.yml | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/admin/globals/variables.scss b/app/assets/stylesheets/admin/globals/variables.scss index 58547d3505..7244780159 100644 --- a/app/assets/stylesheets/admin/globals/variables.scss +++ b/app/assets/stylesheets/admin/globals/variables.scss @@ -84,6 +84,8 @@ $color-ste-sold-bg: $color-success !default; $color-ste-sold-text: $color-1 !default; $color-ste-pending-bg: $color-notice !default; $color-ste-pending-text: $color-1 !default; +$color-ste-requires_authorization-bg: $color-notice !default; +$color-ste-requires_authorization-text: $color-1 !default; $color-ste-awaiting_return-bg: $color-notice !default; $color-ste-awaiting_return-text: $color-1 !default; $color-ste-returned-bg: $color-notice !default; @@ -124,9 +126,9 @@ $color-ste-inactive-bg: $color-notice !default; $color-ste-inactive-text: $color-1 !default; // Available states -$states: completed, complete, sold, pending, awaiting_return, returned, credit_owed, paid, shipped, balance_due, backorder, checkout, cart, address, delivery, payment, confirm, canceled, ready, void, active, inactive !default; -$states-bg-colors: $color-ste-completed-bg, $color-ste-complete-bg, $color-ste-sold-bg, $color-ste-pending-bg, $color-ste-awaiting_return-bg, $color-ste-returned-bg, $color-ste-credit_owed-bg, $color-ste-paid-bg, $color-ste-shipped-bg, $color-ste-balance_due-bg, $color-ste-backorder-bg, $color-ste-checkout-bg, $color-ste-cart-bg, $color-ste-address-bg, $color-ste-delivery-bg, $color-ste-payment-bg, $color-ste-confirm-bg, $color-ste-canceled-bg, $color-ste-ready-bg, $color-ste-void-bg, $color-ste-active-bg, $color-ste-inactive-bg !default; -$states-text-colors: $color-ste-completed-text, $color-ste-complete-text, $color-ste-sold-text, $color-ste-pending-text, $color-ste-awaiting_return-text, $color-ste-returned-text, $color-ste-credit_owed-text, $color-ste-paid-text, $color-ste-shipped-text, $color-ste-balance_due-text, $color-ste-backorder-text, $color-ste-checkout-text, $color-ste-cart-text, $color-ste-address-text, $color-ste-delivery-text, $color-ste-payment-text, $color-ste-confirm-text, $color-ste-canceled-text, $color-ste-ready-text, $color-ste-void-text, $color-ste-active-text, $color-ste-inactive-text !default; +$states: completed, complete, sold, pending, awaiting_return, returned, credit_owed, paid, shipped, balance_due, backorder, checkout, cart, address, delivery, payment, confirm, canceled, ready, void, requires_authorization, active, inactive !default; +$states-bg-colors: $color-ste-completed-bg, $color-ste-complete-bg, $color-ste-sold-bg, $color-ste-pending-bg, $color-ste-awaiting_return-bg, $color-ste-returned-bg, $color-ste-credit_owed-bg, $color-ste-paid-bg, $color-ste-shipped-bg, $color-ste-balance_due-bg, $color-ste-backorder-bg, $color-ste-checkout-bg, $color-ste-cart-bg, $color-ste-address-bg, $color-ste-delivery-bg, $color-ste-payment-bg, $color-ste-confirm-bg, $color-ste-canceled-bg, $color-ste-ready-bg, $color-ste-void-bg, $color-ste-requires_authorization-bg, $color-ste-active-bg, $color-ste-inactive-bg !default; +$states-text-colors: $color-ste-completed-text, $color-ste-complete-text, $color-ste-sold-text, $color-ste-pending-text, $color-ste-awaiting_return-text, $color-ste-returned-text, $color-ste-credit_owed-text, $color-ste-paid-text, $color-ste-shipped-text, $color-ste-balance_due-text, $color-ste-backorder-text, $color-ste-checkout-text, $color-ste-cart-text, $color-ste-address-text, $color-ste-delivery-text, $color-ste-payment-text, $color-ste-confirm-text, $color-ste-canceled-text, $color-ste-ready-text, $color-ste-void-text, $color-ste-requires_authorization-text, $color-ste-active-text, $color-ste-inactive-text !default; // Available actions $actions: edit, clone, remove, void, capture, save, cancel, mail !default; diff --git a/app/views/spree/admin/payments/_list.html.haml b/app/views/spree/admin/payments/_list.html.haml index 8809f03d41..6888ff2290 100644 --- a/app/views/spree/admin/payments/_list.html.haml +++ b/app/views/spree/admin/payments/_list.html.haml @@ -13,7 +13,7 @@ %td.align-center= payment.display_amount.to_html %td.align-center= link_to payment_method_name(payment), spree.admin_order_payment_path(@order, payment) %td.align-center - %span{class: "state #{payment.state}"}= t(payment.state, scope: :payment_states, default: payment.state.capitalize) + %span{class: "state #{payment.state}"}= t(payment.state, scope: "spree.payment_states", default: payment.state.capitalize) %td.actions - payment.actions.each do |action| = link_to_with_icon "icon-#{action}", Spree.t(action), fire_admin_order_payment_path(@order, payment, e: action), method: :put, no_text: true, data: {action: action} diff --git a/config/locales/en.yml b/config/locales/en.yml index 33ab2504eb..be5a8157d0 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2796,7 +2796,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using failed: "failed" paid: "paid" pending: "pending" - authorization_required: "authorization required" + requires_authorization: "authorization required" processing: "processing" void: "void" invalid: "invalid" @@ -3790,6 +3790,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using paid: paid pending: pending processing: processing + requires_authorization: "authorization required" void: void invalid: invalid authorise: authorise