tap/app/views/order_items/_order_item.html.erb
benji 652c598722 Merge pull request #55 from VandorpeDavid/out_of_order
Red border when product is sold out
2015-08-24 16:02:29 +02:00

20 lines
771 B
Text

<div class="col-md-3 form_products">
<div class="thumbnail<%= ' out-of-stock' if product.stock.zero? %>">
<div class="form_row center">
<div class="form_row_image">
<%= image_tag product.avatar %>
</div>
<div class="caption">
<h4 class="text-nowrap">
<%= content_tag :span, product.name %>
<%= content_tag :small, euro(product.price) %>
</h4>
<%= f.counter :count, min: 0, max: product.stock, skip_label: true, wrapper_class: "input-group", class: "row_counter" %>
<%= f.fields_for :product do |product| %>
<%= product.hidden_field :price_cents, class: :price %>
<%= product.hidden_field :stock, class: :stock %>
<% end %>
</div>
</div>
</div>
</div>