2011-07-15 20:14:26 -07:00
|
|
|
- show_controls ||= false # we could do user check here, but may as well do it once
|
2011-08-03 07:33:13 -07:00
|
|
|
%div{'class' => closet_hanger_partial_class(closet_hanger), 'data-item-id' => closet_hanger.item_id, 'data-quantity' => closet_hanger.quantity}
|
2011-07-12 17:03:04 -07:00
|
|
|
= render :partial => 'items/item_link', :locals => {:item => closet_hanger.item}
|
2011-07-29 07:52:04 -07:00
|
|
|
.quantity{:class => "quantity-#{closet_hanger.quantity}"}
|
2011-07-15 16:29:43 -07:00
|
|
|
%span= closet_hanger.quantity
|
2011-07-15 20:14:26 -07:00
|
|
|
- if show_controls
|
|
|
|
= form_for closet_hanger, :url => user_item_closet_hanger_path(current_user, closet_hanger.item), :html => {:class => 'closet-hanger-update'} do |f|
|
|
|
|
= return_to_field_tag
|
2011-07-30 10:40:41 -07:00
|
|
|
= f.hidden_field :list_id
|
2011-07-22 14:55:05 -07:00
|
|
|
= f.hidden_field :owned
|
2011-07-15 16:29:43 -07:00
|
|
|
= f.number_field :quantity, :min => 0, :required => true, :title => "You own #{pluralize closet_hanger.quantity, closet_hanger.item.name}"
|
|
|
|
= f.submit "Save"
|
2011-07-15 20:14:26 -07:00
|
|
|
- if show_controls
|
|
|
|
= form_tag user_item_closet_hanger_path(current_user, closet_hanger.item), :method => :delete, :class => 'closet-hanger-destroy' do
|
|
|
|
= return_to_field_tag
|
2011-07-22 14:55:05 -07:00
|
|
|
= hidden_field_tag 'closet_hanger[owned]', closet_hanger.owned
|
2011-07-15 20:14:26 -07:00
|
|
|
= submit_tag "Remove"
|
2011-07-12 17:03:04 -07:00
|
|
|
|