first shot on improving edit article form

(see also foodcoops#209)
This commit is contained in:
wvengen 2013-11-20 23:40:38 +01:00
parent 5adb25caf5
commit 84191ddcd0
2 changed files with 50 additions and 8 deletions

View file

@ -242,3 +242,23 @@ tr.unavailable {
.input-append button.add-on { .input-append button.add-on {
height: inherit; height: inherit;
} }
// inputs that are "in the background" - less visible
.less-visible {
color: #ddd;
input {
color: #ddd;
border-color: #eee;
-webkit-box-shadow: rgba(0, 0, 0, 0.05);
-moz-box-shadow: rgba(0, 0, 0, 0.05);
box-shadow: rgba(0, 0, 0, 0.05);
}
}
.less-visible:hover {
color: @textColor;
input {
color: @textColor;
border-color: @inputBorder;
}
}

View file

@ -5,21 +5,43 @@
= link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'} = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'}
%h3= t '.title' %h3= t '.title'
.modal-body .modal-body
= f.input :availability /= f.input :availability
= f.input :name = 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)
%span#unit_divide_container.less-visible
 per 
= f.input_field :unit, class: 'input-mini', id: 'article_unit_divide'
= f.input :origin = f.input :origin
= f.input :manufacturer = f.input :manufacturer
= f.input :unit
= f.input :note = f.input :note
= f.association :article_category = f.association :article_category
/ TODO labels
= f.input :price do
.inline-inputs
.input-prepend
%span.add-on= t 'number.currency.format.unit'
= f.input_field :price, class: 'input-mini'
.input-prepend
= f.label :tax, style: 'width: auto; margin-right: 10px; margin-left: 10px;'
.input-append
= f.input_field :tax, class: 'input-mini'
%span.add-on %
= f.input :deposit do
.inline-inputs
.input-prepend
%span.add-on= t 'number.currency.format.unit'
= f.input_field :deposit, class: 'input-mini'
%span#gross_price{style: 'margin-left: 10px'}
= Article.human_attribute_name(:gross_price) + ' ' + number_to_currency(@article.gross_price) rescue nil
= f.input :price
= f.input :unit_quantity
= f.input :order_number = f.input :order_number
= f.input :tax, :wrapper => :append do
= f.input_field :tax
%span.add-on %
= f.input :deposit
.modal-footer .modal-footer
= link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'}
= f.submit class: 'btn btn-primary' = f.submit class: 'btn btn-primary'