1
0
Fork 0
forked from OpenNeo/impress
impress/app/views/closet_hangers/_closet_hanger.html.haml
2011-07-29 10:52:04 -04:00

17 lines
965 B
Text

- show_controls ||= false # we could do user check here, but may as well do it once
.object
= render :partial => 'items/item_link', :locals => {:item => closet_hanger.item}
.quantity{:class => "quantity-#{closet_hanger.quantity}"}
%span= closet_hanger.quantity
- 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
= f.hidden_field :owned
= f.number_field :quantity, :min => 0, :required => true, :title => "You own #{pluralize closet_hanger.quantity, closet_hanger.item.name}"
= f.submit "Save"
- 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
= hidden_field_tag 'closet_hanger[owned]', closet_hanger.owned
= submit_tag "Remove"