simplify i18n and fix some small ui issues

This commit is contained in:
wvengen 2013-11-23 17:28:21 +01:00
parent 135e938d3d
commit 652a392b37
7 changed files with 58 additions and 165 deletions

View file

@ -27,22 +27,22 @@
%h2= @order.name %h2= @order.name
%dl.dl-horizontal %dl.dl-horizontal
- unless @order.note.blank? - unless @order.note.blank?
%dt= t '.note' %dt= heading_helper Order, :note
%dd= @order.note %dd= @order.note
%dt= t '.created_by' %dt= heading_helper Order, :created_by
%dd= show_user_link(@order.created_by) %dd= show_user_link(@order.created_by)
%dt= t '.ending' %dt= heading_helper Order, :ends
%dd= format_time(@order.ends) %dd= format_time(@order.ends)
- unless @order.stockit? or @order.supplier.min_order_quantity.blank? - unless @order.stockit? or @order.supplier.min_order_quantity.blank?
%dt= t '.min_quantity' %dt= heading_helper Supplier, :min_order_quantity, short: true
%dd= @order.supplier.min_order_quantity %dd= @order.supplier.min_order_quantity
%dt= t '.sum_amount' %dt= t '.sum_amount'
%dd= number_to_currency @order.sum %dd= number_to_currency @order.sum
%dt= t '.last_update' %dt= heading_helper GroupOrder, :updated_by
%dd %dd
= show_user(@group_order.updated_by) if @group_order.updated_by = show_user(@group_order.updated_by) if @group_order.updated_by
(#{format_time(@group_order.updated_on)}) (#{format_time(@group_order.updated_on)})
%dt= t '.funds' %dt= heading_helper Ordergroup, :available_funds
%dd= number_to_currency(@ordering_data[:available_funds]) %dd= number_to_currency(@ordering_data[:available_funds])
.well.pull-right .well.pull-right
@ -65,20 +65,20 @@
%table.table.table-hover %table.table.table-hover
%thead %thead
%tr %tr
%th= t '.name' %th= heading_helper Article, :name
- if @order.stockit? - if @order.stockit?
%th{style: 'width:120px'}= t '.supplier' %th{style: 'width:120px'}= heading_helper StockArticle, :supplier
%th{style: "width:13px;"} %th{style: "width:13px;"}
%th{style: "width:4.5em;"}= t '.price' %th{style: "width:4.5em;"}= t '.price'
%th{style: "width:4.5em;"}= t '.unit' %th{style: "width:4.5em;"}= heading_helper Article, :unit
- unless @order.stockit? - unless @order.stockit?
%th{style: "width:70px;"}= t '.unit_missing' %th{style: "width:70px;"}= heading_helper OrderArticle, :missing_units, short: true
%th#col_required= t '.amount' %th#col_required= heading_helper GroupOrderArticle, :quantity
%th#col_tolerance= t '.tolerance' %th#col_tolerance= heading_helper GroupOrderArticle, :tolerance
- else - else
%th(style="width:20px")= t '.available' %th(style="width:20px")= heading_helper StockArticle, :available
%th#col_required= t '.amount' %th#col_required= heading_helper GroupOrderArticle, :quantity
%th{style: "width:15px;"}= t '.sum' %th{style: "width:15px;"}= heading_helper GroupOrderArticle, :total_price
%tbody.list %tbody.list
- @order.articles_grouped_by_category.each do |category, order_articles| - @order.articles_grouped_by_category.each do |category, order_articles|
%tr.list-heading.article-category %tr.list-heading.article-category
@ -132,11 +132,11 @@
%span{id: "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance] %span{id: "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance]
%br/ %br/
.pull-left .pull-left
#{t '.manufacturer'}: #{order_article.article.manufacturer} #{heading_helper Article, :manufacturer}: #{order_article.article.manufacturer}
%br/ %br/
#{t '.units'}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit} #{t '.units'}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit}
%br/ %br/
#{t '.note'}: #{order_article.article.note} #{heading_helper Article, :note}: #{order_article.article.note}
%br/ %br/
#order-footer #order-footer
#info-box #info-box
@ -147,7 +147,7 @@
%td.currency %td.currency
%span#total_price= number_to_currency(@group_order.price) %span#total_price= number_to_currency(@group_order.price)
%tr %tr
%td= t('.available_funds') + ':' %td= heading_helper(Ordergroup, :available_funds) + ':'
%td.currency= number_to_currency(@ordering_data[:available_funds]) %td.currency= number_to_currency(@ordering_data[:available_funds])
%tr %tr
%td= t('.new_funds') + ':' %td= t('.new_funds') + ':'

View file

@ -1,9 +1,9 @@
%table.table.table-striped %table.table.table-striped
%thead %thead
%tr %tr
%th= t '.supplier' %th= heading_helper Order, :name
%th= t '.ending' %th= heading_helper Order, :ends
%th= t '.sum' %th= heading_helper GroupOrder, :price
%tbody %tbody
- for order in orders - for order in orders
- group_order = order.group_order(@ordergroup) # Get GroupOrder if possible - group_order = order.group_order(@ordergroup) # Get GroupOrder if possible

View file

@ -6,22 +6,22 @@
%h2= t '.funds.title' %h2= t '.funds.title'
%table.table.table-striped %table.table.table-striped
%tr %tr
%td= t('.funds.account_balance') + ':' %td= heading_helper Ordergroup, :account_balance
%td.numeric{:style => "width:5em"}= number_to_currency(@ordergroup.account_balance) %td.numeric{:style => "width:5em"}= number_to_currency(@ordergroup.account_balance)
%tr %tr
%td= '- ' + t('.funds.open_orders') + ':' %td= '- ' + t('.funds.open_orders')
%td.numeric= number_to_currency(@ordergroup.value_of_open_orders) %td.numeric= number_to_currency(@ordergroup.value_of_open_orders)
%tr %tr
%td= '- ' + t('.funds.finished_orders') + ':' %td= '- ' + t('.funds.finished_orders')
%td.numeric= number_to_currency(@ordergroup.value_of_finished_orders) %td.numeric= number_to_currency(@ordergroup.value_of_finished_orders)
%tr %tr
%th= t('.funds.available_funds') + ':' %th= heading_helper Ordergroup, :available_funds
%th.numeric= number_to_currency(@ordergroup.get_available_funds) %th.numeric= number_to_currency(@ordergroup.get_available_funds)
= render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup} = render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup}
// finished orders // finished orders
- unless Order.finished.empty? - unless Order.finished_not_closed.empty?
%section %section
%h2= t '.finished_orders.title' %h2= t '.finished_orders.title'
= render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false} = render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false}

