make new article dialog more responsive

This commit is contained in:
wvengen 2013-12-10 16:41:26 +01:00
parent 58de1a231b
commit 85b6ff908b
3 changed files with 41 additions and 25 deletions

View file

@ -248,11 +248,28 @@ tr.unavailable {
margin: 0;
}
.inline-inputs {
.control-label {
float: none;
display: inline;
vertical-align: middle;
margin: 0 10px;
// two-column layout in forms (landscape tablet and wider only)
@media (min-width: 768px) {
.form-horizontal .twocol {
.control-group:nth-child(odd) {
float: left;
}
.control-group:nth-child(even) {
.control-label {
width: auto;
margin: 0 10px;
}
// fix margin somehow off
// XXX there must be a better way
margin-bottom: 0;
.controls p {
margin-bottom: 20px;
}
}
}
}
// allow to have indicator text instead of input with same markup
.control-text {
margin-top: 5px;
}

View file

@ -7,35 +7,34 @@
.modal-body
= f.input :availability
= f.input :name
= f.input :unit do
.inline-inputs
= f.input_field :unit_quantity, class: 'input-mini', title: Article.human_attribute_name(:unit_quantity)
×
= f.input_field :unit, class: 'input-mini', title: Article.human_attribute_name(:unit)
.twocol
= f.input :unit_quantity, label: Article.human_attribute_name(:unit),
input_html: {class: 'input-mini', title: Article.human_attribute_name(:unit_quantity)}
= f.input :unit, label: '×'.html_safe,
input_html: {class: 'input-mini', title: Article.human_attribute_name(:unit)}
= f.input :note
= f.association :article_category
/ TODO labels
= f.input :price do
.inline-inputs
.twocol
= f.input :price do
.input-prepend
%span.add-on= t 'number.currency.format.unit'
= f.input_field :price, class: 'input-mini'
.input-prepend
= f.label :tax
.input-append
= f.input_field :tax, class: 'input-mini'
%span.add-on %
= f.input :deposit do
.inline-inputs
= f.input :tax do
.input-append
= f.input_field :tax, class: 'input-mini'
%span.add-on %
= f.input :deposit do
.input-prepend
%span.add-on= t 'number.currency.format.unit'
= f.input_field :deposit, class: 'input-mini'
%span#gross_price{style: 'margin-left: 10px'}
.control-group
%label.control-label{for: 'article_fc_price'}
= Article.human_attribute_name(:fc_price)
%span#fc_price= number_to_currency(@article.fc_price) rescue nil
.controls.control-text#article_fc_price
= number_to_currency(@article.fc_price) rescue nil
= f.input :origin
= f.input :manufacturer
@ -53,5 +52,5 @@
// Article#gross_price and Article#fc_price
var gross_price = (price + deposit) * (tax / 100 + 1);
var fc_price = gross_price * (#{FoodsoftConfig[:price_markup].to_f} / 100 + 1);
$('#fc_price').html($.isNumeric(fc_price) ? I18n.l("currency", fc_price) : '…');
$('#article_fc_price').html($.isNumeric(fc_price) ? I18n.l("currency", fc_price) : '…');
});

View file

@ -1341,7 +1341,7 @@ en:
default_message: Errors were found. Please check the form.
hints:
article:
unit: ! 'For example: KG or 1L or 500g'
unit: e.g. KG or 1L or 500g
message:
private: Message doesnt show in Foodsoft mail inbox
order_article: