Sha256: c8d7c5df044e4117afa29269b2c31fc922c55eadcc33953b3d1ca1bd0f37138d

Contents?: true

Size: 1.84 KB

Versions: 51

Compression:

Stored size: 1.84 KB

Contents

- include_quantity_column = order.order_items.any? { |order_item| order_item.quantity > 1 }
- include_download_column = order.purchased? && order.order_items.any? { |order_item| order_item.purchased_download_url.present? }

.effective-order-items
  %table.table
    %thead
      %tr
        - if include_quantity_column
          %th.quantity Qty

        - if include_download_column
          %th.download Download

        %th.item= order.order_items.length > 1 ? 'Items' : 'Item'
        %th.price Price

    %tbody
      - order.order_items.each do |item|
        %tr
          - if include_quantity_column
            %td.quantity= item.quantity

          - if include_download_column
            %td.download
              - if item.purchased_download_url.present?
                = link_to 'download', item.purchased_download_url
              - else
                = '-'

          %td.item= item.name.html_safe
          %td.price= price_to_currency(item.subtotal)

    %tfoot
      - if order.tax.to_i != 0 || order.tax_rate == nil
        %tr
          - if include_quantity_column
            %th.quantity

          - if include_download_column
            %th.download

          %th.subtotal Subtotal
          %td.price.subtotal-price= price_to_currency(order.subtotal)

      - if order.tax.to_i != 0
        %tr
          - if include_quantity_column
            %th.quantity

          - if include_download_column
            %th.download

          %th.tax Tax (#{tax_rate_to_percentage(order.tax_rate)})
          %td.price.tax-price= price_to_currency(order.tax)

      - if order.tax_rate.present?
        %tr
          - if include_quantity_column
            %th.quantity

          - if include_download_column
            %th.download

          %th.total
            = order.total_label

          %td.price.total-price= price_to_currency(order.total)

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
effective_orders-5.9.4 app/views/effective/orders/_order_items.html.haml
effective_orders-5.9.3 app/views/effective/orders/_order_items.html.haml
effective_orders-5.9.2 app/views/effective/orders/_order_items.html.haml
effective_orders-5.9.1 app/views/effective/orders/_order_items.html.haml
effective_orders-5.9.0 app/views/effective/orders/_order_items.html.haml
effective_orders-5.8.2 app/views/effective/orders/_order_items.html.haml
effective_orders-5.8.1 app/views/effective/orders/_order_items.html.haml
effective_orders-5.8.0 app/views/effective/orders/_order_items.html.haml
effective_orders-5.7.4 app/views/effective/orders/_order_items.html.haml
effective_orders-5.7.3 app/views/effective/orders/_order_items.html.haml
effective_orders-5.7.2 app/views/effective/orders/_order_items.html.haml
effective_orders-5.7.1 app/views/effective/orders/_order_items.html.haml
effective_orders-5.7.0 app/views/effective/orders/_order_items.html.haml
effective_orders-5.6.2 app/views/effective/orders/_order_items.html.haml
effective_orders-5.6.1 app/views/effective/orders/_order_items.html.haml
effective_orders-5.6.0 app/views/effective/orders/_order_items.html.haml
effective_orders-5.5.2 app/views/effective/orders/_order_items.html.haml
effective_orders-5.5.1 app/views/effective/orders/_order_items.html.haml
effective_orders-5.5.0 app/views/effective/orders/_order_items.html.haml
effective_orders-5.4.4 app/views/effective/orders/_order_items.html.haml