View file

@ -1,88 +0,0 @@
- content_for :head do
= render 'data'
= render :partial => 'order_head'
- form_tag(:action => 'saveOrder', :id => @order) do
.single_column{:style => "clear:both;margin-bottom:7em;"}
.box_title
%h2= t '.title'
.column_content
%table#order.list
%thead
%tr
%th= t 'group_orders.form.name'
%th{:style => "width:13px;"}
%th{:style => "width:4.5em;"}= t 'group_orders.form.price'
%th{:style => "width:4.5em;"}= t 'group_orders.form.unit'
%th{:style => "width:70px;"}= t 'group_orders.form.unit_missing'
%th#col_required= t 'group_orders.form.amount'
- if not @order.stockit?
%th#col_tolerance= t 'group_orders.form.tolerance'
%th{:style => "width:15px;"}= t 'group_orders.form.sum'
%tbody
- total = 0
- i = 0
- @articles_grouped_by_category.each do |category, order_articles|
%tr{:style => "background-color:#EFEFEF"}
%td{:style => "text-align:left"}
%b= h category
%td{:colspan => "9"}
- order_articles.each do |order_article|
- if FoodsoftConfig[:tolerance_is_costly]
- article_total = @price[i] * (@tolerance[i] + @quantity[i])
- else
- article_total = @price[i] * @quantity[i]
- total += article_total
%tr{:class => "#{cycle('even', 'odd', :name => 'articles')} order-article", :valign => "top"}
%td.name= order_article.article.name
%td= h order_article.article.origin
%td= number_to_currency(@price[i])
%td= order_article.article.unit
%td
%span{:id => "missing_units_#{i}"}
- if @order.stockit?
- order_article.article.quantity_available
- else
- missing_units = @unit[i] - (((@quantity[i] + @others_quantity[i]) % @unit[i]) + @tolerance[i] + @others_tolerance[i])
- missing_units < 0 ? 0 : missing_units
%td.quantity
%input{:id => "q_#{i}", :name => "ordered[#{order_article.id}][quantity]", :size => "2", :type => "hidden", :value => @quantity[i]}/
%span.used{:id => "q_used_#{i}"}= @used_quantity[i]
+
%span.unused{:id => "q_unused_#{i}"}= @quantity[i] - @used_quantity[i]
= button_to_function('+', "increaseQuantity(#{i})")
= button_to_function('-', "decreaseQuantity(#{i})")
- unless @order.stockit?
%td.tolerance
%input{:id => "t_#{i}", :name => "ordered[#{order_article.id}][tolerance]", :size => "2", :type => "hidden", :value => @tolerance[i]}/
- if (@unit[i] > 1)
%span.used{:id => "t_used_#{i}"}= @used_tolerance[i]
+
%span.unused{:id => "t_unused_#{i}"}= @tolerance[i] - @used_tolerance[i]
= button_to_function('+', "increaseTolerance(#{i})")
= button_to_function('-', "decreaseTolerance(#{i})")
%td{:id => "td_price_#{i}", :style => "text-align:right; padding-right:10px; width:4em"}
%span{:id => "price_#{i}_display"}= number_to_currency(article_total, :unit => "")
.article-info
%h3= order_article.article.name
.right
= t('group_orders.form.units_full') + ':'
%span{:id => "units_#{i}"}= order_article.units_to_order
%br/
= t('group_orders.form.total_units') + ':'
%span{:id => "q_total_#{i}"}= @quantity[i] + @others_quantity[i]
%br/
= t('group_orders.form.total_tolerance') + ':'
%span{:id => "t_total_#{i}"}= @tolerance[i] + @others_tolerance[i]
%br/
.left
#{t 'group_orders.form.manufacturer'}: #{order_article.article.manufacturer}
%br/
#{t 'group_orders.form.units'}: #{@order.stockit? ? order_article.article.quantity_available : @unit[i]} * #{h order_article.article.unit}
%br/
#{t 'group_orders.form.note'}: #{order_article.article.note}
%br/
- i = i + 1
= render "order_footer", :total => total

