Sha256: b7c7daf258414944040661ec6db074c734b316f1f858b4d342f37f66f80d2fd7

Contents?: true

Size: 1.6 KB

Versions: 2

Compression:

Stored size: 1.6 KB

Contents

- include_download_column = order.purchased? && order.order_items.any? { |order_item| order_item.purchased_download_url.present? rescue false }

.effective-order
  %table.table
    %thead
      %tr
        %th.quantity Qty
        %th.item= order.order_items.length > 1 ? 'Items' : 'Item'
        - if include_download_column
          %th.download Download
        %th.price Price

    %tbody
      - order.order_items.each do |item|
        %tr
          %td.quantity= item.quantity
          %td.item
            = item.title.html_safe
            - if order.new_record? && item.purchasable.kind_of?(Effective::Subscription)
              = render :partial => 'effective/orders/stripe/subscription_fields', :locals => {:form => form, :subscription => item.purchasable }

          - if include_download_column
            %td.download
              - if item.purchased? && (item.purchased_download_url rescue nil).present?
                = link_to 'download', item.purchased_download_url
              - else
                = '-'
          %td.price= price_to_currency(item.subtotal)

    %tfoot
      %tr
        %th.quantity
        - if include_download_column
          %th.download
        %th.subtotal Subtotal
        %td.price.subtotal-price= price_to_currency(order.subtotal)
      %tr
        %th.quantity
        - if include_download_column
          %th.download
        %th.tax Tax
        %td.price.tax-price= price_to_currency(order.tax)
      %tr
        %th.quantity
        - if include_download_column
          %th.download
        %th.total Total Due
        %td.price.total-price= price_to_currency(order.total)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
effective_orders-1.6.3 app/views/effective/orders/_order_items.html.haml
effective_orders-1.6.1 app/views/effective/orders/_order_items.html.haml