Module: Forge::OrdersHelper

Defined in:
lib/forge/app/helpers/forge/orders_helper.rb

Instance Method Summary collapse

Instance Method Details



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/forge/app/helpers/forge/orders_helper.rb', line 3

def fulfillment_link(order)
  if order.fulfilled?
     :div, :class => "item-action fulfill" do
      icon_tag("yay") +
        (:div, "", :class => "spacer") +
        link_to("Unfulfill.", unfulfill_forge_order_path(order), :class => "unapprove", :method => :put, :id => order.id)
    end
  elsif order.aasm_events_for_state(order.state.to_sym).include?(:fulfill)
     :div, :class => "item-action fulfill" do
      icon_tag("nay") +
        (:div, "", :class => "spacer") +
        link_to("Fulfill", fulfill_forge_order_path(order), :class => "approve", :method => :put, :id => order.id)
    end
  end
end