View file

@ -9,21 +9,22 @@
.well .well
// Order summary // Order summary
%dl.dl-horizontal %dl.dl-horizontal
%dt= t '.supplier' %dt= heading_helper Order, :name
%dd= @order.name %dd= @order.name
%dt= t '.note' %dt= heading_helper Order, :note
%dd= @order.note %dd= @order.note
%dt= t '.ending' %dt= heading_helper Order, :ends
%dd= format_time(@order.ends) %dd= format_time(@order.ends)
%dt= t '.order_sum' %dt= heading_helper GroupOrder, :price
%dd %dd
- if @group_order - if @group_order
= number_to_currency(@group_order.price) = number_to_currency(@group_order.price)
- else - else
= t '.not_ordered' = t '.not_ordered'
- if @order.closed? - if @order.closed?
%p= t '.closed_by', user: show_user(@order.updated_by) %dt= heading_helper Order, :closed_by
= link_to t('.comment'), "#comments" %dd= show_user_link @order.updated_by
%p= link_to t('.comment'), "#comments"
// Article box // Article box
%section %section
@ -35,8 +36,8 @@
%table.table.table-hover %table.table.table-hover
%thead %thead
%tr %tr
%th{style: "width:40%"}= t '.articles.name' %th{style: "width:40%"}= heading_helper Article, :name
%th= t '.articles.units' %th= heading_helper Article, :units
%th= t '.articles.unit_price' %th= t '.articles.unit_price'
%th %th
%abbr{title: t('.articles.ordered_title')}= t '.articles.ordered' %abbr{title: t('.articles.ordered_title')}= t '.articles.ordered'
@ -46,7 +47,7 @@
= t '.articles.order_open' = t '.articles.order_open'
- else - else
= t '.articles.order_not_open' = t '.articles.order_not_open'
%th= t '.articles.total_price' %th= heading_helper GroupOrderArticle, :total_price
%tbody %tbody
- for category_name, order_articles in @order.articles_grouped_by_category - for category_name, order_articles in @order.articles_grouped_by_category
%tr.article-category %tr.article-category
@ -61,7 +62,7 @@
%td{style: "width:40%"} %td{style: "width:40%"}
= oa.article.name = oa.article.name
- unless oa.article.note.blank? - unless oa.article.note.blank?
= image_tag("lamp_grey.png", {alt: "Notiz anzeigen", size: "15x16", border: "0", onmouseover: "$('note_#{oa.id}').show();", onmouseout: "$('note_#{oa.id}').hide();"}) = image_tag("lamp_grey.png", {alt: t('.articles.show_note'), size: "15x16", border: "0", onmouseover: "$('#note_#{oa.id}').show();", onmouseout: "$('#note_#{oa.id}').hide();"})
%td= "#{oa.price.unit_quantity} x #{oa.article.unit}" %td= "#{oa.price.unit_quantity} x #{oa.article.unit}"
%td= number_to_currency(oa.price.fc_price) %td= number_to_currency(oa.price.fc_price)
%td %td
@ -73,7 +74,7 @@
%tr{id: "note_#{oa.id}", class: "note even", style: "display:none"} %tr{id: "note_#{oa.id}", class: "note even", style: "display:none"}
%td{colspan: "6"}=h oa.article.note %td{colspan: "6"}=h oa.article.note
%tr{class: cycle('even', 'odd', name: 'articles')} %tr{class: cycle('even', 'odd', name: 'articles')}
%th{colspan: "5"}= t '.articles.sum' %th{colspan: "5"}= heading_helper GroupOrder, :price
%th= number_to_currency(@group_order.price) %th= number_to_currency(@group_order.price)
%br/ %br/
= link_to_top = link_to_top

