Sha256: 29e14dfc0c4567b385543b1f85897361bd7e07a27f07bd0bcf61dc843b61ba2a
Contents?: true
Size: 1.07 KB
Versions: 46
Compression:
Stored size: 1.07 KB
Contents
module Spree module Admin module AdjustmentsHelper def adjustment_state(adjustment) state = adjustment.state.to_sym icon = { closed: 'lock', open: 'unlock' } content_tag(:span, '', class: "fa fa-#{ icon[state] }") end def display_adjustable(adjustable) case adjustable when Spree::LineItem display_line_item(adjustable) when Spree::Shipment display_shipment(adjustable) when Spree::Order display_order(adjustable) end end private def display_line_item(line_item) variant = line_item.variant parts = [] parts << variant.product.name parts << "(#{variant.options_text})" if variant.options_text.present? parts << line_item.display_total parts.join("<br>").html_safe end def display_shipment(shipment) "#{Spree.t(:shipment)} ##{shipment.number}<br>#{shipment.display_cost}".html_safe end def display_order(order) Spree.t(:order) end end end end
Version data entries
46 entries across 46 versions & 2 rubygems