- if @account.errors.any? .notice.notice-red{ :style => "margin-bottom: 15px" } %ul - @account.errors.full_messages.each do |msg| %li = msg %h1 = I18n.t "iugu.available_plans" %table.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{ :class => "#{ (plan.identifier == @subscription.plan_identifier) ? 'plan active_plan' : 'plan' }" } %td = plan.name %td - price = plan.price_by_currency @currency = 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 %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, :class => "btn btn-primary btn-block") = link_to I18n.t("iugu.back"), account_view_path(id: params[:id]), class: "btn btn-primary btn-block"