From 1e557522fafc26829b8e9a873da28b7082d4df42 Mon Sep 17 00:00:00 2001 From: jessib Date: Tue, 23 Apr 2013 13:23:01 -0700 Subject: Some improvements to navigation, and pulling out separate show/edit views for customers. --- billing/app/views/customer/_transaction.html.haml | 2 +- billing/app/views/customer/edit.html.haml | 21 +++++++-------------- billing/app/views/customer/show.html.haml | 8 ++++++++ 3 files changed, 16 insertions(+), 15 deletions(-) create mode 100644 billing/app/views/customer/show.html.haml (limited to 'billing/app/views/customer') diff --git a/billing/app/views/customer/_transaction.html.haml b/billing/app/views/customer/_transaction.html.haml index 97842dc..53483d9 100644 --- a/billing/app/views/customer/_transaction.html.haml +++ b/billing/app/views/customer/_transaction.html.haml @@ -2,7 +2,7 @@ = transaction.id Type: = transaction.type - Transaction Amount: + Amount: = number_to_currency(transaction.amount) Status: = transaction.status diff --git a/billing/app/views/customer/edit.html.haml b/billing/app/views/customer/edit.html.haml index 2104b09..bea3211 100644 --- a/billing/app/views/customer/edit.html.haml +++ b/billing/app/views/customer/edit.html.haml @@ -11,19 +11,12 @@ %dd= f.text_field :last_name %dt= f.label :phone, 'Phone' %dd= f.text_field :phone - - if @default_cc - %ul - %li - Stored Credit Card + - if @default_cc + = # todo, as they will need a credit card, so not sure about conditional? + %dt Stored Credit Card + %dd = @default_cc.masked_number - = link_to 'Change credit card', edit_credit_card_info_path(:id => @default_cc.token) - %li - Transaction History - = render(:partial => "transaction", :collection => @transactions) - - if @subscriptions.any? - %li - Active Subscriptions - = # todo: won't really have multiple subscriptions - = render(:partial => "subscription", :collection => @subscriptions) + = link_to 'Change credit card', edit_credit_card_info_path(:id => @default_cc.token), :class => :btn = hidden_field_tag :tr_data, @tr_data - = f.submit 'Save Customer Info' \ No newline at end of file + = f.submit 'Save Customer Info', :class => :btn += link_to 'Cancel', customer_path(@braintree_data.id), :class=> :btn \ No newline at end of file diff --git a/billing/app/views/customer/show.html.haml b/billing/app/views/customer/show.html.haml new file mode 100644 index 0000000..7416682 --- /dev/null +++ b/billing/app/views/customer/show.html.haml @@ -0,0 +1,8 @@ += render :partial => 'payments/customer_data' += link_to 'Make Payment', new_payment_path, :class => :btn +%h3 Transaction History += render(:partial => "transaction", :collection => @transactions) # show subset with link to see more +- if @subscriptions.any? + %h3 Active Subscriptions + = # todo: won't really have multiple subscriptions + = render(:partial => "subscription", :collection => @subscriptions) \ No newline at end of file -- cgit v1.2.3