summaryrefslogtreecommitdiff
path: root/engines/billing
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-27 16:32:50 +0200
committerAzul <azul@leap.se>2014-05-27 16:32:50 +0200
commitcc59ce53e52bf48d97de16d66012e8309bf98fe8 (patch)
tree8b32b2a2f791723fe93b5d73fcc104d6a9729355 /engines/billing
parent863863ff1fb6c9ab13b44248417ae1c5e57987af (diff)
add btn helper for link_to with .btn
Also translates the first arg if it's a symbol and adds more btn- classes if given as html_options[:type]
Diffstat (limited to 'engines/billing')
-rw-r--r--engines/billing/app/views/credit_card_info/edit.html.haml3
-rw-r--r--engines/billing/app/views/customer/_customer_data.html.haml2
-rw-r--r--engines/billing/app/views/customer/confirm.html.haml2
-rw-r--r--engines/billing/app/views/customer/edit.html.haml4
-rw-r--r--engines/billing/app/views/customer/show.html.haml6
-rw-r--r--engines/billing/app/views/subscriptions/destroy.html.haml2
-rw-r--r--engines/billing/app/views/subscriptions/index.html.haml2
-rw-r--r--engines/billing/app/views/subscriptions/show.html.haml3
8 files changed, 12 insertions, 12 deletions
diff --git a/engines/billing/app/views/credit_card_info/edit.html.haml b/engines/billing/app/views/credit_card_info/edit.html.haml
index bd86a4c..9e44344 100644
--- a/engines/billing/app/views/credit_card_info/edit.html.haml
+++ b/engines/billing/app/views/credit_card_info/edit.html.haml
@@ -13,5 +13,4 @@
%dt= f.label :cvv, 'CVV'
%dd= f.text_field :cvv
= hidden_field_tag :tr_data, @tr_data
- = f.submit 'Save Payment Info', :class => :btn
- = link_to t(:cancel), edit_customer_path(@user.id), :class => :btn
+ = f.button :wrapped, 'Save Payment Info', cancel: edit_customer_path(@user.id)
diff --git a/engines/billing/app/views/customer/_customer_data.html.haml b/engines/billing/app/views/customer/_customer_data.html.haml
index e9df040..439ae5c 100644
--- a/engines/billing/app/views/customer/_customer_data.html.haml
+++ b/engines/billing/app/views/customer/_customer_data.html.haml
@@ -13,4 +13,4 @@
%dt Expiration Date
%dd= @default_cc.expiration_date
- if current_user == @user
- = link_to t(:edit_saved_data), edit_customer_path(@user.id), :class => :btn
+ = btn t(:edit_saved_data), edit_customer_path(@user.id)
diff --git a/engines/billing/app/views/customer/confirm.html.haml b/engines/billing/app/views/customer/confirm.html.haml
index 877a8ac..eab9616 100644
--- a/engines/billing/app/views/customer/confirm.html.haml
+++ b/engines/billing/app/views/customer/confirm.html.haml
@@ -11,4 +11,4 @@
- @result.customer.credit_cards.each do |cc|
%dd= cc.masked_number
- customer = Customer.find_by_user_id(@user.id)
-= link_to 'View Customer Info', show_customer_path(@user.id), :class=> :btn \ No newline at end of file
+= 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
index e882d53..f461fcc 100644
--- a/engines/billing/app/views/customer/edit.html.haml
+++ b/engines/billing/app/views/customer/edit.html.haml
@@ -16,8 +16,8 @@
%dt= t(:stored_credit_card)
%dd
= @default_cc.masked_number
- = link_to t(:change_credit_card), edit_credit_card_info_path(:id => @default_cc.token), :class => :btn
+ = 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'
- = link_to t(:cancel), show_customer_path(@user), :class=> :btn
+ = btn t(:cancel), show_customer_path(@user)
diff --git a/engines/billing/app/views/customer/show.html.haml b/engines/billing/app/views/customer/show.html.haml
index ec1779c..ce4d01a 100644
--- a/engines/billing/app/views/customer/show.html.haml
+++ b/engines/billing/app/views/customer/show.html.haml
@@ -9,7 +9,7 @@
- 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
- = link_to t(:transaction_history), user_payments_path(@user)
+ = btn :transaction_history, user_payments_path(@user)
%legend= t(:subscriptions)
- if @active_subscription
= render :partial => "subscriptions/subscription_details", :locals => {:subscription => @active_subscription}
@@ -19,9 +19,9 @@
- if current_user == @user
%p
.form-actions
- = link_to t(:subscribe_to_plan), new_subscription_path, :class => :btn
+ = btn :subscribe_to_plan, new_subscription_path
%p
= link_to t(:all_subscriptions), user_subscriptions_path(@user)
.form-actions
- = link_to t(:make_donation), new_payment_path, :class => 'btn btn-primary'
+ = btn :make_donation, new_payment_path, :type => 'primary'
diff --git a/engines/billing/app/views/subscriptions/destroy.html.haml b/engines/billing/app/views/subscriptions/destroy.html.haml
index 44b4333..e6e8578 100644
--- a/engines/billing/app/views/subscriptions/destroy.html.haml
+++ b/engines/billing/app/views/subscriptions/destroy.html.haml
@@ -4,4 +4,4 @@
Error:
= @result.message
%p
- = link_to 'Customer Information', show_customer_path(@user), :class=> :btn \ No newline at end of file
+ = btn 'Customer Information', show_customer_path(@user)
diff --git a/engines/billing/app/views/subscriptions/index.html.haml b/engines/billing/app/views/subscriptions/index.html.haml
index 3d4e8fd..1e3fb25 100644
--- a/engines/billing/app/views/subscriptions/index.html.haml
+++ b/engines/billing/app/views/subscriptions/index.html.haml
@@ -5,4 +5,4 @@
- pending_active_pastdue = true
= render :partial => "subscription_details", :locals => {:subscription => s}
- if !pending_active_pastdue and @user == current_user
- = link_to 'subscribe to plan', new_subscription_path, :class => :btn \ No newline at end of file
+ = btn 'subscribe to plan', new_subscription_path
diff --git a/engines/billing/app/views/subscriptions/show.html.haml b/engines/billing/app/views/subscriptions/show.html.haml
index 2699db9..af1a5a5 100644
--- a/engines/billing/app/views/subscriptions/show.html.haml
+++ b/engines/billing/app/views/subscriptions/show.html.haml
@@ -3,4 +3,5 @@
Current
Subscription
= render :partial => "subscription_details", :locals => {:subscription => @subscription}
-= link_to t(:cancel_subscription), user_subscription_path(@user, @subscription.id), :confirm => t(:are_you_sure), :method => :delete, :class => 'btn btn-danger' if allow_cancel_subscription(@subscription)
+- if allow_cancel_subscription(@subscription)
+ = btn :cancel_subscription, user_subscription_path(@user, @subscription.id), :confirm => t(:are_you_sure), :method => :delete, :type => 'danger'