forked from OpenNeo/impress
Matchu
2876de2db0
We lose no-JS support, which I kinda miss, but caching is gonna be more important down the line. Delete form moves next, then we cache. CSRF token changes: it looks like, by setting a data attribute in AJAX, I was overwriting the CSRF token. I don't remember it working that way, but now we use beforeSend to add the X-CSRF-Token header instead, which is nicer, anyway. The issue might've been something else, but this worked :/ The CSS was also not showing the loading ellipsis properly. I think that's a dev-only issue in how live assets are being served versus static assets, but may as well add UTF-8 charset directives everywhere, anyway.
10 lines
689 B
Text
10 lines
689 B
Text
- show_controls ||= false # we could do user check here, but may as well do it once
|
|
%div{'class' => closet_hanger_partial_class(closet_hanger), 'data-item-id' => closet_hanger.item_id, 'data-quantity' => closet_hanger.quantity, 'data-id' => closet_hanger.id}
|
|
= render :partial => 'items/item_link', :locals => {:item => closet_hanger.item}
|
|
.quantity{:class => "quantity-#{closet_hanger.quantity}"}
|
|
%span= closet_hanger.quantity
|
|
- if show_controls
|
|
= form_tag [current_user, closet_hanger], :method => :delete, :class => 'closet-hanger-destroy' do
|
|
= return_to_field_tag
|
|
= hidden_field_tag 'closet_hanger[owned]', closet_hanger.owned
|
|
= submit_tag t('.delete')
|