summaryrefslogtreecommitdiff
path: root/billing/app/views/subscriptions
diff options
context:
space:
mode:
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)