From e618c4c2c01146a00364d5c25f9530b0a7fe9bcc Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Wed, 17 Sep 2014 14:56:29 +1000 Subject: [PATCH] add payment description to checkout --- .../api/payment_method_serializer.rb | 2 +- app/views/checkout/_payment.html.haml | 27 +++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/app/serializers/api/payment_method_serializer.rb b/app/serializers/api/payment_method_serializer.rb index 6c2203083d..d62bc18154 100644 --- a/app/serializers/api/payment_method_serializer.rb +++ b/app/serializers/api/payment_method_serializer.rb @@ -1,3 +1,3 @@ class Api::PaymentMethodSerializer < ActiveModel::Serializer - attributes :name, :id, :method_type + attributes :name, :description, :id, :method_type end diff --git a/app/views/checkout/_payment.html.haml b/app/views/checkout/_payment.html.haml index b655659738..21dca1542c 100644 --- a/app/views/checkout/_payment.html.haml +++ b/app/views/checkout/_payment.html.haml @@ -17,6 +17,7 @@ %em %small {{ Checkout.paymentMethod().name }} + %small .small-4.medium-2.columns.text-right %span.accordion-up %em @@ -29,16 +30,20 @@ -# TODO render this in Angular instead of server-side -# The problem being how to render the partials - - current_order.available_payment_methods.each do |method| - .row - .small-12.columns - %label - = radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, false, - required: true, - "ng-model" => "order.payment_method_id" - = method.name + .row + .small-6.columns + - current_order.available_payment_methods.each do |method| + .row + .small-12.columns + %label + = radio_button_tag "order[payments_attributes][][payment_method_id]", method.id, false, + required: true, + "ng-model" => "order.payment_method_id" + = method.name - .row{"ng-if" => "order.payment_method_id == #{method.id}"} - .small-12.columns - = render partial: "spree/checkout/payment/#{method.method_type}", :locals => { :payment_method => method } + .row{"ng-if" => "order.payment_method_id == #{method.id}"} + .small-12.columns + = render partial: "spree/checkout/payment/#{method.method_type}", :locals => { :payment_method => method } + .small-6.columns + %small {{ Checkout.paymentMethod().description }}