summaryrefslogtreecommitdiff
path: root/billing/app/views/subscriptions
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-10-17 13:58:54 -0700
committerjessib <jessib@riseup.net>2013-10-17 13:58:54 -0700
commit92cb054d53aaac6864a6a805d9cdd3919f4a38bc (patch)
tree5751471169043c1b1867d9640551ae5cd2c8380e /billing/app/views/subscriptions
parenta6f32017f5c7802798f10e2f4041037fb5684def (diff)
Some cleanup of code to deal with past due subscriptions.
Diffstat (limited to 'billing/app/views/subscriptions')
-rw-r--r--billing/app/views/subscriptions/_subscription_details.html.haml3
-rw-r--r--billing/app/views/subscriptions/show.html.haml2
2 files changed, 3 insertions, 2 deletions
diff --git a/billing/app/views/subscriptions/_subscription_details.html.haml b/billing/app/views/subscriptions/_subscription_details.html.haml
index 3a06c20..6145c95 100644
--- a/billing/app/views/subscriptions/_subscription_details.html.haml
+++ b/billing/app/views/subscriptions/_subscription_details.html.haml
@@ -1,7 +1,8 @@
%p
- if local_assigns[:show_user]
User:
- = link_to show_user.login, user_overview_path(show_user)
+ - user_to_show = user_for_subscription(subscription)
+ = link_to user_to_show.login, user_overview_path(user_to_show)
ID:
= link_to subscription.id, user_subscription_path(@user, subscription.id)
Balance:
diff --git a/billing/app/views/subscriptions/show.html.haml b/billing/app/views/subscriptions/show.html.haml
index f4d644a..2699db9 100644
--- a/billing/app/views/subscriptions/show.html.haml
+++ b/billing/app/views/subscriptions/show.html.haml
@@ -3,4 +3,4 @@
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 ['Active', 'Pending'].include? @subscription.status or admin? # permission check or should that just be on show? # should you be able to cancel pending 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)