Avoid long product names of fucking up entire layout

This commit is contained in:
benji 2015-07-01 16:19:36 +02:00
parent bf52027229
commit 90e270a03e
2 changed files with 22 additions and 1 deletions

View file

@ -37,3 +37,21 @@
.form_row .btn-lg {
padding: 10px 10px;
}
.form_row .caption {
h4 {
position: relative;
span {
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
display: inline-block;
padding-right: 50px;
}
small {
margin-left: -45px;
position: absolute;
top: 5px;
}
}
}

View file

@ -5,7 +5,10 @@
<%= image_tag product.avatar %>
</div>
<div class="caption">
<%= content_tag :h4, "#{product.name} (#{euro(product.price)})" %>
<h4 class="text-nowrap">
<%= content_tag :span, product.name %>
<%= content_tag :small, euro(product.price) %>
</h4>
<%= f.counter :count, skip_label: true, wrapper_class: "input-group", class: "row_counter" %>
<%= f.fields_for :product do |product| %>
<%= product.hidden_field :price_cents, class: :price %>