From c10bbfa44442c86fda82c16524341d5f21b63664 Mon Sep 17 00:00:00 2001 From: claucece Date: Tue, 22 Sep 2015 10:48:14 -0500 Subject: subscriptions, translation --- .../app/views/customer/_subs_form.html.haml | 10 +++++ engines/billing/app/views/customer/new.html.haml | 44 ++++++++++------------ 2 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 engines/billing/app/views/customer/_subs_form.html.haml (limited to 'engines/billing/app/views/customer') diff --git a/engines/billing/app/views/customer/_subs_form.html.haml b/engines/billing/app/views/customer/_subs_form.html.haml new file mode 100644 index 0000000..82828cd --- /dev/null +++ b/engines/billing/app/views/customer/_subs_form.html.haml @@ -0,0 +1,10 @@ +%p + = t(:personal_info) +%div + = text_field_tag :first_name, "",placeholder: "First Name", class: "radius" +%div + = text_field_tag :last_name, "",placeholder: "Last Name", class: "radius" +%div + = text_field_tag :company, "",placeholder: "Company", class: "radius" +%div + = text_field_tag :phone, "",placeholder: "Phone", class: "radius" diff --git a/engines/billing/app/views/customer/new.html.haml b/engines/billing/app/views/customer/new.html.haml index e1f5ba9..81185e4 100644 --- a/engines/billing/app/views/customer/new.html.haml +++ b/engines/billing/app/views/customer/new.html.haml @@ -1,24 +1,20 @@ -- if @result - #total-errors{:style => "color:red;"} - = h(@result.errors.size) - error(s) -= braintree_form_for :customer do |f| - = field_set_tag "Customer" do - %dl - %dt= f.label :first_name, 'First Name' - %dd= f.text_field :first_name - %dt= f.label :last_name, 'Last Name' - %dd= f.text_field :last_name - %dt= f.label :phone, 'Phone' - %dd= f.text_field :phone - = field_set_tag "Credit Card" do - - f.fields_for :credit_card do |cc| - %dl - %dt= cc.label :number, 'Number' - %dd= cc.text_field :number - %dt= cc.label :expiration_date, 'Expiration Date (MM/YY)' - %dd= cc.text_field :expiration_date - %dt= cc.label :cvv, 'CVV' - %dd= cc.text_field :cvv - = hidden_field_tag :tr_data, @tr_data - = f.submit 'Save Payment Info' +%h2.mbs New Customer +%br/ += form_tag new_customer_path, id: "checkout-form" do + - if current_user and !current_user.has_payment_info? + = render 'subs_form' unless current_user.is_anonymous? + %br/ + %p + = t(:donation_info) + %div{:id => "payment-form" } + %div{:id => "coinbase-container-id" } + %input{:name => "amount", :placeholder => "Enter amount", :type => "text"} + %input.btn.btn-primary{:type => "submit", :value => "Donate"} +%script{:src => "https://js.braintreegateway.com/v2/braintree.js"} +:javascript + var clientToken = "#{@client_token}"; + braintree.setup(clientToken, "dropin", { + container: "payment-form", + form: "checkout-form", + coinbase: { container: "coinbase-container-id" } + }); -- cgit v1.2.3 From 6c4f02fd2d530c28899561fac40ca76075975dc8 Mon Sep 17 00:00:00 2001 From: claucece Date: Sun, 27 Sep 2015 23:04:55 -0500 Subject: update to haml, created translations, deleted files --- .../app/views/customer/_customer_data.html.haml | 16 ------------- .../app/views/customer/_subs_form.html.haml | 10 -------- .../app/views/customer/_transaction.html.haml | 0 .../billing/app/views/customer/confirm.html.haml | 14 ----------- engines/billing/app/views/customer/edit.html.haml | 23 ------------------ engines/billing/app/views/customer/new.html.haml | 20 ---------------- engines/billing/app/views/customer/show.html.haml | 27 ---------------------- 7 files changed, 110 deletions(-) delete mode 100644 engines/billing/app/views/customer/_customer_data.html.haml delete mode 100644 engines/billing/app/views/customer/_subs_form.html.haml delete mode 100644 engines/billing/app/views/customer/_transaction.html.haml delete mode 100644 engines/billing/app/views/customer/confirm.html.haml delete mode 100644 engines/billing/app/views/customer/edit.html.haml delete mode 100644 engines/billing/app/views/customer/new.html.haml delete mode 100644 engines/billing/app/views/customer/show.html.haml (limited to 'engines/billing/app/views/customer') diff --git a/engines/billing/app/views/customer/_customer_data.html.haml b/engines/billing/app/views/customer/_customer_data.html.haml deleted file mode 100644 index 439ae5c..0000000 --- a/engines/billing/app/views/customer/_customer_data.html.haml +++ /dev/null @@ -1,16 +0,0 @@ -%legend= t(:customer_information) -%dl - %dt First Name - %dd= @customer.first_name - %dt Last Name - %dd= @customer.last_name - %dt Phone - %dd= @customer.phone -%legend= t(:credit_card_information) -%dl - %dt Number - %dd= @default_cc.masked_number - %dt Expiration Date - %dd= @default_cc.expiration_date - - if current_user == @user - = btn t(:edit_saved_data), edit_customer_path(@user.id) diff --git a/engines/billing/app/views/customer/_subs_form.html.haml b/engines/billing/app/views/customer/_subs_form.html.haml deleted file mode 100644 index 82828cd..0000000 --- a/engines/billing/app/views/customer/_subs_form.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%p - = t(:personal_info) -%div - = text_field_tag :first_name, "",placeholder: "First Name", class: "radius" -%div - = text_field_tag :last_name, "",placeholder: "Last Name", class: "radius" -%div - = text_field_tag :company, "",placeholder: "Company", class: "radius" -%div - = text_field_tag :phone, "",placeholder: "Phone", class: "radius" diff --git a/engines/billing/app/views/customer/_transaction.html.haml b/engines/billing/app/views/customer/_transaction.html.haml deleted file mode 100644 index e69de29..0000000 diff --git a/engines/billing/app/views/customer/confirm.html.haml b/engines/billing/app/views/customer/confirm.html.haml deleted file mode 100644 index eab9616..0000000 --- a/engines/billing/app/views/customer/confirm.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -%h1 Payment Info Confirmation -%p Your payment information was successfully saved. -%dl - %dt First Name - %dd= @result.customer.first_name - %dt Last Name - %dd= @result.customer.last_name - %dt Phone - %dd= @result.customer.phone - %dt Credit Card - - @result.customer.credit_cards.each do |cc| - %dd= cc.masked_number -- customer = Customer.find_by_user_id(@user.id) -= btn 'View Customer Info', show_customer_path(@user.id) diff --git a/engines/billing/app/views/customer/edit.html.haml b/engines/billing/app/views/customer/edit.html.haml deleted file mode 100644 index f461fcc..0000000 --- a/engines/billing/app/views/customer/edit.html.haml +++ /dev/null @@ -1,23 +0,0 @@ -- if @result - #total-errors{:style => "color:red;"} - = h(@result.errors.size) - error(s) -= braintree_form_for :customer, existing: @customer do |f| - = field_set_tag "Customer" do - %dl - %dt= f.label :first_name, 'First Name' - %dd= f.text_field :first_name - %dt= f.label :last_name, 'Last Name' - %dd= f.text_field :last_name - %dt= f.label :phone, 'Phone' - %dd= f.text_field :phone - - if @default_cc - = # todo, as they will need a credit card, so not sure about conditional? - %dt= t(:stored_credit_card) - %dd - = @default_cc.masked_number - = btn t(:change_credit_card), edit_credit_card_info_path(:id => @default_cc.token) - = hidden_field_tag :tr_data, @tr_data - .form-actions - = f.submit t(:save_customer_info), :class => 'btn btn-primary' - = btn t(:cancel), show_customer_path(@user) diff --git a/engines/billing/app/views/customer/new.html.haml b/engines/billing/app/views/customer/new.html.haml deleted file mode 100644 index 81185e4..0000000 --- a/engines/billing/app/views/customer/new.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -%h2.mbs New Customer -%br/ -= form_tag new_customer_path, id: "checkout-form" do - - if current_user and !current_user.has_payment_info? - = render 'subs_form' unless current_user.is_anonymous? - %br/ - %p - = t(:donation_info) - %div{:id => "payment-form" } - %div{:id => "coinbase-container-id" } - %input{:name => "amount", :placeholder => "Enter amount", :type => "text"} - %input.btn.btn-primary{:type => "submit", :value => "Donate"} -%script{:src => "https://js.braintreegateway.com/v2/braintree.js"} -:javascript - var clientToken = "#{@client_token}"; - braintree.setup(clientToken, "dropin", { - container: "payment-form", - form: "checkout-form", - coinbase: { container: "coinbase-container-id" } - }); diff --git a/engines/billing/app/views/customer/show.html.haml b/engines/billing/app/views/customer/show.html.haml deleted file mode 100644 index ce4d01a..0000000 --- a/engines/billing/app/views/customer/show.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -- if admin? and !@customer - = t(:no_saved_customer) -- else - = render :partial => 'customer_data' - %legend= t(:last_three_transactions) - - counter = 0 - = # these will be ordered with most recently created first, per http://stackoverflow.com/questions/16425475/ - - @transactions.each do |t| - - break if counter > 2 # not ruby-like, but object is a Braintree::ResourceCollection so limited methods available - = render :partial => "payments/transaction_details", :locals => {:transaction => t} - - counter += 1 - = btn :transaction_history, user_payments_path(@user) - %legend= t(:subscriptions) - - if @active_subscription - = render :partial => "subscriptions/subscription_details", :locals => {:subscription => @active_subscription} - - else - %p - = t(:no_relevant_subscription) - - if current_user == @user - %p - .form-actions - = btn :subscribe_to_plan, new_subscription_path - %p - = link_to t(:all_subscriptions), user_subscriptions_path(@user) - -.form-actions - = btn :make_donation, new_payment_path, :type => 'primary' -- cgit v1.2.3