cirandas.net

ref: master

plugins/orders/lib/orders_plugin/admin_helper.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
module OrdersPlugin::AdminHelper

  protected

  def order_situation order
    situation = order.situation
    order.situation.each_with_index.map do |status, i|
      classes = status.dup #do not change the status itself!
      text = t("orders_plugin.models.order.statuses.#{status}")
      if i == situation.size - 1
        classes << ' last'
      else
        text = text.chars.first
      end
      text += ' '

      content_tag 'span', text, :class => classes
    end.safe_join
  end

end