Sha256: f046fa772b9743f40aea774eace829a3a955057910b4fae7d66b3e00ef7cdfb9

Contents?: true

Size: 1.45 KB

Versions: 3

Compression:

Stored size: 1.45 KB

Contents

- 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"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
iugusdk-1.0.4 app/views/iugu/plan/index.html.haml
iugusdk-1.0.3 app/views/iugu/plan/index.html.haml
iugusdk-1.0.2 app/views/iugu/plan/index.html.haml