app/views/iugu/plan/index.html.haml in iugusdk-1.0.0.alpha.21 vs app/views/iugu/plan/index.html.haml in iugusdk-1.0.0.alpha.22
- old
+ new
@@ -1,25 +1,32 @@
-= I18n.t "iugu.available_plans"
-%br
-%br
+%h3
+ = I18n.t "iugu.available_plans"
+
%table
%tr
%th
= I18n.t "iugu.plan"
%th
= "#{I18n.t("iugu.price")} (#{@currency})"
%th
+ = I18n.t "iugu.duration"
+ %th
- @plans.reverse.each do |plan|
- %tr
+ %tr{ :class => "#{ (plan.identifier == @subscription.plan_identifier) ? 'plan active_plan' : 'plan' }" }
%td
= plan.name
%td
- price = plan.price_by_currency @currency
- = price.value_cents
+ = Money.new(price.value_cents, @currency).format
%td
+ = "#{plan.interval} #{I18n.t("iugu.interval_type." + (plan.interval == 1 ? plan.interval_type.singularize : plan.interval_type))}"
+ %td{ :style => "text-align:center" }
- if plan.identifier == @subscription.plan_identifier
- = I18n.t "iugu.your_plan"
+ %strong
+ = I18n.t "iugu.your_plan"
- else
- text = "iugu.change_plan"
- text = "iugu.upgrade" if price.value_cents > @subscription.price_cents
- text = "iugu.downgrade" if price.value_cents < @subscription.price_cents
- = link_to(I18n.t(text), plan_change_url(id: @account.id.to_param, plan: plan.identifier), method: :post)
+ = link_to(I18n.t(text), plan_change_url(id: @account.id.to_param, plan: plan.identifier), method: :post, :class => "button no-bottom-margin")
+
+= link_to I18n.t("iugu.back"), account_view_path(id: params[:id]), class: "button no-bottom-margin"