Fix more Rubocop offences

This commit is contained in:
Matt-Yorkley
2020-12-30 11:36:36 +00:00
parent bf47db1792
commit 2e5810d64d
3 changed files with 19 additions and 13 deletions

View File

@@ -1,20 +1,22 @@
= render :partial => 'spree/admin/shared/order_tabs', :locals => { :current => 'Payments' }
= render partial: 'spree/admin/shared/order_tabs', locals: { current: 'Payments' }
- content_for :page_title do
%i.icon-arrow-right
= link_to Spree.t(:payments), admin_order_payments_path(@order)
%i.icon-arrow-right
= payment_method_name(@payment)
%i.icon-arrow-right
= Spree.t('refund', :scope => :paypal)
= Spree.t('refund', scope: :paypal)
= form_tag paypal_refund_admin_order_payment_path(@order, @payment) do
.label-block.left.five.columns.alpha
%div
%fieldset{"data-hook" => "admin_variant_new_form"}
%legend= Spree.t('refund', :scope => :paypal)
%legend= Spree.t('refund', scope: :paypal)
.field
= label_tag 'refund_amount', Spree.t(:refund_amount, :scope => 'paypal')
= label_tag 'refund_amount', Spree.t(:refund_amount, scope: 'paypal')
%small
%em= Spree.t(:original_amount, :scope => 'paypal', :amount => @payment.display_amount)
%em= Spree.t(:original_amount, scope: 'paypal', amount: @payment.display_amount)
%br/
- symbol = ::Money.new(1, Spree::Config[:currency]).symbol
- if Spree::Config[:currency_symbol_position] == "before"
@@ -23,4 +25,4 @@
- else
= text_field_tag 'refund_amount', @payment.amount
= symbol
= button Spree.t(:refund, :scope => 'paypal'), 'icon-dollar'
= button Spree.t(:refund, scope: 'paypal'), 'icon-dollar'

View File

@@ -1,14 +1,14 @@
%fieldset{"data-hook" => "paypal"}
%legend{align: "center"}= Spree.t(:transaction, :scope => :paypal)
%legend{align: "center"}= Spree.t(:transaction, scope: :paypal)
.row
.alpha.six.columns
%dl
%dt
= Spree.t(:payer_id, :scope => :paypal)
= Spree.t(:payer_id, scope: :paypal)
\:
%dd= payment.source.payer_id
%dt
= Spree.t(:token, :scope => :paypal)
= Spree.t(:token, scope: :paypal)
\:
%dd= payment.source.token
%dt
@@ -16,19 +16,21 @@
\:
%dd= payment.source.transaction_id
- if payment.source.state != 'refunded'
= button_link_to Spree.t('actions.refund', :scope => :paypal), spree.paypal_refund_admin_order_payment_path(@order, payment), :icon => 'icon-dollar'
= button_link_to Spree.t('actions.refund', scope: :paypal),
spree.paypal_refund_admin_order_payment_path(@order, payment),
icon: 'icon-dollar'
- else
.alpha.six.columns
%dl
%dt
= Spree.t(:state, :scope => :paypal)
= Spree.t(:state, scope: :paypal)
\:
%dd= payment.source.state.titleize
%dt
= Spree.t(:refunded_at, :scope => :paypal)
= Spree.t(:refunded_at, scope: :paypal)
\:
%dd= pretty_time(payment.source.refunded_at)
%dt
= Spree.t(:refund_transaction_id, :scope => :paypal)
= Spree.t(:refund_transaction_id, scope: :paypal)
\:
%dd= payment.source.refund_transaction_id

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spree/core/controller_helpers/auth'
module Spree