View file

@ -7,10 +7,10 @@
%table.table.table-striped %table.table.table-striped
%thead %thead
%tr %tr
%th= t '.supplier' %th= heading_helper Order, :name
%th= t '.ending' %th= heading_helper Order, :ends
%th= t '.who_ordered' %th= t '.who_ordered'
%th= t '.total' %th= heading_helper GroupOrder, :price
%tbody %tbody
- total = 0 - total = 0
- Order.open.each do |order| - Order.open.each do |order|

View file

@ -20,6 +20,7 @@ en:
supplier: Supplier supplier: Supplier
tax: VAT tax: VAT
unit: Unit unit: Unit
units: Units
unit_quantity: Unit quantity unit_quantity: Unit quantity
unit_quantity_short: U.Q. unit_quantity_short: U.Q.
article_category: article_category:
@ -35,9 +36,15 @@ en:
note: Note note: Note
ordergroup: Ordergroup ordergroup: Ordergroup
user: Entered by user: Entered by
group_order:
updated_by: Last ordered by
price: Order sum
group_order_article: group_order_article:
ordergroup_id: Ordergroup ordergroup_id: Ordergroup
result: Amount result: Amount
quantity: Amount
tolerance: Tolerance
total_price: Sum
invoice: invoice:
amount: Amount amount: Amount
date: Billing date date: Billing date
@ -57,6 +64,7 @@ en:
sent_to_all: Send to all members sent_to_all: Send to all members
subject: Subject subject: Subject
order: order:
closed_by: Settled by
created_by: Created by created_by: Created by
ends: Ends at ends: Ends at
name: Supplier name: Supplier
@ -64,11 +72,15 @@ en:
starts: Starts at starts: Starts at
status: Status status: Status
order_article: order_article:
missing_units: Missing units
missing_units_short: Missing
units_to_order: Amount of units units_to_order: Amount of units
update_current_price: Globally update current price update_current_price: Globally update current price
order_comment: order_comment:
text: Add comment to this order ... text: Add comment to this order ...
ordergroup: ordergroup:
available_funds: Available credit
account_balance: Account balance
contact_address: Address contact_address: Address
contact_person: Contact person contact_person: Contact person
contact_phone: Phone contact_phone: Phone
@ -82,9 +94,9 @@ en:
title: Title title: Title
stock_article: stock_article:
price: Price price: Price
quantity: Quantity available: Available
quantity_available: Available quantity quantity_available: Available quantity
supplier: Supplier quantity_available_short: Avail.
stock_taking: stock_taking:
date: Date date: Date
note: Note note: Note
@ -98,6 +110,7 @@ en:
fax: Fax fax: Fax
is_subscribed: subscribed? is_subscribed: subscribed?
min_order_quantity: Minimum order quantity min_order_quantity: Minimum order quantity
min_order_quantity_short: Min. quantity
name: Name name: Name
note: Note note: Note
order_howto: How to order order_howto: How to order
@ -707,30 +720,14 @@ en:
notfound: Incorrect URL, this is not your order. notfound: Incorrect URL, this is not your order.
form: form:
action_save: Save order action_save: Save order
amount: Amount
available: Available
available_funds: Available credits
created_by: Created by
ending: End
funds: Credit
last_update: Last ordered
manufacturer: Manufacturer
min_quantity: Minimum quantity
name: Name
new_funds: New account balance new_funds: New account balance
note: Note
price: Price price: Price
reset_article_search: Reset search reset_article_search: Reset search
search_article: Search for article... search_article: Search for article...
sum: Sum
sum_amount: Current amount sum_amount: Current amount
supplier: Supplier
title: Orders title: Orders
tolerance: Tolerance
total_sum_amount: Total amount total_sum_amount: Total amount
total_tolerance: Total tolerance total_tolerance: Total tolerance
unit: Unit
unit_missing: Missing units
units: Units units: Units
units_full: Filled units units_full: Filled units
units_total: Total units units_total: Total units
@ -742,9 +739,7 @@ en:
title: Unsettled orders title: Unsettled orders
total_sum: Total sum total_sum: Total sum
funds: funds:
account_balance: Account balance finished_orders: Unsettled orders
available_funds: Available credit
finished_orders: unsettled orders
open_orders: Current orders open_orders: Current orders
title: Credit title: Credit
title: Orders overview title: Orders overview
@ -752,14 +747,9 @@ en:
not_enough_apples: You need at least %{stop_ordering_under} apples to order. Currently your order group has only %{apples} apples. not_enough_apples: You need at least %{stop_ordering_under} apples to order. Currently your order group has only %{apples} apples.
order: order:
title: Articles title: Articles
orders:
ending: End
sum: Sum
supplier: Suppliers
show: show:
articles: articles:
edit_order: Edit order edit_order: Edit order
name: Name
not_ordered_msg: You didnt place an order yet not_ordered_msg: You didnt place an order yet
order_closed_msg: Sorry, this order is closed. order_closed_msg: Sorry, this order is closed.
order_nopen_title: Considering current orders of all groups order_nopen_title: Considering current orders of all groups
@ -769,21 +759,14 @@ en:
ordered: Ordered ordered: Ordered
ordered_title: Amount + tolerance ordered_title: Amount + tolerance
show_hide: Show/hide articles not ordered show_hide: Show/hide articles not ordered
sum: Sum show_note: Show note
title: Article overview title: Article overview
total_price: Total price
unit_price: Unit price unit_price: Unit price
units: Units
closed_by: Settled by %{user}
comment: Comment comment: Comment
comments: comments:
title: Comments title: Comments
ending: End
not_ordered: You didnt order. not_ordered: You didnt order.
note: Note
order_sum: Order sum
sum: Sum sum: Sum
supplier: Suppliers
title: Your order result for %{order} title: Your order result for %{order}
switch_order: switch_order:
remaining: ! '%{remaining} remaining' remaining: ! '%{remaining} remaining'
@ -1345,12 +1328,9 @@ en:
title: Weekly jobs title: Weekly jobs
user_not_found: No user found user_not_found: No user found
open_orders: open_orders:
ending: Ending
no_open_orders: There are no current orders no_open_orders: There are no current orders
not_enough_apples: Attention your order group has too few apple points to place an order! not_enough_apples: Attention your order group has too few apple points to place an order!
supplier: Supplier
title: Current orders title: Current orders
total: Sum
total_sum: Total sum total_sum: Total sum
who_ordered: Who ordered? who_ordered: Who ordered?
workgroup_members: workgroup_members: