From 465415b9806a2de258d12df10213601eba87d515 Mon Sep 17 00:00:00 2001 From: jessib Date: Tue, 23 Jul 2013 11:35:43 -0700 Subject: Some navigation tweaks. --- app/views/layouts/_navigation.html.haml | 2 +- billing/app/controllers/payments_controller.rb | 3 ++- users/app/views/overviews/show.html.haml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_navigation.html.haml b/app/views/layouts/_navigation.html.haml index 5701d13..1411c6a 100644 --- a/app/views/layouts/_navigation.html.haml +++ b/app/views/layouts/_navigation.html.haml @@ -3,5 +3,5 @@ = link_to_navigation t(:account_settings), edit_user_path(@user), :active => controller?(:users) = link_to_navigation t(:email_settings), edit_user_email_settings_path(@user), :active => controller?(:email_settings) = link_to_navigation t(:support_tickets), auto_tickets_path, :active => controller?(:tickets) - = link_to_navigation t(:billing_settings), new_customer_path, :active => controller?(:customer, :payments, :subscription, :credit_card_info) + = link_to_navigation t(:billing_settings), show_customer_path(@user), :active => controller?(:customer, :payments, :subscriptions, :credit_card_info) = link_to_navigation t(:logout), logout_path, :method => :delete diff --git a/billing/app/controllers/payments_controller.rb b/billing/app/controllers/payments_controller.rb index 99b7af8..224b78e 100644 --- a/billing/app/controllers/payments_controller.rb +++ b/billing/app/controllers/payments_controller.rb @@ -26,7 +26,7 @@ class PaymentsController < BillingBaseController def fetch_transparent_redirect - if current_user + if @user = current_user #set user for navigation if @customer = Customer.find_by_user_id(current_user.id) @customer.with_braintree_data! braintree_customer_id = @customer.braintree_customer_id @@ -38,6 +38,7 @@ class PaymentsController < BillingBaseController end # TODO: What is this supposed to do if braintree_customer_id was not set yet? + # Response: it can be used to make a payment that is not attributed to any customer (ie, a donation) @tr_data = Braintree::TransparentRedirect.transaction_data redirect_url: confirm_payment_url, transaction: { type: "sale", customer_id: braintree_customer_id, options: {submit_for_settlement: true } } end diff --git a/users/app/views/overviews/show.html.haml b/users/app/views/overviews/show.html.haml index 86ae297..4084b1f 100644 --- a/users/app/views/overviews/show.html.haml +++ b/users/app/views/overviews/show.html.haml @@ -19,4 +19,4 @@ %li= icon('user') + link_to(t(:overview_account), edit_user_path(@user)) %li= icon('envelope') + link_to(t(:overview_email), edit_user_email_settings_path(@user)) %li= icon('question-sign') + link_to(t(:overview_tickets), user_tickets_path(@user)) - %li= icon('shopping-cart') + link_to(t(:overview_billing), new_customer_path) + %li= icon('shopping-cart') + link_to(t(:overview_billing), show_customer_path(@user)) -- cgit v1.2.3