From 0fe1678cd37c8e917cb28eed9eb28777d3a92283 Mon Sep 17 00:00:00 2001 From: jessib Date: Tue, 1 Oct 2013 13:56:59 -0700 Subject: Allow admins to view past-due subscriptions. --- billing/app/views/billing_admin/show.html.haml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 billing/app/views/billing_admin/show.html.haml (limited to 'billing/app/views/billing_admin/show.html.haml') diff --git a/billing/app/views/billing_admin/show.html.haml b/billing/app/views/billing_admin/show.html.haml new file mode 100644 index 0000000..78843e5 --- /dev/null +++ b/billing/app/views/billing_admin/show.html.haml @@ -0,0 +1,17 @@ +- # todo: move into helper, as following 2 are pretty much identical +%legend= t(:more_than_90_days_past_due) +- if @past_due_atleast_90_days.empty? + = t(:none) +- else + - @past_due_atleast_90_days.each do |past_due_subscription| + = render :partial => "subscriptions/subscription_details", :locals => {:subscription => past_due_subscription, :show_user => user_for_subscription(past_due_subscription)} + +%legend= t(:all_past_due) +- if @all_past_due.empty? + = t(:none) +- else + - @all_past_due.each do |past_due_subscription| + = render :partial => "subscriptions/subscription_details", :locals => {:subscription => past_due_subscription, :show_user => user_for_subscription(past_due_subscription)} + +%legend= t(:your_settings) += link_to 'view own billing settings', show_or_new_customer_link(current_user) \ No newline at end of file -- cgit v1.2.3 From e4d422142fb2db2153916bed5826651e8418b7a0 Mon Sep 17 00:00:00 2001 From: jessib Date: Thu, 3 Oct 2013 12:06:57 -0700 Subject: Some refactoring of displayed of past-due subscriptions. --- billing/app/views/billing_admin/show.html.haml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'billing/app/views/billing_admin/show.html.haml') diff --git a/billing/app/views/billing_admin/show.html.haml b/billing/app/views/billing_admin/show.html.haml index 78843e5..a275a5e 100644 --- a/billing/app/views/billing_admin/show.html.haml +++ b/billing/app/views/billing_admin/show.html.haml @@ -1,17 +1,9 @@ -- # todo: move into helper, as following 2 are pretty much identical +- # todo: move into helper, as following 2 are pretty much identical (show_set_user_subscriptions is started) %legend= t(:more_than_90_days_past_due) -- if @past_due_atleast_90_days.empty? - = t(:none) -- else - - @past_due_atleast_90_days.each do |past_due_subscription| - = render :partial => "subscriptions/subscription_details", :locals => {:subscription => past_due_subscription, :show_user => user_for_subscription(past_due_subscription)} += show_set_user_subscriptions(@past_due_atleast_90_days) %legend= t(:all_past_due) -- if @all_past_due.empty? - = t(:none) -- else - - @all_past_due.each do |past_due_subscription| - = render :partial => "subscriptions/subscription_details", :locals => {:subscription => past_due_subscription, :show_user => user_for_subscription(past_due_subscription)} += show_set_user_subscriptions(@all_past_due) %legend= t(:your_settings) = link_to 'view own billing settings', show_or_new_customer_link(current_user) \ No newline at end of file -- cgit v1.2.3 From 72af3e2efd8e0c8c399f0765da8bc6d1597fcb6b Mon Sep 17 00:00:00 2001 From: jessib Date: Thu, 3 Oct 2013 12:08:50 -0700 Subject: And removing comment.. --- billing/app/views/billing_admin/show.html.haml | 1 - 1 file changed, 1 deletion(-) (limited to 'billing/app/views/billing_admin/show.html.haml') diff --git a/billing/app/views/billing_admin/show.html.haml b/billing/app/views/billing_admin/show.html.haml index a275a5e..3881dc7 100644 --- a/billing/app/views/billing_admin/show.html.haml +++ b/billing/app/views/billing_admin/show.html.haml @@ -1,4 +1,3 @@ -- # todo: move into helper, as following 2 are pretty much identical (show_set_user_subscriptions is started) %legend= t(:more_than_90_days_past_due) = show_set_user_subscriptions(@past_due_atleast_90_days) -- cgit v1.2.3 From 92cb054d53aaac6864a6a805d9cdd3919f4a38bc Mon Sep 17 00:00:00 2001 From: jessib Date: Thu, 17 Oct 2013 13:58:54 -0700 Subject: Some cleanup of code to deal with past due subscriptions. --- billing/app/views/billing_admin/show.html.haml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'billing/app/views/billing_admin/show.html.haml') diff --git a/billing/app/views/billing_admin/show.html.haml b/billing/app/views/billing_admin/show.html.haml index 3881dc7..0382cf0 100644 --- a/billing/app/views/billing_admin/show.html.haml +++ b/billing/app/views/billing_admin/show.html.haml @@ -1,8 +1,7 @@ %legend= t(:more_than_90_days_past_due) -= show_set_user_subscriptions(@past_due_atleast_90_days) - += render(:partial => "subscriptions/subscription_details", :collection => @past_due_atleast_90_days, :as => 'subscription', :locals => {:show_user => true}) || t(:none) %legend= t(:all_past_due) -= show_set_user_subscriptions(@all_past_due) += render(:partial => "subscriptions/subscription_details", :collection => @all_past_due, :as => 'subscription', :locals => {:show_user => true}) || t(:none) %legend= t(:your_settings) = link_to 'view own billing settings', show_or_new_customer_link(current_user) \ No newline at end of file -- cgit v1.2.3