Module: Admin::Atreides::OrdersHelper

Includes:
Atreides::Extendable
Defined in:
app/helpers/admin/atreides/orders_helper.rb

Instance Method Summary collapse

Instance Method Details

#buyer_column(order) ⇒ Object



11
12
13
# File 'app/helpers/admin/atreides/orders_helper.rb', line 11

def buyer_column(order)
  (:div, (:abbr, order.full_name, :title => order.address), :class => "order-name")
end

#date_column(order) ⇒ Object



7
8
9
# File 'app/helpers/admin/atreides/orders_helper.rb', line 7

def date_column(order)
  order.created_at
end

#items_column(order) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'app/helpers/admin/atreides/orders_helper.rb', line 15

def items_column(order)
  order.line_items.map{|li|
    photo = li.product.photos.first
    link_to(
      image_tag(photo ? photo.image.url(:thumb) : "atreides/admin/product.png", :size => "50x50"), admin_product_path(li.product),
      :title => "#{li.product.title} - #{li.size} x #{li.qty}"
    )
  }.join
end

#order_column(order) ⇒ Object



3
4
5
# File 'app/helpers/admin/atreides/orders_helper.rb', line 3

def order_column(order)
  link_to order.number, admin_order_path(order)
end

#total_column(order) ⇒ Object



25
26
27
# File 'app/helpers/admin/atreides/orders_helper.rb', line 25

def total_column(order)
  order.final_amount.format
end