From de9453fa24b1c645ee418845f34f02296f3b32fb Mon Sep 17 00:00:00 2001 From: "tg(x)" <*@tg-x.net> Date: Wed, 13 Nov 2013 16:29:30 +0100 Subject: [PATCH 01/68] dashboard: link to view order page --- app/helpers/group_orders_helper.rb | 13 ++++++++++++- app/views/shared/_open_orders.html.haml | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/helpers/group_orders_helper.rb b/app/helpers/group_orders_helper.rb index b7707744..1c734498 100644 --- a/app/helpers/group_orders_helper.rb +++ b/app/helpers/group_orders_helper.rb @@ -16,6 +16,17 @@ module GroupOrdersHelper link_to order.name, path, options end + def link_to_ordering_price(order, options = {}) + if group_order = order.group_order(current_user.ordergroup) + price = group_order.price + path = group_order_path(group_order) + else + price = 0 + path = new_group_order_path(:order_id => order.id) + end + link_to number_to_currency(price), path, options + end + # Return css class names for order result table def order_article_class_name(quantity, tolerance, result) @@ -36,4 +47,4 @@ module GroupOrdersHelper {group_order_article: goa, quantity: quantity, tolerance: tolerance, result: result, sub_total: sub_total} end -end \ No newline at end of file +end diff --git a/app/views/shared/_open_orders.html.haml b/app/views/shared/_open_orders.html.haml index 63259520..b4ec76f0 100644 --- a/app/views/shared/_open_orders.html.haml +++ b/app/views/shared/_open_orders.html.haml @@ -10,7 +10,7 @@ %th= t '.supplier' %th= t '.ending' %th= t '.who_ordered' - %th= t '.total' + %th.numeric= t '.total' %tbody - total = 0 - Order.open.each do |order| @@ -20,7 +20,7 @@ - if group_order = order.group_order(ordergroup) - total += group_order.price %td= "#{group_order.updated_by.nick} (#{format_time(group_order.updated_on)})" - %td.numeric= number_to_currency(group_order.price) + %td.numeric= link_to_ordering_price(order) - else %td{:colspan => 2} - if total > 0 From 630aa383cb0756ec6a52e8dc6d4e38fd566a8979 Mon Sep 17 00:00:00 2001 From: Sijmen Mulder Date: Tue, 19 Nov 2013 22:57:55 +0100 Subject: [PATCH 02/68] Remove apple-touch-icon links Safari will fall back to request the default touch icons if the href of the link 404s, so having them point at nothing generates 4 404s for nothing. --- app/views/layouts/_header.html.haml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index b3a4e30c..ab2e7d8e 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -7,10 +7,6 @@ %title= [t('layouts.foodsoft'), yield(:title)].join(" - ") = csrf_meta_tags = stylesheet_link_tag "application", :media => "all" - %link(href="images/apple-touch-icon-144x144.png" rel="apple-touch-icon-precomposed" sizes="144x144") - %link(href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon-precomposed" sizes="114x114") - %link(href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon-precomposed" sizes="72x72") - %link(href="images/apple-touch-icon.png" rel="apple-touch-icon-precomposed") //%link(href="images/favicon.ico" rel="shortcut icon") = yield(:head) From 84191ddcd081c1269594baf204878fca68ed36db Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 20 Nov 2013 23:40:38 +0100 Subject: [PATCH 03/68] first shot on improving edit article form (see also foodcoops#209) --- .../bootstrap_and_overrides.css.less | 20 ++++++++++ app/views/articles/_form.html.haml | 38 +++++++++++++++---- 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 6ad25972..efee733c 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -242,3 +242,23 @@ tr.unavailable { .input-append button.add-on { 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; + } +} + diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index ece82629..1ba6f49d 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -5,21 +5,43 @@ = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'} %h3= t '.title' .modal-body - = f.input :availability + /= 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) + %span#unit_divide_container.less-visible +  per  + = f.input_field :unit, class: 'input-mini', id: 'article_unit_divide' + = f.input :origin = f.input :manufacturer - = f.input :unit = f.input :note = 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 :tax, :wrapper => :append do - = f.input_field :tax - %span.add-on % - = f.input :deposit .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} = f.submit class: 'btn btn-primary' From 135e938d3d4a4c8aaf5eea4c13f611631802c9ef Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 23 Nov 2013 12:05:29 +0100 Subject: [PATCH 04/68] i18n cleanups (affects #137) --- .../_transactions.html.haml | 8 ++-- .../new_collection.html.haml | 6 +-- app/views/home/index.html.haml | 8 ++-- app/views/home/ordergroup.html.haml | 4 +- app/views/orders/_articles.html.haml | 4 +- app/views/orders/_form.html.haml | 10 ++--- app/views/orders/_orders.html.haml | 8 ++-- app/views/orders/index.html.haml | 6 +-- app/views/orders/show.html.haml | 10 ++--- config/locales/en.yml | 40 +++++-------------- 10 files changed, 41 insertions(+), 63 deletions(-) diff --git a/app/views/finance/financial_transactions/_transactions.html.haml b/app/views/finance/financial_transactions/_transactions.html.haml index 64b1c938..1dfbc2cb 100644 --- a/app/views/finance/financial_transactions/_transactions.html.haml +++ b/app/views/finance/financial_transactions/_transactions.html.haml @@ -4,10 +4,10 @@ %table.table.table-striped %thead %tr - %td= sort_link_helper t('.date'), "date" - %td= t('.who') - %td= sort_link_helper t('.note'), "note" - %td= sort_link_helper t('.amount'), "amount" + %th= sort_link_helper heading_helper(FinancialTransaction, :created_on), "date" + %th= heading_helper FinancialTransaction, :user + %th= sort_link_helper heading_helper(FinancialTransaction, :note), "note" + %th= sort_link_helper heading_helper(FinancialTransaction, :amount), "amount" %tbody - @financial_transactions.each do |t| %tr diff --git a/app/views/finance/financial_transactions/new_collection.html.haml b/app/views/finance/financial_transactions/new_collection.html.haml index aaa67129..7fdc99b0 100644 --- a/app/views/finance/financial_transactions/new_collection.html.haml +++ b/app/views/finance/financial_transactions/new_collection.html.haml @@ -21,13 +21,13 @@ = form_tag finance_create_transaction_collection_path do %p - %b= t('.note') + %b= heading_helper FinancialTransaction, :note = text_field_tag :note, params[:note], class: 'input-xlarge', required: 'required' %p %table#ordergroups{:style => "width:20em"} %tr - %th= t('.ordergroup') - %th= t('.amount') + %th= heading_helper FinancialTransaction, :ordergroup + %th= heading_helper FinancialTransaction, :amount = render :partial => 'ordergroup', :collection => [1, 2, 3] %p = link_to t('.new_ordergroup'), '#', 'data-add-transaction' => true, class: 'btn' diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 236d5c5c..41c03e76 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -50,10 +50,10 @@ %h3= t '.my_ordergroup.transactions.title' %table.table.table-striped %tr - %th= t '.my_ordergroup.transactions.when' - %th= t '.my_ordergroup.transactions.where' - %th= t '.my_ordergroup.transactions.note' - %th= t '.my_ordergroup.transactions.amount' + %th= heading_helper FinancialTransaction, :created_on + %th= heading_helper FinancialTransaction, :user + %th= heading_helper FinancialTransaction, :note + %th= heading_helper FinancialTransaction, :amount - for ft in current_user.ordergroup.financial_transactions.limit(5).order('created_on DESC') %tr %td= format_time(ft.created_on) diff --git a/app/views/home/ordergroup.html.haml b/app/views/home/ordergroup.html.haml index 213ef0c9..52eb6a18 100644 --- a/app/views/home/ordergroup.html.haml +++ b/app/views/home/ordergroup.html.haml @@ -7,10 +7,10 @@ - unless @ordergroup.description.blank? %p= @ordergroup.description %p - %b= Ordergroup.human_attribute_name(:available_funds) + ':' + %b= heading_helper(Ordergroup, :available_funds) + ':' = number_to_currency(@ordergroup.get_available_funds()) %p - %b= Ordergroup.human_attribute_name(:user_tokens) + ':' + %b= heading_helper(Ordergroup, :user_tokens) + ':' = @ordergroup.memberships.map{|m| show_user m.user}.join(', ') = link_to t('.invite'), new_invite_path(:id => @ordergroup), :remote => true, class: 'btn btn-primary' .span8 diff --git a/app/views/orders/_articles.html.haml b/app/views/orders/_articles.html.haml index 8508e6e8..b0c54837 100644 --- a/app/views/orders/_articles.html.haml +++ b/app/views/orders/_articles.html.haml @@ -1,8 +1,8 @@ %table.table.table-hover %thead %tr - %th= t '.name' - %th= t '.unit_quantity' + %th= heading_helper Article, :name + %th= heading_helper Article, :unit_quantity %th= t '.prices' %th= t '.units_ordered' - unless order.stockit? diff --git a/app/views/orders/_form.html.haml b/app/views/orders/_form.html.haml index 86d24106..48d776e1 100644 --- a/app/views/orders/_form.html.haml +++ b/app/views/orders/_form.html.haml @@ -11,14 +11,14 @@ %table.table.table-hover#articleList %tr %th= check_box_tag 'checkall', "1", false, { 'data-check-all' => '#articleList' } - %th= t '.name' - %th= t '.note' + %th= heading_helper Article, :name + %th= heading_helper Article, :note - if @order.stockit? %th= t '.stockit' - else - %th= t '.origin' - %th= t '.supplier' - %th= t '.unit_quantity' + %th= heading_helper Article, :origin + %th= heading_helper Article, :manufacturer + %th= heading_helper Article, :unit_quantity %th= t '.prices' - for category_name, articles in @order.articles_for_ordering %tr.article-category diff --git a/app/views/orders/_orders.html.haml b/app/views/orders/_orders.html.haml index baa5b815..36581491 100644 --- a/app/views/orders/_orders.html.haml +++ b/app/views/orders/_orders.html.haml @@ -2,10 +2,10 @@ %table.table.table-striped %thead %tr - %th= sort_link_helper t('.supplier'), "supplier" - %th= t '.start' - %th= sort_link_helper t('.ending'), "ends" - %th= t '.status' + %th= sort_link_helper heading_helper(Order, :supplier), "supplier" + %th= heading_helper Order, :starts + %th= sort_link_helper heading_helper(Order, :ends), "ends" + %th= heading_helper Order, :status %th{:colspan => "2"} %tbody - @orders.each do |order| diff --git a/app/views/orders/index.html.haml b/app/views/orders/index.html.haml index 7960b07f..34b428af 100644 --- a/app/views/orders/index.html.haml +++ b/app/views/orders/index.html.haml @@ -15,9 +15,9 @@ %table.table.table-striped %thead %tr - %th= t '.supplier' - %th= t '.ending' - %th= t '.note' + %th= heading_helper Order, :name + %th= heading_helper Order, :ends + %th= heading_helper Order, :note %th{colspan: "2"} %tbody - for order in @open_orders diff --git a/app/views/orders/show.html.haml b/app/views/orders/show.html.haml index 865a83c8..075706fe 100644 --- a/app/views/orders/show.html.haml +++ b/app/views/orders/show.html.haml @@ -7,16 +7,16 @@ // Order summary .well %dl.dl-horizontal - %dt= t '.supplier' + %dt= heading_helper(Order, :name) + ':' %dd= @order.name - if @note.present? - %dt= t '.note' + %dt= heading_helper(Order, :note) + ':' %dd= @order.note - %dt= t '.created_by' + %dt= heading_helper(Order, :created_by) + ':' %dd= show_user_link(@order.created_by) - %dt= t '.begin' + %dt= heading_helper(Order, :starts) + ':' %dd= format_time(@order.starts) - %dt= t '.ending' + %dt= heading_helper(Order, :ends) + ':' %dd= format_time(@order.ends) %dt= t '.group_orders' %dd #{@order.group_orders.count} (#{@order.group_orders.includes(:ordergroup).all.map {|g| g.ordergroup.name}.join(', ')}) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5d3b1e06..567f4a9a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,8 +30,11 @@ en: note: Note supplier: Supplier financial_transaction: - amount: amount - note: note + amount: Amount + created_on: Date + note: Note + ordergroup: Ordergroup + user: Entered by group_order_article: ordergroup_id: Ordergroup result: Amount @@ -54,9 +57,12 @@ en: sent_to_all: Send to all members subject: Subject order: + created_by: Created by ends: Ends at + name: Supplier note: Note starts: Starts at + status: Status order_article: units_to_order: Amount of units update_current_price: Globally update current price @@ -592,21 +598,13 @@ en: paragraph: Here you can credit and debit money for the order group %{name}. title: New transaction new_collection: - amount: Amount new_ordergroup: Add new order group - note: Note - ordergroup: Order group save: Save transaction - sidebar: Here you can update more accounts at the same time. For example all transfers of the order group from one account statement + sidebar: Here you can update more accounts at the same time. For example all transfers of the order group from one account statement. title: Updating more accounts ordergroup: remove: Remove remove_group: Remove group - transactions: - amount: Amount - date: Date - note: Note - who: Who group_order_articles: form: amount_change_for: Change amount for %{article} @@ -1159,10 +1157,8 @@ en: orders: articles: article_count: ! 'Ordered articles:' - name: Name prices: Net/gross price prices_sum: ! 'Sum (net/gross price):' - unit_quantity: Unit quantity units_full: Full units units_ordered: Units ordered create: @@ -1181,26 +1177,18 @@ en: notice: The order has been closed. form: ignore_warnings: Ignore warnings - name: Name - note: Note - origin: Origin prices: Prices (net/FC) select_all: Select all stockit: In stock - supplier: Producer title: Article - unit_quantity: Unit quantity index: action_end: Close confirm_delete: Do you really want to delete the order? confirm_end: Do you really want to close the order %{order}? There is no going back. ended_orders: Closed orders - ending: End new_order: Create new order no_open_orders: There are currently no open orders. - note: Note open_orders: Current orders - supplier: Supplier title: Manage orders model: error_closed: Order was already settled @@ -1212,17 +1200,11 @@ en: warning_ordered_stock: ! 'Warning: Articles marked red have already been ordered/ purchased within this open stock order. If you uncheck them here, all existing orders/ purchases of these articles will be deleted and it will not be accounted for them.' new: title: Create new order - orders: - ending: End - start: Start - status: Status - supplier: Supplier show: action_end: Close! amounts: ! 'Net/gross sum:' articles: Article overview articles_ordered: ! 'Ordered articles:' - begin: ! 'Begin:' comments: title: Comments comments_link: Comments @@ -1230,7 +1212,6 @@ en: confirm_end: ! 'Do you really want to close the order %{order}? There is no going back.' - created_by: ! 'Created by:' download: article_pdf: Article PDF download_file: Download file @@ -1239,12 +1220,9 @@ en: group_pdf: Group PDF matrix_pdf: Matrix PDF title: Download - ending: ! 'End:' group_orders: ! 'Group orders:' - note: ! 'Note:' sort_article: Sorted in articles sort_group: Sorted in groups - supplier: ! 'Supplier:' title: ! 'Order: %{name}' warn_not_closed: Warning, order is not yet settled. state: From 652a392b371be220e7c6f634a68ef782c1c643ab Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 23 Nov 2013 17:28:21 +0100 Subject: [PATCH 05/68] simplify i18n and fix some small ui issues --- app/views/group_orders/_form.html.haml | 36 +++++----- app/views/group_orders/_orders.html.haml | 6 +- app/views/group_orders/index.html.haml | 10 +-- app/views/group_orders/order.html.haml | 88 ------------------------ app/views/group_orders/show.html.haml | 23 ++++--- app/views/shared/_open_orders.html.haml | 6 +- config/locales/en.yml | 54 +++++---------- 7 files changed, 58 insertions(+), 165 deletions(-) delete mode 100644 app/views/group_orders/order.html.haml diff --git a/app/views/group_orders/_form.html.haml b/app/views/group_orders/_form.html.haml index a0b11791..758c4a81 100644 --- a/app/views/group_orders/_form.html.haml +++ b/app/views/group_orders/_form.html.haml @@ -27,22 +27,22 @@ %h2= @order.name %dl.dl-horizontal - unless @order.note.blank? - %dt= t '.note' + %dt= heading_helper Order, :note %dd= @order.note - %dt= t '.created_by' + %dt= heading_helper Order, :created_by %dd= show_user_link(@order.created_by) - %dt= t '.ending' + %dt= heading_helper Order, :ends %dd= format_time(@order.ends) - 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 %dt= t '.sum_amount' %dd= number_to_currency @order.sum - %dt= t '.last_update' + %dt= heading_helper GroupOrder, :updated_by %dd = show_user(@group_order.updated_by) if @group_order.updated_by (#{format_time(@group_order.updated_on)}) - %dt= t '.funds' + %dt= heading_helper Ordergroup, :available_funds %dd= number_to_currency(@ordering_data[:available_funds]) .well.pull-right @@ -65,20 +65,20 @@ %table.table.table-hover %thead %tr - %th= t '.name' + %th= heading_helper Article, :name - if @order.stockit? - %th{style: 'width:120px'}= t '.supplier' + %th{style: 'width:120px'}= heading_helper StockArticle, :supplier %th{style: "width:13px;"} %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? - %th{style: "width:70px;"}= t '.unit_missing' - %th#col_required= t '.amount' - %th#col_tolerance= t '.tolerance' + %th{style: "width:70px;"}= heading_helper OrderArticle, :missing_units, short: true + %th#col_required= heading_helper GroupOrderArticle, :quantity + %th#col_tolerance= heading_helper GroupOrderArticle, :tolerance - else - %th(style="width:20px")= t '.available' - %th#col_required= t '.amount' - %th{style: "width:15px;"}= t '.sum' + %th(style="width:20px")= heading_helper StockArticle, :available + %th#col_required= heading_helper GroupOrderArticle, :quantity + %th{style: "width:15px;"}= heading_helper GroupOrderArticle, :total_price %tbody.list - @order.articles_grouped_by_category.each do |category, order_articles| %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] %br/ .pull-left - #{t '.manufacturer'}: #{order_article.article.manufacturer} + #{heading_helper Article, :manufacturer}: #{order_article.article.manufacturer} %br/ #{t '.units'}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit} %br/ - #{t '.note'}: #{order_article.article.note} + #{heading_helper Article, :note}: #{order_article.article.note} %br/ #order-footer #info-box @@ -147,7 +147,7 @@ %td.currency %span#total_price= number_to_currency(@group_order.price) %tr - %td= t('.available_funds') + ':' + %td= heading_helper(Ordergroup, :available_funds) + ':' %td.currency= number_to_currency(@ordering_data[:available_funds]) %tr %td= t('.new_funds') + ':' diff --git a/app/views/group_orders/_orders.html.haml b/app/views/group_orders/_orders.html.haml index f3137588..96e22706 100644 --- a/app/views/group_orders/_orders.html.haml +++ b/app/views/group_orders/_orders.html.haml @@ -1,9 +1,9 @@ %table.table.table-striped %thead %tr - %th= t '.supplier' - %th= t '.ending' - %th= t '.sum' + %th= heading_helper Order, :name + %th= heading_helper Order, :ends + %th= heading_helper GroupOrder, :price %tbody - for order in orders - group_order = order.group_order(@ordergroup) # Get GroupOrder if possible diff --git a/app/views/group_orders/index.html.haml b/app/views/group_orders/index.html.haml index 20f31b2f..41842342 100644 --- a/app/views/group_orders/index.html.haml +++ b/app/views/group_orders/index.html.haml @@ -6,22 +6,22 @@ %h2= t '.funds.title' %table.table.table-striped %tr - %td= t('.funds.account_balance') + ':' + %td= heading_helper Ordergroup, :account_balance %td.numeric{:style => "width:5em"}= number_to_currency(@ordergroup.account_balance) %tr - %td= '- ' + t('.funds.open_orders') + ':' + %td= '- ' + t('.funds.open_orders') %td.numeric= number_to_currency(@ordergroup.value_of_open_orders) %tr - %td= '- ' + t('.funds.finished_orders') + ':' + %td= '- ' + t('.funds.finished_orders') %td.numeric= number_to_currency(@ordergroup.value_of_finished_orders) %tr - %th= t('.funds.available_funds') + ':' + %th= heading_helper Ordergroup, :available_funds %th.numeric= number_to_currency(@ordergroup.get_available_funds) = render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup} // finished orders -- unless Order.finished.empty? +- unless Order.finished_not_closed.empty? %section %h2= t '.finished_orders.title' = render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false} diff --git a/app/views/group_orders/order.html.haml b/app/views/group_orders/order.html.haml deleted file mode 100644 index 0d2f8c5a..00000000 --- a/app/views/group_orders/order.html.haml +++ /dev/null @@ -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 diff --git a/app/views/group_orders/show.html.haml b/app/views/group_orders/show.html.haml index 27a88eff..8af79e6a 100644 --- a/app/views/group_orders/show.html.haml +++ b/app/views/group_orders/show.html.haml @@ -9,21 +9,22 @@ .well // Order summary %dl.dl-horizontal - %dt= t '.supplier' + %dt= heading_helper Order, :name %dd= @order.name - %dt= t '.note' + %dt= heading_helper Order, :note %dd= @order.note - %dt= t '.ending' + %dt= heading_helper Order, :ends %dd= format_time(@order.ends) - %dt= t '.order_sum' + %dt= heading_helper GroupOrder, :price %dd - if @group_order = number_to_currency(@group_order.price) - else = t '.not_ordered' - if @order.closed? - %p= t '.closed_by', user: show_user(@order.updated_by) - = link_to t('.comment'), "#comments" + %dt= heading_helper Order, :closed_by + %dd= show_user_link @order.updated_by + %p= link_to t('.comment'), "#comments" // Article box %section @@ -35,8 +36,8 @@ %table.table.table-hover %thead %tr - %th{style: "width:40%"}= t '.articles.name' - %th= t '.articles.units' + %th{style: "width:40%"}= heading_helper Article, :name + %th= heading_helper Article, :units %th= t '.articles.unit_price' %th %abbr{title: t('.articles.ordered_title')}= t '.articles.ordered' @@ -46,7 +47,7 @@ = t '.articles.order_open' - else = t '.articles.order_not_open' - %th= t '.articles.total_price' + %th= heading_helper GroupOrderArticle, :total_price %tbody - for category_name, order_articles in @order.articles_grouped_by_category %tr.article-category @@ -61,7 +62,7 @@ %td{style: "width:40%"} = oa.article.name - 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= number_to_currency(oa.price.fc_price) %td @@ -73,7 +74,7 @@ %tr{id: "note_#{oa.id}", class: "note even", style: "display:none"} %td{colspan: "6"}=h oa.article.note %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) %br/ = link_to_top diff --git a/app/views/shared/_open_orders.html.haml b/app/views/shared/_open_orders.html.haml index 5c00c5f4..d0339636 100644 --- a/app/views/shared/_open_orders.html.haml +++ b/app/views/shared/_open_orders.html.haml @@ -7,10 +7,10 @@ %table.table.table-striped %thead %tr - %th= t '.supplier' - %th= t '.ending' + %th= heading_helper Order, :name + %th= heading_helper Order, :ends %th= t '.who_ordered' - %th= t '.total' + %th= heading_helper GroupOrder, :price %tbody - total = 0 - Order.open.each do |order| diff --git a/config/locales/en.yml b/config/locales/en.yml index 567f4a9a..928f266e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -20,6 +20,7 @@ en: supplier: Supplier tax: VAT unit: Unit + units: Units unit_quantity: Unit quantity unit_quantity_short: U.Q. article_category: @@ -35,9 +36,15 @@ en: note: Note ordergroup: Ordergroup user: Entered by + group_order: + updated_by: Last ordered by + price: Order sum group_order_article: ordergroup_id: Ordergroup result: Amount + quantity: Amount + tolerance: Tolerance + total_price: Sum invoice: amount: Amount date: Billing date @@ -57,6 +64,7 @@ en: sent_to_all: Send to all members subject: Subject order: + closed_by: Settled by created_by: Created by ends: Ends at name: Supplier @@ -64,11 +72,15 @@ en: starts: Starts at status: Status order_article: + missing_units: Missing units + missing_units_short: Missing units_to_order: Amount of units update_current_price: Globally update current price order_comment: text: Add comment to this order ... ordergroup: + available_funds: Available credit + account_balance: Account balance contact_address: Address contact_person: Contact person contact_phone: Phone @@ -82,9 +94,9 @@ en: title: Title stock_article: price: Price - quantity: Quantity + available: Available quantity_available: Available quantity - supplier: Supplier + quantity_available_short: Avail. stock_taking: date: Date note: Note @@ -98,6 +110,7 @@ en: fax: Fax is_subscribed: subscribed? min_order_quantity: Minimum order quantity + min_order_quantity_short: Min. quantity name: Name note: Note order_howto: How to order @@ -707,30 +720,14 @@ en: notfound: Incorrect URL, this is not your order. form: 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 - note: Note price: Price reset_article_search: Reset search search_article: Search for article... - sum: Sum sum_amount: Current amount - supplier: Supplier title: Orders - tolerance: Tolerance total_sum_amount: Total amount total_tolerance: Total tolerance - unit: Unit - unit_missing: Missing units units: Units units_full: Filled units units_total: Total units @@ -742,9 +739,7 @@ en: title: Unsettled orders total_sum: Total sum funds: - account_balance: Account balance - available_funds: Available credit - finished_orders: unsettled orders + finished_orders: Unsettled orders open_orders: Current orders title: Credit 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. order: title: Articles - orders: - ending: End - sum: Sum - supplier: Suppliers show: articles: edit_order: Edit order - name: Name not_ordered_msg: You didn’t place an order yet order_closed_msg: Sorry, this order is closed. order_nopen_title: Considering current orders of all groups @@ -769,21 +759,14 @@ en: ordered: Ordered ordered_title: Amount + tolerance show_hide: Show/hide articles not ordered - sum: Sum + show_note: Show note title: Article overview - total_price: Total price unit_price: Unit price - units: Units - closed_by: Settled by %{user} comment: Comment comments: title: Comments - ending: End not_ordered: You didn’t order. - note: Note - order_sum: Order sum sum: Sum - supplier: Suppliers title: Your order result for %{order} switch_order: remaining: ! '%{remaining} remaining' @@ -1345,12 +1328,9 @@ en: title: Weekly jobs user_not_found: No user found open_orders: - ending: Ending no_open_orders: There are no current orders not_enough_apples: Attention your order group has too few apple points to place an order! - supplier: Supplier title: Current orders - total: Sum total_sum: Total sum who_ordered: Who ordered? workgroup_members: From e5471b9f732916abc4e87f5b8ee8e2c747b90e8d Mon Sep 17 00:00:00 2001 From: wvengen Date: Sun, 24 Nov 2013 01:47:34 +0100 Subject: [PATCH 06/68] more i18n cleanup --- app/views/group_orders/_form.html.haml | 2 +- config/locales/en.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/group_orders/_form.html.haml b/app/views/group_orders/_form.html.haml index 758c4a81..bf5ff47d 100644 --- a/app/views/group_orders/_form.html.haml +++ b/app/views/group_orders/_form.html.haml @@ -134,7 +134,7 @@ .pull-left #{heading_helper Article, :manufacturer}: #{order_article.article.manufacturer} %br/ - #{t '.units'}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit} + #{heading_helper Article, :units}: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit} %br/ #{heading_helper Article, :note}: #{order_article.article.note} %br/ diff --git a/config/locales/en.yml b/config/locales/en.yml index 928f266e..2a4e2f24 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -728,7 +728,6 @@ en: title: Orders total_sum_amount: Total amount total_tolerance: Total tolerance - units: Units units_full: Filled units units_total: Total units index: From 20bd86fe653c6a1185ca5e339bb8476eb720dc54 Mon Sep 17 00:00:00 2001 From: wvengen Date: Sun, 24 Nov 2013 01:59:44 +0100 Subject: [PATCH 07/68] make heading_helper work with empty _short translation --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 59994432..ef516a67 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -84,8 +84,8 @@ module ApplicationHelper i18nopts = options.select {|a| !['short'].include?(a) } s = model.human_attribute_name(attribute, i18nopts) if options[:short] - sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({defaults: ''})) - s = raw "#{sshort}" unless sshort.empty? + sshort = model.human_attribute_name("#{attribute}_short".to_sym, options.merge({fallback: true, default: ''})) + s = raw "#{sshort}" unless sshort.blank? end s end From 6410396489b09ac0dd466ddc41267491a3b27d7d Mon Sep 17 00:00:00 2001 From: wvengen Date: Sun, 24 Nov 2013 02:12:32 +0100 Subject: [PATCH 08/68] localeapp roundtrip --- config/locales/de.yml | 86 +++++++------------------ config/locales/en.yml | 13 ++-- config/locales/fr.yml | 90 +++++++------------------- config/locales/nl.yml | 146 +++++++++++++++--------------------------- 4 files changed, 105 insertions(+), 230 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 6c776a12..773b2b29 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -22,6 +22,7 @@ de: unit: Einheit unit_quantity: Gebindegröße unit_quantity_short: GebGr + units: Gebinde article_category: description: Beschreibung name: Name @@ -31,10 +32,19 @@ de: supplier: Lieferantin financial_transaction: amount: Betrag + created_on: Datum note: Notiz + ordergroup: Bestellgruppe + user: + group_order: + price: Bestellsumme + updated_by: Zuletzt bestellt group_order_article: ordergroup_id: Bestellgruppe + quantity: Menge result: Menge + tolerance: Toleranz + total_price: Summe invoice: amount: Betrag date: Rechnungsdatum @@ -54,15 +64,23 @@ de: sent_to_all: An alle Mitglieder schicken subject: Betreff order: + closed_by: Abgerechnet von + created_by: Erstellt von ends: Endet am + name: Lieferant note: Notiz starts: Läuft vom + status: order_article: + missing_units: Fehlende Einheiten + missing_units_short: units_to_order: Menge update_current_price: Globalen Preis aktualisieren order_comment: text: Kommentiere diese Bestellung ... ordergroup: + account_balance: Kontostand + available_funds: Verfügbares Guthaben contact_address: Adresse contact_person: Kontaktperson contact_phone: Telefon @@ -75,10 +93,10 @@ de: parent_id: Oberseite title: Titel stock_article: + available: Verfügbar price: Nettopreis - quantity: Lagerbestand quantity_available: Verfügbarer Bestand - supplier: Lieferant + quantity_available_short: stock_taking: date: Datum note: Notiz @@ -92,6 +110,7 @@ de: fax: FAX is_subscribed: abonniert? min_order_quantity: Mindestbestellmenge + min_order_quantity_short: name: Name note: Notiz order_howto: Howto Bestellen @@ -588,21 +607,13 @@ de: paragraph: Hier kannst du der Bestellgruppe %{name} Geld gutschreiben/abziehen. title: Neue Transaktion new_collection: - amount: Betrag new_ordergroup: Weitere Bestellgruppe hinzufügen - note: Notiz - ordergroup: Bestellgruppe save: Transaktionen speichern sidebar: Hier kannst Du mehrere Konten gleichzeitig aktualsieren. Z.B. alle Überweisungen der Bestellgruppen aus einem Kontoauszug. title: Mehrere Konten aktualisieren ordergroup: remove: Entfernen remove_group: Gruppe enfernen - transactions: - amount: Betrag - date: Datum - note: Notiz - who: Wer group_order_articles: form: amount_change_for: Mengenänderung für %{article} @@ -705,30 +716,14 @@ de: notfound: Fehlerhafte URL, das ist nicht Deine Bestellung. form: action_save: Bestellung speichern - amount: Menge - available: Verfügbar - available_funds: Verfügbares Guthaben - created_by: Erstellt von - ending: Ende - funds: Guthaben - last_update: Zuletzt bestellt - manufacturer: Hersteller - min_quantity: Mindestbestellmenge - name: Name new_funds: Neuer Kontostand - note: Notiz price: Preis reset_article_search: Suche zurücksetzen search_article: Artikel suchen... - sum: Summe sum_amount: ! 'Gesamtbestellmenge bisher:' - supplier: Lieferant title: Bestellen - tolerance: Toleranz total_sum_amount: Gesamtbetrag total_tolerance: Gesamt-Toleranz - unit: Einheit - unit_missing: Fehlende Einheiten units: Gebinde units_full: Volle Gebinde units_total: Gesamt-Einheiten @@ -740,8 +735,6 @@ de: title: Nicht abgerechnete Bestellungen total_sum: Gesamtsumme funds: - account_balance: Kontostand - available_funds: verfügbares Guthaben finished_orders: nicht abgerechnete Bestellungen open_orders: Laufende Bestellungen title: Guthaben @@ -750,14 +743,9 @@ de: not_enough_apples: Um zu Bestellen brauchst Du mindestends %{stop_ordering_under} Äpfel. Momentan hat Deine Bestellgruppe aber nur %{apples} Äpfel. order: title: Artikel - orders: - ending: Ende - sum: Summe - supplier: Lieferantin show: articles: edit_order: Bestellung anpassen - name: Name not_ordered_msg: Du hast noch nicht bestellt order_closed_msg: Die Bestellung is leider schon zu Ende. Beim nächsten mal früher aufstehen... order_nopen_title: Unter Berücksichtigung der derzeitigen Bestellungen aller Gruppen @@ -767,21 +755,14 @@ de: ordered: Bestellt ordered_title: Menge + Toleranz show_hide: Zeige/Verstecke nicht bestellte Artikel - sum: Summe + show_note: title: Artikelübersicht - total_price: Gesamtpreis unit_price: Einzelpreis - units: Gebinde - closed_by: Abgerechnet von %{user} comment: Kommentare lesen/schreiben comments: title: Kommentare - ending: Ende not_ordered: Du hast nicht bestellt. - note: Notiz - order_sum: Bestellsumme sum: Summe - supplier: Lieferantin title: Dein Bestellergebnis für %{order} switch_order: remaining: noch %{remaining} @@ -1155,10 +1136,8 @@ de: orders: articles: article_count: ! 'Bestellte Artikel:' - name: Name prices: Netto-/Bruttopreis prices_sum: ! 'Summe (Netto/Brutto-Preise):' - unit_quantity: Gebinde units_full: Volle Gebinde units_ordered: Bestellte Einheiten create: @@ -1177,26 +1156,18 @@ de: notice: Die Bestellung wurde beendet. form: ignore_warnings: Warnungen ignorieren - name: Name - note: Notiz - origin: Herkunft prices: Price (netto/FC) select_all: Alle auswählen stockit: Verfügbar - supplier: Hersteller title: Artikel - unit_quantity: Gebinde index: action_end: Beenden confirm_delete: Willst Du wirklich die Bestellung löschen? confirm_end: Willst Du wirklich die Bestellung %{order} beenden? Es gibt kein zurück. ended_orders: Beendete Bestellungen - ending: Ende new_order: Neue Bestellung anlegen no_open_orders: Derzeit gibt es keine laufende Bestellungen. - note: Notiz open_orders: Laufende Bestellungen - supplier: Lieferantin title: Bestellungen verwalten model: error_closed: Bestellung wurde schon abgerechnet @@ -1208,17 +1179,11 @@ de: warning_ordered_stock: ! 'Warnung: Die rot markierten Artikel wurden in der laufenden Lagerbestellung bereits bestellt bzw. gekauft. Wenn Du sie hier abwählst, werden alle bestehenden Bestellungen bzw. Käufe dieses Artikels gelöscht und nicht abgerechnet!' new: title: Neue Bestellung anlegen - orders: - ending: Ende - start: Start - status: Status - supplier: Lieferantin show: action_end: Beenden! amounts: ! 'Netto/Bruttosumme:' articles: Artikelübersicht articles_ordered: ! 'Bestellte Artikel:' - begin: ! 'Beginn:' comments: title: Kommentare comments_link: Kommentare @@ -1226,7 +1191,6 @@ de: confirm_end: ! 'Willst Du wirklich die Bestellung %{order} beenden? Es gibt kein zurück.' - created_by: ! 'Erstellt von:' download: article_pdf: Artikel PDF download_file: Download file @@ -1235,12 +1199,9 @@ de: group_pdf: Gruppen PDF matrix_pdf: Matrix PDF title: Download - ending: ! 'Ende:' group_orders: ! 'Gruppenbestellungen:' - note: ! 'Notiz:' sort_article: Sortiert nach Artikeln sort_group: Sortiert nach Gruppen - supplier: ! 'Lieferantin:' title: ! 'Bestellung: %{name}' warn_not_closed: Achtung, Bestellung wurde noch nicht abgerechnet. state: @@ -1363,12 +1324,9 @@ de: title: Wöchentliche Jobs user_not_found: Keine Nutzerin gefunden open_orders: - ending: Ende no_open_orders: Derzeit gibt es keine laufenden Bestellungen not_enough_apples: Achtung, Deine Bestellgruppe hat zu wenig Äpfel um Bestellen zu können! - supplier: Lieferantin title: Laufende Bestellungen - total: Summe total_sum: Gesamtsumme who_ordered: Wer hat bestellt? workgroup_members: diff --git a/config/locales/en.yml b/config/locales/en.yml index 2a4e2f24..14afc7ce 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -20,9 +20,9 @@ en: supplier: Supplier tax: VAT unit: Unit - units: Units unit_quantity: Unit quantity unit_quantity_short: U.Q. + units: Units article_category: description: Description name: Name @@ -37,12 +37,12 @@ en: ordergroup: Ordergroup user: Entered by group_order: - updated_by: Last ordered by price: Order sum + updated_by: Last ordered by group_order_article: ordergroup_id: Ordergroup - result: Amount quantity: Amount + result: Amount tolerance: Tolerance total_price: Sum invoice: @@ -79,8 +79,8 @@ en: order_comment: text: Add comment to this order ... ordergroup: - available_funds: Available credit account_balance: Account balance + available_funds: Available credit contact_address: Address contact_person: Contact person contact_phone: Phone @@ -93,8 +93,8 @@ en: parent_id: Parent page title: Title stock_article: - price: Price available: Available + price: Price quantity_available: Available quantity quantity_available_short: Avail. stock_taking: @@ -435,7 +435,7 @@ en: article: Article price: Netprice sum: Sum - sum_diff: Gross - adjusted invoice ammount + sum_diff: Gross - adjusted invoice amount sum_gross: Gross sum sum_net: Net sum title: Show delivery @@ -728,6 +728,7 @@ en: title: Orders total_sum_amount: Total amount total_tolerance: Total tolerance + units: Units units_full: Filled units units_total: Total units index: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index f5e54531..1bc1b65b 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -22,6 +22,7 @@ fr: unit: Unité unit_quantity: Unités par lot unit_quantity_short: + units: Lots article_category: description: Description name: Nom @@ -30,11 +31,20 @@ fr: note: supplier: Fournisseuse_r financial_transaction: - amount: montant - note: note + amount: Montant + created_on: Date + note: Note + ordergroup: Cellule + user: + group_order: + price: Total de la commande + updated_by: Dernière commande group_order_article: ordergroup_id: Cellul + quantity: Quantité result: Quantité + tolerance: + total_price: Total invoice: amount: Montant date: Date de facturation @@ -54,15 +64,23 @@ fr: sent_to_all: Envoyer à tous les membres subject: Sujet order: + closed_by: Décompté par + created_by: Établi par ends: Clôture le + name: FournisseurE note: starts: Ouverture le + status: order_article: + missing_units: Unités manquantes + missing_units_short: units_to_order: Quantité update_current_price: Mettre à jour le prix global order_comment: text: Commenter cette commande... ordergroup: + account_balance: Crédit initial + available_funds: Crédit disponible contact_address: Adresse contact_person: Personne à contacter contact_phone: Téléphone @@ -75,10 +93,10 @@ fr: parent_id: Page parente title: Titre stock_article: + available: Disponible price: Prix net - quantity: quantity_available: - supplier: FournisseurE + quantity_available_short: stock_taking: date: note: @@ -92,6 +110,7 @@ fr: fax: Fa is_subscribed: abonné? min_order_quantity: Quantité minimale à commander + min_order_quantity_short: name: Nom note: Note order_howto: Comment commander @@ -602,21 +621,13 @@ fr: paragraph: Cet espace permet de rajouter ou d'enlever du crédit à la cellule %{name}. title: Nouvelle transaction new_collection: - amount: Montant new_ordergroup: Créer d'autres cellules - note: Note - ordergroup: Cellule save: Sauvegarder les transactions sidebar: ! "Cet espace permet de mettre à jour plusieurs comptes simultanément, \npar exemple pour saisir les versements des cellules sur leurs comptes à partir d'un relevé." title: Mettre à jour plusieurs comptes ordergroup: remove: Supprimer remove_group: Supprimer cette cellule - transactions: - amount: Montant - date: Date - note: Note - who: Qui? group_order_articles: form: amount_change_for: Modification de la quantité de %{article} @@ -723,30 +734,14 @@ fr: notfound: ! ' Mauvaise adresse, ce n''est pas ta commande.' form: action_save: Enregistrer ta commande - amount: Quantité - available: Disponible - available_funds: Crédit disponible - created_by: Établi par - ending: Clôture le - funds: Crédit - last_update: Dernière commande - manufacturer: Produit par - min_quantity: Quantité minimale - name: Nom new_funds: Nouveau solde - note: Note price: Prix reset_article_search: search_article: - sum: Prix total sum_amount: ! 'Quantité déjà commandée:' - supplier: Fourni par title: Commander - tolerance: Tolérance total_sum_amount: Montant total total_tolerance: Tolérance totale - unit: Unité - unit_missing: Unités manquantes units: Lots units_full: Lots complet units_total: Unités déjà commandées @@ -758,8 +753,6 @@ fr: title: Commandes par encore décomptées total_sum: Total funds: - account_balance: Crédit initial - available_funds: Crédit disponible finished_orders: montant prévu des commandes non décomptées open_orders: montant des commandes en cours title: Crédit @@ -770,14 +763,9 @@ fr: alors que vous n''en avez que %{apples} pour le moment.' order: title: Article - orders: - ending: Clôture le - sum: Total - supplier: FournisseusE_r show: articles: edit_order: Modifier ta commande - name: Nom not_ordered_msg: Tu n'as pas encore commandé order_closed_msg: Désolé, cette commande a déjà été fermée. Il faudra te réveiller plus tôt la prochaine fois order_nopen_title: En tenant compte des commandes en cours de toutes les cellules @@ -787,21 +775,14 @@ fr: ordered: Quantité souhaitée ordered_title: Quantité + tolérance show_hide: Montrer/cacher les articles non commandés - sum: Total + show_note: title: Aperçu des articles - total_price: Prix unit_price: Prix unitaire - units: Lots - closed_by: Décompté par %{user} comment: Lire/écrire des commentaire comments: title: Commentaire - ending: Clôture le not_ordered: Tu n'as pas commandé. - note: Note - order_sum: Total de la commande sum: Total - supplier: Fourni par title: Ta part de la commande %{order} switch_order: remaining: encore %{remaining} @@ -1164,10 +1145,8 @@ fr: orders: articles: article_count: ! 'Articles commandés:' - name: Nom prices: Prix brut/net prices_sum: ! 'Totaux (des prix bruts/nets):' - unit_quantity: Unités par lots x Lots units_full: Lots complet units_ordered: Unités commandées create: @@ -1186,26 +1165,18 @@ fr: notice: La commande a été close. form: ignore_warnings: - name: Nom - note: Note - origin: Origine prices: Prix (net/coop) select_all: Tout sélectionner stockit: Disponible - supplier: Productrice_teur title: Article - unit_quantity: Lots index: action_end: Terminer confirm_delete: Vraiment supprimer la commande? confirm_end: Veux tu vraiment mettre fin à la commande %{order}? Attention, il n'y aura pas d'annulation possible. ended_orders: Commandes closes - ending: Clôture le new_order: Définir une nouvelle commande no_open_orders: Il n'y a aucune commande en cours en ce moment. - note: Note open_orders: Commandes en cours - supplier: FournisseusE_r title: Gestion des commandes model: error_closed: Cette commande a déjà été décomptée @@ -1217,23 +1188,16 @@ fr: warning_ordered_stock: new: title: Définir une nouvelle commande - orders: - ending: Clôture le - start: Début - status: Statut - supplier: FournisseurE show: action_end: Clore! amounts: ! 'Total net/brut:' articles: Aperçu des articles articles_ordered: ! 'Articles commandés:' - begin: ! 'Début:' comments: title: Commentaire comments_link: Commenaire confirm_delete: Veux-tu vraiment supprimer la commande? confirm_end: Veux tu vraiment terminer la commande %{order}? Pas d'annulation possible. - created_by: ! 'Créée par:' download: article_pdf: Liste des articles en PDF download_file: Télécharger @@ -1242,12 +1206,9 @@ fr: group_pdf: Liste des cellules en PDF matrix_pdf: Matrice de distribution en PDF title: Télécharger - ending: ! 'Clôture le:' group_orders: ! 'Commandes des cellules:' - note: ! 'Note:' sort_article: Trié par article sort_group: Trié par cellules - supplier: FournisseurE title: ! 'Commande: %{name}' warn_not_closed: Attention, cette commande n'a pas encore été décomptée! state: @@ -1370,12 +1331,9 @@ fr: title: Boulots hebdomadaires user_not_found: Aucune utilisatrice n'a été trouvée. open_orders: - ending: Clôture le no_open_orders: Il n'y a aucune commande en cours en ce moment not_enough_apples: Désolé, ta cellule n'a pas assez de glands pour pouvoir commander! - supplier: FournisseusE_r title: Commandes en cours - total: Total total_sum: Total who_ordered: Qui a commandé? workgroup_members: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index eb12b8d5..c8e0f10a 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -22,6 +22,7 @@ nl: unit: Eenheid unit_quantity: Groothandelseenheid unit_quantity_short: Gr.Eenh. + units: Eenheden article_category: description: Omschrijving name: Naam @@ -30,11 +31,20 @@ nl: note: Notitie supplier: Leverancier financial_transaction: - amount: bedrag - note: notitie + amount: Bedrag + created_on: Datum + note: Notitie + ordergroup: Huishouden + user: Ingevuld door + group_order: + price: Totaal bestelling + updated_by: Laatst besteld door group_order_article: ordergroup_id: Huishouden + quantity: Hoeveelheid result: Hoeveelheid + tolerance: Tolerantie + total_price: Som invoice: amount: Bedrag date: Factuurdatum @@ -54,15 +64,23 @@ nl: sent_to_all: Aan alle leden sturen subject: Onderwerp order: + closed_by: Afgerekend door + created_by: Geopend door ends: Eindigt op + name: Leverancier note: Notitie starts: Start op + status: order_article: + missing_units: Missende eenheden + missing_units_short: units_to_order: Aantal eenheden update_current_price: Huidige prijs overal bijwerken order_comment: text: Commentaar voor deze bestelling toevoegen ... ordergroup: + account_balance: Tegoed + available_funds: Beschikbaar tegoed contact_address: Adres contact_person: Contactpersoon contact_phone: Telefoon @@ -75,10 +93,10 @@ nl: parent_id: Ouderpagina title: Titel stock_article: + available: Beschikbaar price: Prijs - quantity: Aantal quantity_available: Beschikbaar - supplier: Leverancier + quantity_available_short: stock_taking: date: Datum note: Notitie @@ -92,6 +110,7 @@ nl: fax: Fax is_subscribed: geabonneerd? min_order_quantity: Minimale bestelhoeveelheid + min_order_quantity_short: name: Naam note: Notitie order_howto: Hoe te bestellen @@ -395,10 +414,10 @@ nl: actions: Taken article: Artikel category: Categorie - create_from_blank: Nieuwe artikel invoeren - create_stock_article: Voorraadartikel maken + create_from_blank: Nieuw voorraadartikel invoeren + create_stock_article: Voorraadartikel invoeren price: Netto prijs - quantity: Hoeveelheid + quantity: Aantal title_fill_quantities: 2. Hoeveel mag er geleverd worden title_finish_delivery: 3. Levering afmaken title_select_stock_articles: 1. Kies voorraadartikelen @@ -406,28 +425,28 @@ nl: index: confirm_delete: Zeker weten? new_delivery: Nieuwe levering maken voor %{supplier} - title: - invoice_amount: - invoice_net_amount: + title: ! '%{supplier} leveringen' + invoice_amount: Factuurbedrag + invoice_net_amount: Netto factuurbedrag new: - title: + title: Nieuwe levering van %{supplier} show: - amount: - article: - price: - sum: - sum_diff: - sum_gross: - sum_net: - title: - title_articles: - unit: + amount: Aantal + article: Artikel + price: Netto prijs + sum: Som + sum_diff: Bruto - aangepast factuurbedrag + sum_gross: Brutosom + sum_net: Nettosom + title: Levering tonen + title_articles: Artikel + unit: Eenheid stock_article_for_adding: - action_add_to_delivery: - action_edit: - action_other_price: + action_add_to_delivery: Voeg toe aan levering + action_edit: Bewerk + action_other_price: Kopieer stock_article_form: - copy_stock_article: + copy_stock_article: kopieer het voorraadartikel stock_change_fields: remove_article: Artikel uit levering halen suppliers_overview: Leverancieroverzicht @@ -482,7 +501,7 @@ nl: notice: Bericht verstuurd. Vriendelijk bedankt! new: first_paragraph: Probleem gevonden? Voorstel? Idee? Verbeterpunt? We horen graag je feedback. - second_paragraph: + second_paragraph: Dit bericht wordt verstuurd naar de ontwikkelaars van de bestelsoftware. Voor vragen over de organisatie van je foodcoop kun je je tot de lokale organisatie wenden. send: Verzenden title: Feedback geven finance: @@ -572,7 +591,7 @@ nl: create: notice: De transactie is opgeslagen. create_collection: - alert: + alert: ! 'Er is een fout opgetreden: %{error}' error_note_required: Notitie ontbreekt. notice: Alle transacties zijn opgeslagen. index: @@ -585,21 +604,13 @@ nl: paragraph: title: Nieuwe transactie new_collection: - amount: Bedrag new_ordergroup: Nog een huishouden toevoegen - note: Notitie - ordergroup: Huishouden save: Transactie opslaan - sidebar: - title: + sidebar: Hier kun je meerdere tegoeden tegelijk bijwerken. Bijvoorbeeld alle overschrijvingen van leden van een bankafschrift. + title: Meerdere tegoeden bijwerken ordergroup: remove: Verwijderen remove_group: Huishouden verwijderen - transactions: - amount: Bedrag - date: Datum - note: Notitie - who: Wie group_order_articles: form: amount_change_for: @@ -651,7 +662,7 @@ nl: ordergroups: account_balance: Tegoed account_statement: Rekeningafschrift - contact: + contact: Contactpersoon name: Naam new_transaction: Nieuwe transactie update: @@ -702,30 +713,14 @@ nl: notfound: Foute URL, dit is niet jouw bestelling. form: action_save: Bestelling opslaan - amount: Hoeveelheid - available: Beschikbaar - available_funds: Beschikbaar tegoed - created_by: Aangemaakt door - ending: Einde - funds: Krediet - last_update: Laatst bestelt - manufacturer: Producent - min_quantity: Min. bestelhoeveelheid - name: Naam new_funds: Nieuw tegoed - note: Notitie price: Prijs reset_article_search: search_article: Artikel zoeken... - sum: Som sum_amount: ! 'Huidig totaalbedrag:' - supplier: Leverancier title: Bestellen - tolerance: Tolerantie total_sum_amount: Totalbedrag total_tolerance: Totale tolerantie - unit: Eenheid - unit_missing: Missende eenheden units: Eenheden units_full: Volle eenheden units_total: Totaal aantal @@ -737,8 +732,6 @@ nl: title: Niet afgerekende bestellingen total_sum: Totaal funds: - account_balance: Tegoed - available_funds: finished_orders: niet afgerekende bestellingen open_orders: Lopende bestellingen title: Credit @@ -747,14 +740,9 @@ nl: not_enough_apples: Om te bestellen heb je minimaal %{stop_ordering_under} appels nodig. Momenteel heeft je huishouden slechts %{apples} appels. order: title: Artikelen - orders: - ending: Einde - sum: Som - supplier: Leveranciers show: articles: edit_order: Order aanpassen - name: Naam not_ordered_msg: Je hebt nog niets bestelt order_closed_msg: Sorry, deze bestelling is gesloten. order_nopen_title: Waarbij rekening gehouden is met bestellingen van anderen @@ -764,21 +752,14 @@ nl: ordered: Besteld ordered_title: Hoeveelheid + tolerantie show_hide: Niet bestelde artikelen tonen/verbergen - sum: Som + show_note: title: Artikeloverzicht - total_price: Totaalprijs unit_price: Stuksprijs - units: Eenheden - closed_by: Afgerekend door %{user} comment: Notitie comments: - title: - ending: Einde + title: Commentaar not_ordered: Je hebt niets bestelt. - note: Notitie - order_sum: sum: Som - supplier: Leveranciers title: Jouw bestelling voor %{order} switch_order: remaining: nog %{remaining} @@ -1091,10 +1072,8 @@ nl: orders: articles: article_count: ! 'Bestelde artikelen:' - name: Naam prices: Netto/bruto prijs prices_sum: ! 'Totaal (netto/bruto prijs):' - unit_quantity: Groothandelseenheid units_full: Volle eenheden units_ordered: Bestelde eenheden create: @@ -1113,26 +1092,18 @@ nl: notice: De bestelling is gesloten. form: ignore_warnings: Waarschuwingen negeren - name: Naam - note: Notitie - origin: Herkomst prices: Prijs (netto/FC) select_all: Alles selecteren stockit: Beschikbaar - supplier: Producent title: Artikel - unit_quantity: index: action_end: Sluiten confirm_delete: Wil je de bestelling werkelijk verwijderen? confirm_end: Wil je de bestelling %{order} werkelijk sluiten? Dit kun je niet ongedaan maken. ended_orders: Gesloten bestellingen - ending: new_order: no_open_orders: Er zijn momenteel geen lopende bestellingen. - note: open_orders: Lopende bestellingen - supplier: title: model: error_closed: Bestelling was al afgerekend @@ -1144,17 +1115,11 @@ nl: warning_ordered_stock: new: title: - orders: - ending: - start: Start - status: - supplier: Leverancier show: action_end: Sluiten! amounts: articles: Artikeloverzicht articles_ordered: ! 'Bestelde artikelen:' - begin: ! 'Begin:' comments: title: Commentaar comments_link: Commentaar @@ -1162,7 +1127,6 @@ nl: confirm_end: ! 'Wil je de bestelling %{order} echt sluiten? Hierna kan zij niet opnieuw geopend worden.' - created_by: ! 'Geopend door:' download: article_pdf: Artikelen PDF download_file: Bestand downloaden @@ -1171,12 +1135,9 @@ nl: group_pdf: Huishoudens PDF matrix_pdf: Matrix PDF title: Downloaden - ending: ! 'Einde:' group_orders: ! 'Ledenbestellingen:' - note: ! 'Notitie:' sort_article: Gesorteerd naar artikel sort_group: Gesorteerd naar huishouden - supplier: title: warn_not_closed: Opgelet, bestelling is nog niet afgerekend. state: @@ -1299,12 +1260,9 @@ nl: title: Wekelijkse taken user_not_found: Geen gebruiker gevonden open_orders: - ending: Einde no_open_orders: Er zijn momenteel geen lopende bestellingen. not_enough_apples: - supplier: Leverancier title: Lopende bestellingen - total: Som total_sum: Totaalsom who_ordered: Wie heeft besteld? workgroup_members: @@ -1324,7 +1282,7 @@ nl: copy_stock_article: name: edit_stock_article: - price: + price:
  • De prijs mag niet aangepast worden.
  • Indien nodig, %{stock_article_copy_link}.
supplier: min_order_quantity: task: From 935fdedd66780e64341f554754def755dd9247c3 Mon Sep 17 00:00:00 2001 From: wvengen Date: Sun, 24 Nov 2013 02:16:15 +0100 Subject: [PATCH 09/68] hide row when information not present --- app/views/group_orders/_form.html.haml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/group_orders/_form.html.haml b/app/views/group_orders/_form.html.haml index bf5ff47d..f1350757 100644 --- a/app/views/group_orders/_form.html.haml +++ b/app/views/group_orders/_form.html.haml @@ -38,10 +38,11 @@ %dd= @order.supplier.min_order_quantity %dt= t '.sum_amount' %dd= number_to_currency @order.sum - %dt= heading_helper GroupOrder, :updated_by - %dd - = show_user(@group_order.updated_by) if @group_order.updated_by - (#{format_time(@group_order.updated_on)}) + - unless @group_order.new_record? + %dt= heading_helper GroupOrder, :updated_by + %dd + = show_user(@group_order.updated_by) + (#{format_time(@group_order.updated_on)}) %dt= heading_helper Ordergroup, :available_funds %dd= number_to_currency(@ordering_data[:available_funds]) From 810656a53b9c8fadbfbd1dabe7f20ba87ff53a6b Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 25 Nov 2013 10:04:44 +0100 Subject: [PATCH 10/68] small link_to_ordering refactoring --- app/helpers/group_orders_helper.rb | 22 +++++++++------------- app/views/shared/_open_orders.html.haml | 4 +++- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/helpers/group_orders_helper.rb b/app/helpers/group_orders_helper.rb index 1c734498..11434a83 100644 --- a/app/helpers/group_orders_helper.rb +++ b/app/helpers/group_orders_helper.rb @@ -7,24 +7,20 @@ module GroupOrdersHelper }.join("\n") end + # Returns a link to the page where a group_order can be edited. + # If the option :show is true, the link is for showing the group_order. def link_to_ordering(order, options = {}) - path = if group_order = order.group_order(current_user.ordergroup) + group_order = order.group_order(current_user.ordergroup) + path = if options[:show] and group_order + group_order_path(group_order) + elsif group_order edit_group_order_path(group_order, :order_id => order.id) else new_group_order_path(:order_id => order.id) end - link_to order.name, path, options - end - - def link_to_ordering_price(order, options = {}) - if group_order = order.group_order(current_user.ordergroup) - price = group_order.price - path = group_order_path(group_order) - else - price = 0 - path = new_group_order_path(:order_id => order.id) - end - link_to number_to_currency(price), path, options + options.delete(:show) + name = block_given? ? yield(order, group_order) : order.name + path ? link_to(name, path, options) : name end # Return css class names for order result table diff --git a/app/views/shared/_open_orders.html.haml b/app/views/shared/_open_orders.html.haml index b4ec76f0..e3fef854 100644 --- a/app/views/shared/_open_orders.html.haml +++ b/app/views/shared/_open_orders.html.haml @@ -20,7 +20,9 @@ - if group_order = order.group_order(ordergroup) - total += group_order.price %td= "#{group_order.updated_by.nick} (#{format_time(group_order.updated_on)})" - %td.numeric= link_to_ordering_price(order) + %td.numeric + = link_to_ordering(order, show: true) do + - number_to_currency(group_order.price) - else %td{:colspan => 2} - if total > 0 From 9badaca2f3e64f5e71c9dbfa0a29a92de89499b4 Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 25 Nov 2013 16:33:12 +0100 Subject: [PATCH 11/68] fix wiki page creation --- lib/foodsoft_wiki/app/controllers/pages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/foodsoft_wiki/app/controllers/pages_controller.rb b/lib/foodsoft_wiki/app/controllers/pages_controller.rb index e2190159..ed4598b4 100644 --- a/lib/foodsoft_wiki/app/controllers/pages_controller.rb +++ b/lib/foodsoft_wiki/app/controllers/pages_controller.rb @@ -51,7 +51,7 @@ class PagesController < ApplicationController end def create - @page = current_user.pages.build(params[:page]) + @page = Page.new(params[:page].merge({:user => current_user})) if params[:preview] render :action => 'new' From 8a1b0386eb3451bb76cff246eb4fe9ecea6bb685 Mon Sep 17 00:00:00 2001 From: Robert Waltemath Date: Tue, 3 Dec 2013 19:46:53 +0100 Subject: [PATCH 12/68] Re-indent code blocks according to markdown syntax. --- doc/DEPLOYMENT.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/DEPLOYMENT.md b/doc/DEPLOYMENT.md index dad42aa3..bcdc1b39 100644 --- a/doc/DEPLOYMENT.md +++ b/doc/DEPLOYMENT.md @@ -4,20 +4,23 @@ Deployment Setup -------- - cp config/deploy.rb.SAMPLE config/deploy.rb - touch config/deploy/staging.rb - touch config/deploy/production.rb + cp config/deploy.rb.SAMPLE config/deploy.rb + touch config/deploy/staging.rb + touch config/deploy/production.rb Deploy -------- On your first deploy you should run - bundle exec cap deploy:setup - bundle exec cap deploy:check + + bundle exec cap deploy:setup + bundle exec cap deploy:check Deploy to staging - bundle exec cap deploy + + bundle exec cap deploy Deploy to production - bundle exec cap production deploy + + bundle exec cap production deploy From b1e81dc1d71cb9a90b2e3bb983152efc7e732835 Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 3 Dec 2013 22:03:19 +0100 Subject: [PATCH 13/68] make simple_form see that first_name is required --- app/models/user.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/user.rb b/app/models/user.rb index 3119e29d..19ea452c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -28,6 +28,7 @@ class User < ActiveRecord::Base validates_presence_of :password, :on => :create validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i validates_uniqueness_of :email, :case_sensitive => false + validates_presence_of :first_name # for simple_form validations validates_length_of :first_name, :in => 2..50 validates_confirmation_of :password validates_length_of :password, :in => 5..25, :allow_blank => true From 24085454966599ffb3cb21ddee46917fd5f16484 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 4 Dec 2013 21:07:50 +0100 Subject: [PATCH 14/68] bundle update (fixes rails vulnerability) --- Gemfile.lock | 72 +++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5f72b63f..66644fe2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,12 +30,12 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.0.2) - actionmailer (3.2.15) - actionpack (= 3.2.15) + actionmailer (3.2.16) + actionpack (= 3.2.16) mail (~> 2.5.4) - actionpack (3.2.15) - activemodel (= 3.2.15) - activesupport (= 3.2.15) + actionpack (3.2.16) + activemodel (= 3.2.16) + activesupport (= 3.2.16) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -43,18 +43,18 @@ GEM rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - activemodel (3.2.15) - activesupport (= 3.2.15) + activemodel (3.2.16) + activesupport (= 3.2.16) builder (~> 3.0.0) - activerecord (3.2.15) - activemodel (= 3.2.15) - activesupport (= 3.2.15) + activerecord (3.2.16) + activemodel (= 3.2.16) + activesupport (= 3.2.16) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.15) - activemodel (= 3.2.15) - activesupport (= 3.2.15) - activesupport (3.2.15) + activeresource (3.2.16) + activemodel (= 3.2.16) + activesupport (= 3.2.16) + activesupport (3.2.16) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) acts_as_tree (1.4.0) @@ -66,7 +66,7 @@ GEM erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap-datepicker-rails (1.1.1.9) + bootstrap-datepicker-rails (1.1.1.10) railties (>= 3.0) builder (3.0.4) bullet (4.7.1) @@ -80,7 +80,7 @@ GEM net-ssh-gateway (>= 1.1.0) capistrano-ext (1.2.1) capistrano (>= 1.0.0) - capybara (2.1.0) + capybara (2.2.0) mime-types (>= 1.16) nokogiri (>= 1.3.3) rack (>= 1.0.0) @@ -106,7 +106,7 @@ GEM database_cleaner (1.2.0) debug_inspector (0.0.2) diff-lcs (1.2.5) - docile (1.1.0) + docile (1.1.1) erubis (2.7.0) eventmachine (1.0.3) exception_notification (4.0.1) @@ -135,7 +135,7 @@ GEM hashery (2.1.1) highline (1.6.20) hike (1.2.3) - i18n (0.6.5) + i18n (0.6.9) i18n-spec (0.4.0) iso inherited_resources (1.4.1) @@ -148,7 +148,7 @@ GEM railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.8.1) - kaminari (0.14.1) + kaminari (0.15.0) actionpack (>= 3.0.0) activesupport (>= 3.0.0) less (2.4.0) @@ -157,7 +157,6 @@ GEM actionpack (>= 3.1) less (~> 2.4.0) libv8 (3.16.14.3) - lockfile (2.1.0) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) @@ -175,7 +174,7 @@ GEM activerecord (~> 3.1) activesupport (~> 3.1) polyamorous (~> 0.5.0) - mime-types (1.25) + mime-types (1.25.1) mini_portile (0.5.2) mono_logger (1.1.0) multi_json (1.8.2) @@ -212,14 +211,14 @@ GEM rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.15) - actionmailer (= 3.2.15) - actionpack (= 3.2.15) - activerecord (= 3.2.15) - activeresource (= 3.2.15) - activesupport (= 3.2.15) + rails (3.2.16) + actionmailer (= 3.2.16) + actionpack (= 3.2.16) + activerecord (= 3.2.16) + activeresource (= 3.2.16) + activesupport (= 3.2.16) bundler (~> 1.0) - railties (= 3.2.15) + railties (= 3.2.16) rails-assets-listjs (0.2.0.beta.4) railties (>= 3.1) rails-i18n (3.0.0) @@ -227,9 +226,9 @@ GEM rails (>= 3.0.0, < 4.0.0) rails-settings-cached (0.2.4) rails (>= 3.0.0) - railties (3.2.15) - actionpack (= 3.2.15) - activesupport (= 3.2.15) + railties (3.2.16) + actionpack (= 3.2.16) + activesupport (= 3.2.16) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) @@ -238,7 +237,7 @@ GEM rdoc (3.12.2) json (~> 1.4) redis (3.0.6) - redis-namespace (1.3.2) + redis-namespace (1.4.1) redis (~> 3.0.4) ref (1.0.5) responders (1.0.0) @@ -274,7 +273,7 @@ GEM railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - select2-rails (3.5.1) + select2-rails (3.5.2) thor (~> 0.14) selenium-webdriver (2.37.0) childprocess (>= 0.2.5) @@ -286,12 +285,11 @@ GEM simple-navigation-bootstrap (1.0.0) railties (>= 3.1) simple-navigation (>= 3.7.0) - simple_form (2.1.0) + simple_form (2.1.1) actionpack (~> 3.0) activemodel (~> 3.0) - simplecov (0.8.1) + simplecov (0.8.2) docile (~> 1.1.0) - lockfile (>= 2.1.0) multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) @@ -327,7 +325,7 @@ GEM rails (>= 3.1) railties (>= 3.1) tzinfo (0.3.38) - uglifier (2.3.1) + uglifier (2.3.2) execjs (>= 0.3.0) json (>= 1.8.0) uniform_notifier (1.4.0) From dfa27dfc7c2787b95a87c78a72161bc8f2ef673c Mon Sep 17 00:00:00 2001 From: wvengen Date: Thu, 5 Dec 2013 15:52:32 +0100 Subject: [PATCH 15/68] don't use resque on heroku by default --- script/heroku_deploy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/heroku_deploy b/script/heroku_deploy index e1e0326b..651a946f 100755 --- a/script/heroku_deploy +++ b/script/heroku_deploy @@ -108,6 +108,9 @@ gem 'localeapp'" >>Gemfile fi # TODO add more extensive database seed +# XXX don't use redis for now +echo "Resque.inline = true" >config/initializers/resque.rb + # and push = deploy git add -A git commit -q -m "heroku changes for environment ${RAILS_ENV}" -a From e42589ae7240b485de60007d98fea347ab47321a Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 11:58:08 +0100 Subject: [PATCH 16/68] translations update (localeapp roundtrip) --- config/locales/de.yml | 24 ++-- config/locales/en.yml | 34 ++--- config/locales/fr.yml | 2 +- config/locales/nl.yml | 285 ++++++++++++++++++++++-------------------- 4 files changed, 177 insertions(+), 168 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 773b2b29..336e60ff 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -7,7 +7,7 @@ de: availability_short: verf. deposit: Pfand fc_price: Endpreis - fc_price_short: + fc_price_short: FC-Preis fc_share: FoodCoop-Aufschlag fc_share_short: FC-Aufschlag gross_price: Bruttopreis @@ -96,7 +96,7 @@ de: available: Verfügbar price: Nettopreis quantity_available: Verfügbarer Bestand - quantity_available_short: + quantity_available_short: Verf. stock_taking: date: Datum note: Notiz @@ -277,7 +277,7 @@ de: name: Name application: controller: - error_authn: + error_authn: Anmeldung erforderlich! error_denied: error_members_only: Diese Aktion ist nur für Mitglieder der Gruppe erlaubt! article_categories: @@ -373,7 +373,7 @@ de: error_nosel: Du hast keine Artikel ausgewählt parse_upload: body:

Bitte überprufe die engelesenen Artikel.

Achtung, momentan gibt es keine Überprüfung auf doppelte Artikel.

- title: + title: Artikel hochladen sync: outlist: alert_used: Achtung, %{article} wird gerade in einer laufenden Bestellung verwendet. Bitte erst Bestellung anpassen. @@ -513,11 +513,11 @@ de: alert: ! 'Ein Fehler ist beim Abrechnen aufgetreten: %{message}' notice: Bestellung wurde erfolgreich abgerechnet, die Kontostände aktualisiert. close_direct: - alert: ! 'Bestellung kann nicht geschlossen werden: %{message}' - notice: Bestellung wurde geschlossen. + alert: ! 'Bestellung kann nicht abgerechnet werden: %{message}' + notice: Bestellung wurde abgerechnet. confirm: - clear: Abschließen - first_paragraph: ! 'Wenn die Bestellung abgeschlossen wird, werden ebenfalls alle Gruppenkonten aktualisiert.
Die Konten werden wie folgt belastet:' + clear: Abrechnen + first_paragraph: ! 'Wenn die Bestellung abgerechnet wird, werden ebenfalls alle Gruppenkonten aktualisiert.
Die Konten werden wie folgt belastet:' or_cancel: oder zurück zur Abrechnung title: Bestellung abrechnen edit_results_by_articles: @@ -553,7 +553,7 @@ de: articles_overview: Artikelübersicht comment_on_transaction: Hier kannst Du deine Abrechnung kommentieren comments: Kommentare - confirm_order: Bestellung abschließen + confirm_order: Bestellung abrechnen create_invoice: Rechnung anlegen edit_note: Notiz bearbeiten edit_order: Bestellung bearbeiten @@ -568,8 +568,8 @@ de: orders: clear: abrechnen cleared: abgerechnet (%{amount}) - close: direkt schließen - confirm: Wirklich die Bestellung schließen setzen? + close: direkt abrechnen + confirm: Wirklich die Bestellung abrechnen? end: Ende ended: beendet last_edited_by: Zuletzt bearbeitet von @@ -720,7 +720,7 @@ de: price: Preis reset_article_search: Suche zurücksetzen search_article: Artikel suchen... - sum_amount: ! 'Gesamtbestellmenge bisher:' + sum_amount: Gesamtbestellmenge bisher title: Bestellen total_sum_amount: Gesamtbetrag total_tolerance: Gesamt-Toleranz diff --git a/config/locales/en.yml b/config/locales/en.yml index 14afc7ce..f7d6a301 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -470,7 +470,7 @@ en: - Ordered - Received - Price - - Unit quantity + - Unit Q. - Unit - Sum sum: Sum @@ -515,13 +515,13 @@ en: balancing: close: alert: ! 'An error occured while accounting: %{message}' - notice: Order was accounted succesfully, the balance of the account was updated. + notice: Order was settled succesfully, the balance of the account was updated. close_direct: - alert: ! 'Order can not be closed: %{message}' - notice: Order was closed. + alert: ! 'Order can not be settled: %{message}' + notice: Order was settled. confirm: - clear: Close - first_paragraph: ! 'When the order is closed, all group accounts will be updated.
The accounts will be charged as follows:' + clear: Settle + first_paragraph: ! 'When the order is settled, all group accounts will be updated.
The accounts will be charged as follows:' or_cancel: or back to accounting title: Settle order edit_results_by_articles: @@ -557,7 +557,7 @@ en: articles_overview: Overview of articles comment_on_transaction: Here you can add a comment to your accounting. comments: Comments - confirm_order: Close order + confirm_order: Settle order create_invoice: Create invoice edit_note: Edit note edit_order: Edit order @@ -572,8 +572,8 @@ en: orders: clear: accounting cleared: accounted (%{amount}) - close: close directly - confirm: Do you really want to fully close the order? + close: settle directly + confirm: Do you really want to settle the order? end: End ended: closed last_edited_by: Last edited by @@ -723,7 +723,7 @@ en: new_funds: New account balance price: Price reset_article_search: Reset search - search_article: Search for article... + search_article: Search for articles... sum_amount: Current amount title: Orders total_sum_amount: Total amount @@ -814,7 +814,7 @@ en: view_all: See all messages my_ordergroup: funds: ! '| Available Credit:' - last_update: Last Update was %{when} ago + last_update: Last update was %{when} ago title: My ordergroup transactions: amount: Amount @@ -856,7 +856,7 @@ en: admin: Administration finances: accounts: Update accounts - settle: To account orders + settle: Account orders title: Finances foodcoop: Foodcoop members: Members @@ -1179,8 +1179,8 @@ en: error_starts_before_ends: must be after the start date (or remain empty) notice_close: ! 'Order: %{name}, until %{ends}' stock: Stock - warning_ordered: ! 'Warning: Articles marked red have already been ordered within this open order. If you uncheck them here, all existing orders of these articles will be deleted.' - warning_ordered_stock: ! 'Warning: Articles marked red have already been ordered/ purchased within this open stock order. If you uncheck them here, all existing orders/ purchases of these articles will be deleted and it will not be accounted for them.' + warning_ordered: ! 'Warning: articles marked red have already been ordered within this open order. If you uncheck them here, all existing orders of these articles will be deleted.' + warning_ordered_stock: ! 'Warning: Articles marked red have already been ordered/purchased within this open stock order. If you uncheck them here, all existing orders/purchases of these articles will be deleted and it will not be accounted for them.' new: title: Create new order show: @@ -1220,7 +1220,7 @@ en: recent_changes: Recent changes search: action: Search - placeholder: Page title .. + placeholder: Page title ... site_map: Sitemap title: All Wiki pages title_list: List of pages @@ -1352,7 +1352,7 @@ en: edit_stock_article: price:
  • Price changes are forbidden.
  • If necessary, %{stock_article_copy_link}.
supplier: - min_order_quantity: The minimum amount which has to be orderd will be shown during the order process and should motivate ordering + min_order_quantity: The minimum amount which has to be ordered will be shown during the order process and should motivate ordering task: duration: How long will the task take, 1-3 hours required_users: How many users will be needed in total? @@ -1438,7 +1438,7 @@ en: unit: Unit vat: VAT confirm_delete: Are you sure you want to delete? - new_delivery: New delivery .. + new_delivery: New delivery ... new_stock_article: Add new stock article new_stock_taking: Add inventory order_online: Put stock order online diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 1bc1b65b..1509dc31 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -738,7 +738,7 @@ fr: price: Prix reset_article_search: search_article: - sum_amount: ! 'Quantité déjà commandée:' + sum_amount: Quantité déjà commandée title: Commander total_sum_amount: Montant total total_tolerance: Tolérance totale diff --git a/config/locales/nl.yml b/config/locales/nl.yml index c8e0f10a..4ad4c336 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -70,10 +70,10 @@ nl: name: Leverancier note: Notitie starts: Start op - status: + status: Status order_article: missing_units: Missende eenheden - missing_units_short: + missing_units_short: Nodig units_to_order: Aantal eenheden update_current_price: Huidige prijs overal bijwerken order_comment: @@ -89,14 +89,14 @@ nl: name: Naam user_tokens: Leden page: - body: Bericht + body: Inhoud parent_id: Ouderpagina title: Titel stock_article: available: Beschikbaar price: Prijs quantity_available: Beschikbaar - quantity_available_short: + quantity_available_short: Besch. stock_taking: date: Datum note: Notitie @@ -110,7 +110,7 @@ nl: fax: Fax is_subscribed: geabonneerd? min_order_quantity: Minimale bestelhoeveelheid - min_order_quantity_short: + min_order_quantity_short: Min. bestelling name: Naam note: Notitie order_howto: Hoe te bestellen @@ -235,7 +235,7 @@ nl: new: title: Nieuwe gebruiker toevoegen show: - confirm: Wil je %{user} daadwerkelijk eruit zetten? + confirm: Wil je %{user} daadwerkelijk verwijderen? email: E-mail groupabos: Groepslidmaatschappen member_since: Lid sinds %{time} @@ -468,7 +468,7 @@ nl: rows: - Artikel - Besteld - - Hoeveelheid + - Gekregen - Prijs - Gr.Eenh. - Eenheid @@ -477,7 +477,14 @@ nl: title: ! 'Huishoudenslijst van bestelling: %{name}, gesloten op %{date}' order_fax: filename: Bestelling %{name}-%{date} - Fax - rows: + rows: + - Nummer + - Aantal + - Naam + - Gr.Eenh. + - Eenheid + - Prijs/eenh. + - Subtotaal total: Totaal order_matrix: filename: Bestelling %{name}-%{date} - Sorteermatrix @@ -510,13 +517,13 @@ nl: alert: ! 'Er trad een fout op bij het afrekenen: %{message}' notice: Bestelling is succesvol afgerekend, de tegoeden van de leden zijn bijgewerkt. close_direct: - alert: ! 'Bestelling kan niet gesloten worden: %{message}' - notice: Bestelling is gesloten + alert: ! 'Bestelling kan niet afgerekend worden: %{message}' + notice: Bestelling is afgerekend. confirm: - clear: Sluiten - first_paragraph: ! 'Wanneer de bestelling gesloten wordt, worden alle tegoeden van huishoudens bijgewerkt.
De tegoeden worden als volgt belast:' - or_cancel: of terug naar afrekenen - title: Order afrekenen + clear: Afrekenen + first_paragraph: ! 'Wanneer de bestelling afgerekend wordt, worden alle tegoeden van huishoudens bijgewerkt.
De tegoeden worden als volgt belast:' + or_cancel: of terug naar balans + title: Bestelling afrekenen edit_results_by_articles: add_article: Artikel toevoegen amount: Aantal @@ -550,7 +557,7 @@ nl: articles_overview: Artikeloverzicht comment_on_transaction: Hier kun je een notitie aan de afrekening toevoegen. comments: Notities - confirm_order: Bestelling afsluiten + confirm_order: Afrekenen create_invoice: Rekening toevoegen edit_note: Notitie bewerken edit_order: Bestelling bewerken @@ -558,12 +565,12 @@ nl: invoice: Factuur notes_and_journal: Notities/Protocol summary: Samenvatting - title: ! '%{name} afrekenen' + title: Balans van %{name} view_options: Weergaveopties order_article: confirm: Weet je het zeker? orders: - clear: afrekenen + clear: balans cleared: afgerekend (%{amount}) close: direct afrekenen confirm: Weet je zeker dat de je bestelling wilt afrekenen? @@ -582,8 +589,8 @@ nl: groups_amount: ! 'Bedrag van huishoudens:' net_amount: ! 'Netto bedrag:' reload: Samenvatting verversen - with_extra_charge: - without_extra_charge: + with_extra_charge: ! 'inclusief marge:' + without_extra_charge: ! 'zonder marge:' create: notice: Rekening is gemaakt financial_transactions: @@ -601,7 +608,7 @@ nl: search_placeholder: Zoeken ... title: Rekeningoverzicht voor %{name} new: - paragraph: + paragraph: Hier kun je het tegoed van huishouden %{name} ophogen en verlagen. title: Nieuwe transactie new_collection: new_ordergroup: Nog een huishouden toevoegen @@ -613,7 +620,7 @@ nl: remove_group: Huishouden verwijderen group_order_articles: form: - amount_change_for: + amount_change_for: Hoeveelheid %{article} result_hint: ! 'Eenheid: %{unit}' index: amount: Bedrag @@ -715,9 +722,9 @@ nl: action_save: Bestelling opslaan new_funds: Nieuw tegoed price: Prijs - reset_article_search: - search_article: Artikel zoeken... - sum_amount: ! 'Huidig totaalbedrag:' + reset_article_search: Alles tonen + search_article: Artikelen zoeken... + sum_amount: Huidig totaalbedrag title: Bestellen total_sum_amount: Totalbedrag total_tolerance: Totale tolerantie @@ -742,7 +749,7 @@ nl: title: Artikelen show: articles: - edit_order: Order aanpassen + edit_order: Bestelling aanpassen not_ordered_msg: Je hebt nog niets bestelt order_closed_msg: Sorry, deze bestelling is gesloten. order_nopen_title: Waarbij rekening gehouden is met bestellingen van anderen @@ -752,7 +759,7 @@ nl: ordered: Besteld ordered_title: Hoeveelheid + tolerantie show_hide: Niet bestelde artikelen tonen/verbergen - show_note: + show_note: Opmerking title: Artikeloverzicht unit_price: Stuksprijs comment: Notitie @@ -795,10 +802,12 @@ nl: required_users: Nog %{count} leden nodig! home: apple_bar: - desc: + desc: ! 'Deze balk laat zien hoeveel taken je gedaan hebt per bestelhoeveelheid, vergeleken met het gemiddelde van de foodcoop. + + Praktisch: voor iedere %{amount} aan totale bestellingen moet je een taak te doen!' more_info: Meer informatie - points: - warning: + points: ! 'Appelpuntenstand: %{points}' + warning: Opgelet, als je minder dan %{threshold} appelpunten hebt, kun je geen bestelling plaatsen! changes_saved: Wijzigingen opgeslagen. index: due_date_format: ! '%A %d %B' @@ -817,7 +826,7 @@ nl: when: Wanneer where: Wie ordergroup: - title: + title: Betrokkenheid van je huishouden tasks_move: action: Taken op je nemen/annuleren desc: Je bent voor de volgende taken verantwoordelijk. @@ -826,7 +835,7 @@ nl: action: open taken desc: Er zijn %{size} title: open taken - title: Beginpagina + title: Hoofdpagina your_tasks: Jouw taken no_ordergroups: Jammergenoeg ben je niet aangesloten bij een huishouden. ordergroup: @@ -846,10 +855,10 @@ nl: since: ! '(gebruiker sinds: %{when})' title: ! '%{user}' start_nav: - admin: + admin: Administratie finances: accounts: Tegoeden bijwerken - settle: Bestelling afrekenen + settle: Bestellingen afrekenen title: Financiën foodcoop: Foodcoop members: Leden @@ -879,7 +888,7 @@ nl: success: Persoon is uitgenodigd. js: ordering: - confirm_change: + confirm_change: Als je naar een andere bestelling gaat, gaan je aanpassingen in deze bestelling verloren. Wijzigingen vergeten en naar de andere bestelling gaan? layouts: email: footer: ! '-- @@ -1058,7 +1067,7 @@ nl: tasks: Taken wiki: all_pages: Alle Pagina's - home: Begin + home: Hoofdpagina title: Wiki workgroups: Werkgroepen ordergroups: @@ -1101,29 +1110,29 @@ nl: confirm_delete: Wil je de bestelling werkelijk verwijderen? confirm_end: Wil je de bestelling %{order} werkelijk sluiten? Dit kun je niet ongedaan maken. ended_orders: Gesloten bestellingen - new_order: + new_order: Nieuwe bestelling openen no_open_orders: Er zijn momenteel geen lopende bestellingen. open_orders: Lopende bestellingen - title: + title: Bestellingen beheren model: error_closed: Bestelling was al afgerekend - error_nosel: - error_starts_before_ends: + error_nosel: Er moet minstens één artikel geselecteerd zijn + error_starts_before_ends: moet na de startdatum zijn (of niet ingevuld worden) notice_close: ! 'Bestelling: %{name}, tot %{ends}' stock: Voorraad - warning_ordered: - warning_ordered_stock: + warning_ordered: ! 'Opgelet: rood gemarkeerde artikelen zijn al besteld door leden. Als je ze hier deselecteert, worden alle bestaande ledenbestellingen van deze artikelen verwijderd.' + warning_ordered_stock: ! 'Opgelet: rood gemarkeerde artikelen zijn al besteld of gekocht door leden. Als je ze hier deselecteert, worden alle bestaande ledenbestellingen/-aankopen van deze artikelen verwijderd, en worden ze niet afgerekend.' new: - title: + title: Nieuwe bestelling maken show: action_end: Sluiten! - amounts: + amounts: ! 'Totaal netto/bruto:' articles: Artikeloverzicht articles_ordered: ! 'Bestelde artikelen:' comments: title: Commentaar comments_link: Commentaar - confirm_delete: + confirm_delete: Wil je deze bestelling echt verwijderen? confirm_end: ! 'Wil je de bestelling %{order} echt sluiten? Hierna kan zij niet opnieuw geopend worden.' @@ -1138,7 +1147,7 @@ nl: group_orders: ! 'Ledenbestellingen:' sort_article: Gesorteerd naar artikel sort_group: Gesorteerd naar huishouden - title: + title: ! 'Bestelling: %{name}' warn_not_closed: Opgelet, bestelling is nog niet afgerekend. state: closed: afgerekend @@ -1148,34 +1157,34 @@ nl: notice: De bestelling is bijgewerkt. pages: all: - new_page: - recent_changes: + new_page: Nieuwe pagina maken + recent_changes: Recente wijzigingen search: - action: - placeholder: - site_map: - title: - title_list: + action: Zoeken + placeholder: Pagina titel ... + site_map: Sitemap + title: Alle wikipagina's + title_list: Paginalijst body: - title_toc: + title_toc: Inhoud create: notice: Pagina is gemaakt. cshow: - error_noexist: + error_noexist: Pagina bestaat niet! redirect_notice: Doorverwezen van %{page} ... destroy: notice: De pagina '%{page}' en alle subpagina's zijn verwijderd. edit: - title: - error_stale_object: + title: Pagina bewerken + error_stale_object: Opgelet, de pagina is net veranderd door een ander. Probeer het alsjeblieft opnieuw. form: help: - bold: - external_link_ex: - external_links: - heading: - headings: - italic: + bold: vet + external_link_ex: Externe pagina + external_links: Links naar pagina's op andere websites + heading: niveau %{level} + headings: Kop + italic: italic list_item_1: Eerste in de lijst list_item_2: Tweede in de lijst noformat: Zonder wiki-opmaak @@ -1187,35 +1196,35 @@ nl: see_tables: zie %{tables_link} tables_link: Tabellen text: tekst - title: - unordered_list: - wiki_link_ex: - wiki_links: - preview: - last_updated: + title: Korte opmaakhulp + unordered_list: Itemlijst + wiki_link_ex: Foodsoft wiki pagina + wiki_links: Wiki-links + preview: Voorbeeld + last_updated: Laatst bijgewerkt new: - title: + title: Nieuwe wiki pagina page_list_item: - date_format: + date_format: ! '%a, %d %B %Y %H:%M:%S' show: - date_format: - delete: - delete_confirm: - edit: - last_updated: - subpages: - title_versions: - versions: - title: + date_format: ! '%d-%m-%y %H:%M' + delete: Pagina verwijderen + delete_confirm: ! 'Opgelet: alle onderliggende pagina''s worden ook verwijderd. Zeker weten?' + edit: Pagina bewerken + last_updated: Laatst bijgewerkt door %{user} op %{when} + subpages: kindpagina's + title_versions: Versies + versions: Versies (%{count}) + title: Titel update: notice: Pagina is bijgewerkt. version: - author: - date_format: - revert: - title: - title_version: - view_current: + author: ! 'Auteur: %{user}' + date_format: ! '%a, %d-%m-%Y, %H:%M' + revert: Deze versie terugzetten + title: ! '%{title} - versie %{version}' + title_version: Versie + view_current: Huidige versie bekijken sessions: logged_in: Ingelogd! logged_out: Uitgelogd! @@ -1261,7 +1270,7 @@ nl: user_not_found: Geen gebruiker gevonden open_orders: no_open_orders: Er zijn momenteel geen lopende bestellingen. - not_enough_apples: + not_enough_apples: Opgelet, je huishouden heeft niet genoeg appelpunten om te kunnen bestellen! title: Lopende bestellingen total_sum: Totaalsom who_ordered: Wie heeft besteld? @@ -1269,26 +1278,26 @@ nl: title: Groepsleden simple_form: error_notification: - default_message: + default_message: Problemen gevonden, controleer alsjeblieft de invoer. hints: article: unit: ! 'Bijvoorbeeld: KG of 1L of 500g' message: - private: + private: Bericht wordt niet getoond in de Foodsoft inbox. order_article: - units_to_order: - update_current_price: + units_to_order: Als je het aantal geleverde eenheden wijzigt, moet je daarna de hoeveelheden voor huishoudens aanpassen. Klik daarvoor op de artikelnaam. Als je dit vergeet, kunnen huishoudens belast worden voor artikelen die ze niet hebben gekregen! + update_current_price: Ook prijs in huidige besteling aanpassen stock_article: copy_stock_article: - name: + name: Wijzigen alsjeblieft edit_stock_article: price:
  • De prijs mag niet aangepast worden.
  • Indien nodig, %{stock_article_copy_link}.
supplier: - min_order_quantity: + min_order_quantity: De minimum bestelhoeveelheid wordt getoond bij het bestellen en is bedoeld om leden te motiveren genoeg te bestellen. task: - duration: - required_users: - tax: + duration: Hoe lang de taak duurt, 1-3 uur. + required_users: Hoeveel mensen zijn in totaal nodig? + tax: Percentage labels: settings: messages: @@ -1328,8 +1337,8 @@ nl: title: new: create: - stock_articles: - temp_inventory: + stock_articles: Voorraadartikelen + temp_inventory: tijdelijke inventaris text_deviations: text_need_articles: title: @@ -1351,29 +1360,29 @@ nl: notice: Inventarisatie is bijgewerkt. stockit: check: - not_empty: + not_empty: ! '%{name} kon niet worden verwijderd, de inventaris is niet leeg.' destroy: notice: Artikel %{name} is verwijdered. edit: - title: + title: Voorraadartikelen bewerken form: - price_hint: + price_hint: Om chaos te voorkomen, kun je de prijs van bestaande voorraadartikelen niet aanpassen. index: article: - article: - available: - category: - ordered: - price: - stock: - supplier: - unit: - vat: - confirm_delete: - new_delivery: - new_stock_article: - new_stock_taking: - order_online: + article: Artikel + available: beschikbaar + category: Categorie + ordered: besteld + price: Prijs + stock: Op voorraad + supplier: Leverancier + unit: Eenheid + vat: BTW + confirm_delete: Weet je zeker dat je dit wilt verwijderen? + new_delivery: Nieuwe levering ... + new_stock_article: Nieuw voorraadartikel + new_stock_taking: Inventaris aanleggen + order_online: Voorraadbestelling openen show_stock_takings: stock_count: stock_worth: @@ -1402,29 +1411,29 @@ nl: destroy: notice: Leverancier is verwijderd edit: - title: + title: Leverancier bewerken index: - action_import: - action_new: - articles: - confirm_del: - deliveries: - stock: - title: + action_import: Leverancier uit externe database importeren + action_new: Leverancier toevoegen + articles: artikelen (%{count}) + confirm_del: Leverancier %{name} echt verwijderen? + deliveries: leveringen (%{count}) + stock: op voorraad (%{count}) + title: Leveranciers new: - title: - shared_supplier_note: + title: Nieuwe leverancier + shared_supplier_note: Leverancier is verbonden met de externe database. shared_suppliers: - body: - subscribe: - subscribe_again: - supplier: - title: + body:

Hier kun je leveranciers in de externe database zien.

Als je een externe leverancier importeert, wordt er een nieuwe leverancier aangemaakt die verbonden is met de externe database.

+ subscribe: Importeren + subscribe_again: Nogmaals importeren + supplier: Leverancier + title: Externe lijsten show: - confirm_delete: - last_deliveries: - new_delivery: - show_deliveries: + confirm_delete: Zeker weten? + last_deliveries: Laatste leveringen + new_delivery: Levering aanmaken + show_deliveries: Alle leveringen tonen update: notice: Leverancier is bijgewerkt tasks: @@ -1447,9 +1456,9 @@ nl: error_not_found: form: search: - hint: - noresult: - placeholder: + hint: Gebruiker zoeken + noresult: Geen gebruiker gevonden + placeholder: Zoeken ... submit: periodic: index: @@ -1521,8 +1530,8 @@ nl: workgroups: edit: title: Werkgroep bewerken - error_last_admin_group: - error_last_admin_role: + error_last_admin_group: De laatste groep met admin-rechten mag niet verwijderd worden (anders kun je er niet meer in). + error_last_admin_role: Je kunt admin-privileges voor de laatste groep met admin-rechten niet weghalen (anders kun je er niet meer in). index: title: Werkgroepen update: From 05b934e79f13354fff9e28296ca5f76ac6e107d9 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 12:19:13 +0100 Subject: [PATCH 17/68] update fc price dynamically in article edit form --- app/views/articles/_form.html.haml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index 1ba6f49d..1e3a0221 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -39,10 +39,22 @@ %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 + = Article.human_attribute_name(:fc_price) + %span#fc_price= number_to_currency(@article.fc_price) rescue nil = f.input :order_number .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} = f.submit class: 'btn btn-primary' +:javascript + var form = $('form.edit_article, form.new_article'); + $('#article_price, #article_tax, #article_deposit', form).on('change', function() { + var price = parseFloat($('#article_price', form).val()); + var tax = parseFloat($('#article_tax', form).val()); + var deposit = parseFloat($('#article_deposit', form).val()); + // 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(I18n.l("currency", fc_price)); + }); From 1c4b9591a21981e5595824255c40893dd3269a79 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 12:34:14 +0100 Subject: [PATCH 18/68] fix edit article dialog title --- app/views/articles/_form.html.haml | 2 +- config/locales/de.yml | 3 ++- config/locales/en.yml | 3 ++- config/locales/fr.yml | 3 ++- config/locales/nl.yml | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index ece82629..78dcdf7c 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -3,7 +3,7 @@ = f.hidden_field :supplier_id .modal-header = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'} - %h3= t '.title' + %h3= @article.new_record? ? t('.title_new') : t('.title_edit') .modal-body = f.input :availability = f.input :name diff --git a/config/locales/de.yml b/config/locales/de.yml index 336e60ff..a1a06ebc 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -347,7 +347,8 @@ de: unit_quantity_desc: Gebindegröße unit_quantity_short: GebGr form: - title: Neuen Artikel einfügen + title_edit: Artikel bearbeiten + title_new: Neuen Artikel einfügen import_search_results: action_import: importieren already_imported: schon importiert diff --git a/config/locales/en.yml b/config/locales/en.yml index f7d6a301..a48acd92 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -347,7 +347,8 @@ en: unit_quantity_desc: Unit quantity unit_quantity_short: Quantity form: - title: Add new article + title_edit: Edit article + title_new: Add new article import_search_results: action_import: import already_imported: already imported diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 1509dc31..2ce74783 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -347,7 +347,8 @@ fr: unit_quantity_desc: Unités par lot unit_quantity_short: U/L form: - title: Ajouter un nouvel article + title_edit: + title_new: Ajouter un nouvel article import_search_results: action_import: importer already_imported: déjà importé diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 4ad4c336..9a4731a0 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -347,7 +347,8 @@ nl: unit_quantity_desc: Groothandelsverpakkingsgrootte unit_quantity_short: Gr.Eenh. form: - title: Nieuw artikel toevoegen + title_edit: Artikel bewerken + title_new: Nieuw artikel toevoegen import_search_results: action_import: importeren already_imported: reeds geïmporteerd From 393740068351ca8ca13a0434b3ee56272706e008 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 14:25:58 +0100 Subject: [PATCH 19/68] fix modal dialog margin [ci skip] --- app/assets/stylesheets/bootstrap_and_overrides.css.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 6ad25972..42fde3d5 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -242,3 +242,8 @@ tr.unavailable { .input-append button.add-on { height: inherit; } + +// get rid of extra space on bottom of dialog with form +.modal form { + margin: 0; +} From c99aa7aab66a6974cdbc6bfc717a1e4d96d92423 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 14:33:51 +0100 Subject: [PATCH 20/68] add availability to article edit dialog --- app/assets/stylesheets/bootstrap_and_overrides.css.less | 8 ++++++++ app/views/articles/_form.html.haml | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 90c78280..6859cea6 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -248,6 +248,14 @@ tr.unavailable { margin: 0; } +.inline-inputs { + .control-label { + width: auto; + float: none; + display: inline; + } +} + // inputs that are "in the background" - less visible .less-visible { color: #ddd; diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index 56fa2d31..931ceacf 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -5,7 +5,7 @@ = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'} %h3= @article.new_record? ? t('.title_new') : t('.title_edit') .modal-body - /= f.input :availability + = f.input :availability = f.input :name = f.input :unit do .inline-inputs @@ -13,11 +13,9 @@ × = f.input_field :unit, class: 'input-mini', title: Article.human_attribute_name(:unit) %span#unit_divide_container.less-visible -  per  + = f.label :unit, label: " per ".html_safe = f.input_field :unit, class: 'input-mini', id: 'article_unit_divide' - = f.input :origin - = f.input :manufacturer = f.input :note = f.association :article_category / TODO labels @@ -42,6 +40,8 @@ = Article.human_attribute_name(:fc_price) %span#fc_price= number_to_currency(@article.fc_price) rescue nil + = f.input :origin + = f.input :manufacturer = f.input :order_number .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} From 2f10210c763e23f988e0e7b05feb9b1a5665b000 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 14:38:28 +0100 Subject: [PATCH 21/68] remove unimplemented unit_divide box --- .../bootstrap_and_overrides.css.less | 19 ------------------- app/views/articles/_form.html.haml | 3 --- 2 files changed, 22 deletions(-) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 6859cea6..5da02f8c 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -255,22 +255,3 @@ tr.unavailable { display: inline; } } - -// 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; - } -} diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index 931ceacf..c93d222e 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -12,9 +12,6 @@ = 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 - = f.label :unit, label: " per ".html_safe - = f.input_field :unit, class: 'input-mini', id: 'article_unit_divide' = f.input :note = f.association :article_category From 62ca3cb634a0bdae84590c9fb6e25a844746eac8 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 14:49:05 +0100 Subject: [PATCH 22/68] small layout cleanup [ci skip] --- app/assets/stylesheets/bootstrap_and_overrides.css.less | 3 ++- app/views/articles/_form.html.haml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 5da02f8c..c3e0a875 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -250,8 +250,9 @@ tr.unavailable { .inline-inputs { .control-label { - width: auto; float: none; display: inline; + vertical-align: middle; + margin: 0 10px; } } diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index c93d222e..2ffd3f0a 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -23,7 +23,7 @@ %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;' + = f.label :tax .input-append = f.input_field :tax, class: 'input-mini' %span.add-on % From 2baa1d3349a5885ecc712974bd58e9deeb195c96 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 16:13:04 +0100 Subject: [PATCH 23/68] fix i18n deprecation warning --- config/application.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/application.rb b/config/application.rb index 2d8cf3ef..c86d6b0b 100644 --- a/config/application.rb +++ b/config/application.rb @@ -2,6 +2,10 @@ require File.expand_path('../boot', __FILE__) require 'rails/all' +# need to include this before requiring some other gems +# http://stackoverflow.com/questions/20361428 +I18n.enforce_available_locales = true + if defined?(Bundler) # If you precompile assets before deploying to production, use this line Bundler.require(*Rails.groups(:assets => %w(development test))) From 043607f20d3f93347d53234213e233fb45448222 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 16:41:16 +0100 Subject: [PATCH 24/68] workaround wikicloth i18n issue (closes foodsoft#217) --- lib/foodsoft_wiki/app/helpers/pages_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/foodsoft_wiki/app/helpers/pages_helper.rb b/lib/foodsoft_wiki/app/helpers/pages_helper.rb index 09be29f0..552791f3 100644 --- a/lib/foodsoft_wiki/app/helpers/pages_helper.rb +++ b/lib/foodsoft_wiki/app/helpers/pages_helper.rb @@ -2,7 +2,8 @@ module PagesHelper include WikiCloth def wikified_body(body, title = nil) - WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html.html_safe + render_opts = {:locale => I18n.locale} # workaround for wikicloth 0.8.0 https://github.com/nricciar/wikicloth/pull/59 + WikiCloth.new({:data => body+"\n", :link_handler => Wikilink.new, :params => {:referer => title}}).to_html(render_opts).html_safe end def link_to_wikipage(page, text = nil) From e99752e483537a81f7cedad8b547588a96ae37a3 Mon Sep 17 00:00:00 2001 From: Julius Rapp Date: Fri, 6 Dec 2013 18:33:35 +0100 Subject: [PATCH 25/68] disable escape of html from local (one place) --- app/views/deliveries/_stock_article_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/deliveries/_stock_article_form.html.haml b/app/views/deliveries/_stock_article_form.html.haml index 21c5b216..5fdce8de 100644 --- a/app/views/deliveries/_stock_article_form.html.haml +++ b/app/views/deliveries/_stock_article_form.html.haml @@ -16,7 +16,7 @@ %span.add-on % = f.input :deposit - else - = f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article) + = f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article).html_safe = f.association :article_category .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} From a475a27f791b01cfd43b1745140e42b7538589e8 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 22:43:36 +0100 Subject: [PATCH 26/68] i18n cleanup (affects foodcoops#137) --- app/models/stock_article.rb | 8 ++++++-- app/views/stockit/index.html.haml | 20 ++++++++++---------- config/locales/en.yml | 12 ++---------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/app/models/stock_article.rb b/app/models/stock_article.rb index 5d45802e..0948b257 100644 --- a/app/models/stock_article.rb +++ b/app/models/stock_article.rb @@ -14,10 +14,14 @@ class StockArticle < Article # Check for unclosed orders and substract its ordered quantity def quantity_available - quantity - OrderArticle.where(article_id: id). + quantity - quantity_ordered + end + + def quantity_ordered + OrderArticle.where(article_id: id). joins(:order).where("orders.state = 'open' OR orders.state = 'finished'").sum(:units_to_order) end - + def quantity_history stock_changes.reorder('stock_changes.created_at ASC').map{|s| s.quantity}.cumulative_sum end diff --git a/app/views/stockit/index.html.haml b/app/views/stockit/index.html.haml index c2899d9e..ee65cea4 100644 --- a/app/views/stockit/index.html.haml +++ b/app/views/stockit/index.html.haml @@ -32,22 +32,22 @@ %table.table.table-hover#articles %thead %tr - %th= t '.article.article' - %th= t '.article.stock' - %th= t '.article.ordered' - %th= t '.article.available' - %th= t '.article.unit' - %th= t '.article.price' - %th= t '.article.vat' - %th= t '.article.supplier' - %th= t '.article.category' + %th= Article.model_name.human + %th= heading_helper StockArticle, :quantity + %th= heading_helper StockArticle, :quantity_ordered + %th= heading_helper StockArticle, :available + %th= heading_helper StockArticle, :unit + %th= heading_helper StockArticle, :price + %th= heading_helper StockArticle, :tax + %th= heading_helper StockArticle, :supplier + %th= heading_helper StockArticle, :article_category %th %tbody - for article in @stock_articles %tr{:class => stock_article_classes(article), :id => "stockArticle-#{article.id}"} %td= link_to article.name, article %td= article.quantity - %td= article.quantity - article.quantity_available + %td= article.quantity_ordered %th= article.quantity_available %td= article.unit %td= article.price diff --git a/config/locales/en.yml b/config/locales/en.yml index a48acd92..06d90481 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -95,8 +95,10 @@ en: stock_article: available: Available price: Price + quantity: In stock quantity_available: Available quantity quantity_available_short: Avail. + quantity_ordered: Ordered stock_taking: date: Date note: Note @@ -1428,16 +1430,6 @@ en: form: price_hint: To avoid choas, it is not possible to edit the prices of already added stock articles until further notice. index: - article: - article: Article - available: available - category: Category - ordered: ordered - price: Price - stock: In stock - supplier: Supplier - unit: Unit - vat: VAT confirm_delete: Are you sure you want to delete? new_delivery: New delivery ... new_stock_article: Add new stock article From 111c061efa533115e9204356f87d7b6098995439 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 22:53:59 +0100 Subject: [PATCH 27/68] more i18n cleanup (affects foodcoops#137) --- app/helpers/stockit_helper.rb | 6 +++--- config/locales/en.yml | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/helpers/stockit_helper.rb b/app/helpers/stockit_helper.rb index f6a0a1fc..e75e1676 100644 --- a/app/helpers/stockit_helper.rb +++ b/app/helpers/stockit_helper.rb @@ -7,11 +7,11 @@ module StockitHelper def link_to_stock_change_reason(stock_change) if stock_change.delivery_id - link_to t('.delivery'), supplier_delivery_path(stock_change.delivery.supplier, stock_change.delivery) + link_to Delivery.model_name.human, supplier_delivery_path(stock_change.delivery.supplier, stock_change.delivery) elsif stock_change.order_id - link_to t('.order'), order_path(stock_change.order) + link_to Order.model_name.human, order_path(stock_change.order) elsif stock_change.stock_taking_id - link_to t('.stock_taking'), stock_taking_path(stock_change.stock_taking) + link_to StockTaking.model_name.human, stock_taking_path(stock_change.stock_taking) end end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 06d90481..17f9dc61 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1447,12 +1447,9 @@ en: show: change_quantity: Change datetime: Time - delivery: Delivery new_quantity: New quantity - order: Order reason: Reason stock_changes: Stock quantity changes - stock_taking: Inventory stock_create: notice: Stock article was created. stock_update: From 112fa3be23fc1af424838a41520ad450fe51e295 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 23:08:28 +0100 Subject: [PATCH 28/68] fix forgotten i18n string (affects foodcoops#137) --- app/views/stock_takings/_stock_change.html.haml | 3 ++- config/locales/de.yml | 1 + config/locales/en.yml | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/stock_takings/_stock_change.html.haml b/app/views/stock_takings/_stock_change.html.haml index 3d27c1fa..0f016aa9 100644 --- a/app/views/stock_takings/_stock_change.html.haml +++ b/app/views/stock_takings/_stock_change.html.haml @@ -1,7 +1,8 @@ %p = simple_fields_for "stock_taking[stock_change_attributes][]", stock_change do |form| = form.hidden_field :stock_article_id - = "Menge (#{stock_change.stock_article.quantity_available})" + = t '.amount' + (#{stock_change.stock_article.quantity_available}) = form.text_field :quantity, :size => 5, :autocomplete => 'off' %span{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => stock_change.stock_article})}} %b= stock_change.stock_article.name diff --git a/config/locales/de.yml b/config/locales/de.yml index a1a06ebc..ce4d7a79 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1392,6 +1392,7 @@ de: new_inventory: Neue Inventur anlegen title: Inventurübersicht new: + amount: Menge create: anlegen stock_articles: Lagerartikel temp_inventory: vorläufigen Lagerbestand diff --git a/config/locales/en.yml b/config/locales/en.yml index 17f9dc61..13c5299c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1398,6 +1398,7 @@ en: new_inventory: Create new inventory title: Inventory overview new: + amount: Amount create: create stock_articles: Stock articles temp_inventory: temporary inventory From b05c75aef3bcffd143408e12c02d054fedda5b1d Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 6 Dec 2013 23:12:15 +0100 Subject: [PATCH 29/68] localeapp roundtrip --- config/locales/de.yml | 15 +---- config/locales/fr.yml | 36 ++++------- config/locales/nl.yml | 143 +++++++++++++++++++++++++----------------- 3 files changed, 101 insertions(+), 93 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index ce4d7a79..67285827 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -95,8 +95,10 @@ de: stock_article: available: Verfügbar price: Nettopreis + quantity: im Lager quantity_available: Verfügbarer Bestand quantity_available_short: Verf. + quantity_ordered: Davon bestellt stock_taking: date: Datum note: Notiz @@ -1425,16 +1427,6 @@ de: form: price_hint: Um Chaos zu vermeiden können bis auf weiteres die Preise von angelegten Lagerartikeln nicht mehr verändert werden. index: - article: - article: Artikel - available: verfügbar - category: Kategorie - ordered: davon bestellt - price: Preis - stock: im Lager - supplier: Lieferantin - unit: Einheit - vat: MwSt confirm_delete: Bist Du sicher? new_delivery: Neue Lieferung .. new_stock_article: Neuen Lagerartikel anlegen @@ -1452,12 +1444,9 @@ de: show: change_quantity: Veränderung datetime: Zeitpunkt - delivery: Lieferung new_quantity: Neuer Bestand - order: Bestellung reason: Ereignis stock_changes: Verlauf des Lagerbestands - stock_taking: Inventur stock_create: notice: Lagerartikel wurde gespeichert. stock_update: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 2ce74783..bf07f516 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -95,8 +95,10 @@ fr: stock_article: available: Disponible price: Prix net + quantity: en Stock quantity_available: quantity_available_short: + quantity_ordered: Commandés stock_taking: date: note: @@ -158,21 +160,21 @@ fr: exclusion: répétition hebdomadaire invalide pour un boulot déjà effectué models: article: Article - article_category: la nouvelle catégorie - delivery: le nouveau réapprovisionnement - financial_transaction: la transaction - invoice: la nouvelle facture + article_category: Catégorie + delivery: Réapprovisionnement + financial_transaction: Transaction + invoice: Facture message: Message - order: la nouvelle commande + order: Commande order_article: Article à commander - order_comment: un nouveau commentaire - ordergroup: la nouvelle cellule + order_comment: Commentaire + ordergroup: Cellule stock_article: l'article à stocker stock_taking: Inventaire supplier: FournisseusE_r - task: comme nouveau boulot - user: le nouveau membre - workgroup: la nouvelle équipe + task: Boulot + user: Membre + workgroup: Équipe admin: access_to: accès à actions: Actions @@ -1399,6 +1401,7 @@ fr: new_inventory: Inventorier le stock title: Aperçu de l'inventaire new: + amount: create: ajouter stock_articles: Articles en stock temp_inventory: l'inventaire courant @@ -1433,16 +1436,6 @@ fr: form: price_hint: Pour éviter que ça soit le bazar, les prix des articles en stock ne peuvent plus être modifiés. index: - article: - article: Article - available: disponible - category: Catégorie - ordered: commandés - price: Prix - stock: en Stock - supplier: FournisseusE_r - unit: Unité - vat: TVA confirm_delete: T'es sûrE de ton coup? new_delivery: Réapprovisionner le stock... new_stock_article: Ajouter un article au stock @@ -1460,12 +1453,9 @@ fr: show: change_quantity: Modification datetime: Temps - delivery: Réapprovisionnement new_quantity: Nouveau stock - order: Commande reason: Raison stock_changes: Afficher l'historique - stock_taking: Inventaire stock_create: notice: L'article a été sauvegardé. stock_update: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 9a4731a0..9f34742f 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -95,8 +95,10 @@ nl: stock_article: available: Beschikbaar price: Prijs + quantity: Op voorraad quantity_available: Beschikbaar quantity_available_short: Besch. + quantity_ordered: Besteld stock_taking: date: Datum note: Notitie @@ -289,7 +291,7 @@ nl: title: Categorie bewerken index: confirm_delete: Weet je het zeker? - new: Nieuwe categorie maken + new: Nieuwe categorie title: Categoriën new: title: Nieuwe categorie maken @@ -365,7 +367,7 @@ nl: restrict_region: Alleen uit de regio title: Artikel importeren new: Nieuw artikel - new_order: Bestelling aanmaken + new_order: Nieuwe bestelling search_placeholder: Naam ... title: Artikelen van %{supplier} (%{count}) upload: Artikelen uploaden @@ -942,16 +944,55 @@ nl: header: ! '%{user} schreef op %{date}:' subject: Feedback van %{email} foodsoft_message: - footer: + footer: ! 'Antwoorden: %{reply_url} + + Bericht online lezen: %{msg_url} + + Berichtinstellingen: %{profile_url}' invite: subject: Uitnodiging voor de foodcoop - text: + text: ! 'Hallo! + + + %{user} <%{mail}> heeft je uitgenodigd om deel te worden van de groep "%{group}". + + Om lid te worden van de foodcoop en de uitnodiging te accepteren, ga naar: %{link} + + Dit kan maar een keer en uiterlijk tot %{expires}. + + + Groeten van de foodcoop.' negative_balance: - subject: - text: + subject: Negatief tegoed + text: ! 'Beste %{group}, + + + Je tegoed is onder nul gekomen op %{when}: %{balance} + + + Er werd %{amount} afgeschreven voor "%{note}" door %{user}. + + + Zorg er alsjeblieft voor dat tegoed weer positief wordt. + + + + Hartlijke groet van %{foodcoop}.' not_enough_users_assigned: - subject: - text: + subject: ! '"%{task}" heeft nog mensen nodig!' + text: ! 'Beste %{user}, + + + De taak ''%{task}'' van jouw werkgroep op %{when} kan nog iemand gebruiken! + + + Als je je hiervoor nog niet aangemeld hebt is dit je kans: + + + %{workgroup_tasks_url} + + + Jouw taken: %{user_tasks_url}' order_result: subject: ! 'Bestelling gesloten: %{name}' text0: ! 'Beste %{ordergroup}. @@ -1124,7 +1165,7 @@ nl: warning_ordered: ! 'Opgelet: rood gemarkeerde artikelen zijn al besteld door leden. Als je ze hier deselecteert, worden alle bestaande ledenbestellingen van deze artikelen verwijderd.' warning_ordered_stock: ! 'Opgelet: rood gemarkeerde artikelen zijn al besteld of gekocht door leden. Als je ze hier deselecteert, worden alle bestaande ledenbestellingen/-aankopen van deze artikelen verwijderd, en worden ze niet afgerekend.' new: - title: Nieuwe bestelling maken + title: Nieuwe bestelling openen show: action_end: Sluiten! amounts: ! 'Totaal netto/bruto:' @@ -1257,7 +1298,7 @@ nl: access: Toegang tot activated: actief address: Adres - apple_limit: + apple_limit: Appelpunten bestellingslimiet contact: Contact deactivated: inactief description: Beschrijving @@ -1330,33 +1371,34 @@ nl: 'yes': Ja stock_takings: create: - notice: Inventarisatie is aangelegd. + notice: Inventaris is opgenomen. edit: - title: + title: Inventaris aanpassen index: - new_inventory: - title: + new_inventory: Nieuwe inventaris opnemen + title: Inventarisoverzicht new: - create: + amount: Aantal + create: aanmaken stock_articles: Voorraadartikelen temp_inventory: tijdelijke inventaris - text_deviations: - text_need_articles: - title: + text_deviations: Vul alle afwijkingen in van de %{inv_link}. Als er minder is dan vermeld, gebruik dan een negatief getal. + text_need_articles: Je moet een nieuw voorraadartikel %{create_link} voordat je het hier kunt gebruiken. + title: Inventaris opnemen show: - amount: - article: - confirm_delete: - date: - note: - overview: - supplier: - title: - unit: + amount: Aantal + article: Artikel + confirm_delete: Wil je de inventaris echt verwijderen? + date: Datum + note: Notitie + overview: Inventarisoverzicht + supplier: Leverancier + title: Inventarisoverzicht + unit: Eenheid stock_takings: - confirm_delete: - date: - note: + confirm_delete: Weet je zeker dat je dit wilt verwijderen? + date: Datum + note: Notitie update: notice: Inventarisatie is bijgewerkt. stockit: @@ -1369,39 +1411,26 @@ nl: form: price_hint: Om chaos te voorkomen, kun je de prijs van bestaande voorraadartikelen niet aanpassen. index: - article: - article: Artikel - available: beschikbaar - category: Categorie - ordered: besteld - price: Prijs - stock: Op voorraad - supplier: Leverancier - unit: Eenheid - vat: BTW confirm_delete: Weet je zeker dat je dit wilt verwijderen? new_delivery: Nieuwe levering ... new_stock_article: Nieuw voorraadartikel - new_stock_taking: Inventaris aanleggen + new_stock_taking: Inventaris nemen order_online: Voorraadbestelling openen - show_stock_takings: - stock_count: - stock_worth: - title: - toggle_unavailable: - view_options: + show_stock_takings: Inventarisoverzicht + stock_count: ! 'Aantal artikelen:' + stock_worth: ! 'Waarde van huidige voorraad:' + title: Voorraad (%{article_count}) + toggle_unavailable: Niet beschikbare artikelen tonen/verbergen + view_options: Weergave new: - search_text: - title: + search_text: ! 'Artikelen zoeken in alle catalogi:' + title: Nieuw voorraadartikel maken show: - change_quantity: - datetime: - delivery: - new_quantity: - order: - reason: - stock_changes: - stock_taking: + change_quantity: Verandering + datetime: Tijd + new_quantity: Nieuw aantal + reason: Reden + stock_changes: Verloop stock_create: notice: Voorraadsartikel is opgeslagen. stock_update: From dd08e277c7d4af7be05399c84c906954e327ea4e Mon Sep 17 00:00:00 2001 From: Julius Rapp Date: Sat, 7 Dec 2013 11:20:03 +0100 Subject: [PATCH 30/68] AJAX_ify StockArticle manipulation; Introduce publish/subscribe pattern for DOM updates --- app/controllers/stockit_controller.rb | 54 ++++++++++++++++--- app/helpers/stockit_helper.rb | 9 ++++ app/views/stockit/_form.html.haml | 39 +++++++------- app/views/stockit/_stock_article.html.haml | 14 +++++ .../stockit/_stock_article_details.html.haml | 26 +++++++++ app/views/stockit/copy.js.erb | 9 ++++ app/views/stockit/create.js.erb | 15 ++++++ app/views/stockit/destroy.js.erb | 13 +++++ app/views/stockit/destroy.js.haml | 8 --- app/views/stockit/edit.html.haml | 3 -- app/views/stockit/edit.js.erb | 9 ++++ app/views/stockit/index.html.haml | 45 ++++++++++------ .../index_on_stock_article_create.js.erb | 12 +++++ .../index_on_stock_article_update.js.erb | 12 +++++ app/views/stockit/new.html.haml | 22 -------- app/views/stockit/new.js.erb | 9 ++++ app/views/stockit/show.html.haml | 40 ++++++-------- .../show_on_stock_article_update.js.erb | 13 +++++ app/views/stockit/update.js.erb | 15 ++++++ config/locales/en.yml | 14 ++--- config/routes.rb | 6 +++ doc/design_patterns/publish_subscribe.md | 33 ++++++++++++ 22 files changed, 313 insertions(+), 107 deletions(-) create mode 100644 app/views/stockit/_stock_article.html.haml create mode 100644 app/views/stockit/_stock_article_details.html.haml create mode 100644 app/views/stockit/copy.js.erb create mode 100644 app/views/stockit/create.js.erb create mode 100644 app/views/stockit/destroy.js.erb delete mode 100644 app/views/stockit/destroy.js.haml delete mode 100644 app/views/stockit/edit.html.haml create mode 100644 app/views/stockit/edit.js.erb create mode 100644 app/views/stockit/index_on_stock_article_create.js.erb create mode 100644 app/views/stockit/index_on_stock_article_update.js.erb delete mode 100644 app/views/stockit/new.html.haml create mode 100644 app/views/stockit/new.js.erb create mode 100644 app/views/stockit/show_on_stock_article_update.js.erb create mode 100644 app/views/stockit/update.js.erb create mode 100644 doc/design_patterns/publish_subscribe.md diff --git a/app/controllers/stockit_controller.rb b/app/controllers/stockit_controller.rb index 475ac3a3..85c027ea 100644 --- a/app/controllers/stockit_controller.rb +++ b/app/controllers/stockit_controller.rb @@ -4,30 +4,62 @@ class StockitController < ApplicationController @stock_articles = StockArticle.undeleted.includes(:supplier, :article_category). order('suppliers.name, article_categories.name, articles.name') end + + def index_on_stock_article_create # See publish/subscribe design pattern in /doc. + @stock_article = StockArticle.find(params[:id]) + + render :layout => false + end + def index_on_stock_article_update # See publish/subscribe design pattern in /doc. + @stock_article = StockArticle.find(params[:id]) + + render :layout => false + end + + # three possibilites to fill a new_stock_article form + # (1) start from blank or use params def new - @stock_article = StockArticle.new + @stock_article = StockArticle.new(params[:stock_article]) + + render :layout => false + end + + # (2) StockArticle as template + def copy + @stock_article = StockArticle.find(params[:stock_article_id]).dup + + render :layout => false + end + + # (3) non-stock Article as template + def derive + @stock_article = Article.find(params[:old_article_id]).becomes(StockArticle).dup + + render :layout => false end def create @stock_article = StockArticle.new(params[:stock_article]) - if @stock_article.save - redirect_to stock_articles_path, :notice => I18n.t('stockit.stock_create.notice') + if @stock_article.valid? and @stock_article.save + render :layout => false else - render :action => 'new' + render :action => 'new', :layout => false end end def edit @stock_article = StockArticle.find(params[:id]) + + render :layout => false end def update @stock_article = StockArticle.find(params[:id]) if @stock_article.update_attributes(params[:stock_article]) - redirect_to stock_articles_path, :notice => I18n.t('stockit.stock_update.notice') + render :layout => false else - render :action => 'edit' + render :action => 'edit', :layout => false end end @@ -36,9 +68,15 @@ class StockitController < ApplicationController @stock_changes = @stock_article.stock_changes.order('stock_changes.created_at DESC') end + def show_on_stock_article_update # See publish/subscribe design pattern in /doc. + @stock_article = StockArticle.find(params[:id]) + + render :layout => false + end + def destroy - @article = StockArticle.find(params[:id]) - @article.mark_as_deleted + @stock_article = StockArticle.find(params[:id]) + @stock_article.mark_as_deleted render :layout => false rescue => error render :partial => "destroy_fail", :layout => false, diff --git a/app/helpers/stockit_helper.rb b/app/helpers/stockit_helper.rb index f6a0a1fc..aee6708e 100644 --- a/app/helpers/stockit_helper.rb +++ b/app/helpers/stockit_helper.rb @@ -14,4 +14,13 @@ module StockitHelper link_to t('.stock_taking'), stock_taking_path(stock_change.stock_taking) end end + + def stock_article_price_hint(stock_article) + t('simple_form.hints.stock_article.edit_stock_article.price', + :stock_article_copy_link => link_to(t('.copy_stock_article'), + stock_article_copy_path(stock_article), + :remote => true + ) + ) + end end diff --git a/app/views/stockit/_form.html.haml b/app/views/stockit/_form.html.haml index 32e58623..1e56b2c2 100644 --- a/app/views/stockit/_form.html.haml +++ b/app/views/stockit/_form.html.haml @@ -1,18 +1,21 @@ -= simple_form_for stock_article, :validate => true do |f| - = f.association :supplier - = f.input :name - = f.input :unit - = f.input :note - - - if stock_article.new_record? - = f.input :price - = f.input :tax, :wrapper => :append do - = f.input_field :tax - %span.add-on % - = f.input :deposit - - else - = f.input :price, :input_html => {:disabled => 'disabled'}, :hint => t('.price_hint') - = f.association :article_category - .form-actions - = f.submit class: 'btn' - = link_to t('ui.or_cancel'), stock_articles_path += simple_form_for stock_article, remote: true, :validate => true do |f| + .modal-header + = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'} + %h3= title + .modal-body + = f.association :supplier + = f.input :name + = f.input :unit + = f.input :note + - if stock_article.new_record? + = f.input :price + = f.input :tax, :wrapper => :append do + = f.input_field :tax + %span.add-on % + = f.input :deposit + - else + = f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article).html_safe + = f.association :article_category + .modal-footer + = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} + = f.submit :class => 'btn btn-primary', 'data-disable-with' => t('ui.please_wait') diff --git a/app/views/stockit/_stock_article.html.haml b/app/views/stockit/_stock_article.html.haml new file mode 100644 index 00000000..c2eb3566 --- /dev/null +++ b/app/views/stockit/_stock_article.html.haml @@ -0,0 +1,14 @@ +%tr{:class => stock_article_classes(stock_article), :id => "stockArticle-#{stock_article.id}"} + %td= link_to stock_article.name, stock_article + %td= stock_article.quantity + %td= stock_article.quantity - stock_article.quantity_available + %th= stock_article.quantity_available + %td= stock_article.unit + %td= stock_article.price + %td= number_to_percentage stock_article.tax + %td= link_to stock_article.supplier.name, stock_article.supplier + %td= stock_article.article_category.name + %td + = link_to t('ui.edit'), edit_stock_article_path(stock_article), remote: true, class: 'btn btn-mini' + = link_to t('ui.delete'), stock_article, :method => :delete, :confirm => t('.confirm_delete', :name => stock_article.name), + class: 'btn btn-mini btn-danger', :remote => true diff --git a/app/views/stockit/_stock_article_details.html.haml b/app/views/stockit/_stock_article_details.html.haml new file mode 100644 index 00000000..617799e7 --- /dev/null +++ b/app/views/stockit/_stock_article_details.html.haml @@ -0,0 +1,26 @@ +#stockArticleDetails + %dl.dl-horizontal + %dt= heading_helper(StockArticle, :supplier) + %dd= link_to stock_article.supplier.name, stock_article.supplier + %dt= heading_helper(StockArticle, :name) + %dd= stock_article.name + %dt= heading_helper(StockArticle, :unit) + %dd= stock_article.unit + %dt= heading_helper(StockArticle, :price) + %dd= number_to_currency stock_article.price + %dt= heading_helper(StockArticle, :tax) + %dd= number_to_percentage stock_article.tax + %dt= heading_helper(StockArticle, :deposit) + %dd= number_to_currency stock_article.deposit + %dt= heading_helper(StockArticle, :fc_price) + %dd= number_to_currency stock_article.fc_price + %dt= heading_helper(StockArticle, :article_category) + %dd= stock_article.article_category.name + %dt= heading_helper(StockArticle, :note) + %dd= stock_article.note + %dt= heading_helper(StockArticle, :quantity) + %dd= stock_article.quantity + %dt= heading_helper(StockArticle, :quantity_available) + %dd= stock_article.quantity_available + .form-actions + = link_to t('ui.edit'), edit_stock_article_path(stock_article), remote: true, class: 'btn' diff --git a/app/views/stockit/copy.js.erb b/app/views/stockit/copy.js.erb new file mode 100644 index 00000000..e3bc3321 --- /dev/null +++ b/app/views/stockit/copy.js.erb @@ -0,0 +1,9 @@ +$('#modalContainer').html('<%= j(render( + :partial => "form", + :locals => { + :title => t('.title'), + :stock_article => @stock_article + } +)) %>'); + +$('#modalContainer').modal(); diff --git a/app/views/stockit/create.js.erb b/app/views/stockit/create.js.erb new file mode 100644 index 00000000..aa75b2dc --- /dev/null +++ b/app/views/stockit/create.js.erb @@ -0,0 +1,15 @@ +$('div.container-fluid').prepend('<%= j(render( + :partial => 'shared/alert_success', + :locals => { + :alert_message => t('.notice', :name => @stock_article.name) + } +)) %>'); + +// Publish database changes. +// See publish/subscribe design pattern in /doc. +$(document).trigger({ + type: 'StockArticle#create', + stock_article_id: <%= @stock_article.id %> +}); + +$('#modalContainer').modal('hide'); diff --git a/app/views/stockit/destroy.js.erb b/app/views/stockit/destroy.js.erb new file mode 100644 index 00000000..7bba9dbf --- /dev/null +++ b/app/views/stockit/destroy.js.erb @@ -0,0 +1,13 @@ +$('div.container-fluid').prepend('<%= j(render( + :partial => 'shared/alert_success', + :locals => { + :alert_message => t('.notice', :name => @stock_article.name) + } +)) %>'); + +// Publish database changes. +// See publish/subscribe design pattern in /doc. +$(document).trigger({ + type: 'StockArticle#destroy', + stock_article_id: <%= @stock_article.id %> +}); diff --git a/app/views/stockit/destroy.js.haml b/app/views/stockit/destroy.js.haml deleted file mode 100644 index 8bbde9ed..00000000 --- a/app/views/stockit/destroy.js.haml +++ /dev/null @@ -1,8 +0,0 @@ --# please polish the following line if you know how, same in partial _destroy_fail -var successDiv = $(''); - -successDiv.append(document.createTextNode('#{escape_javascript(t('.notice', name: @article.name))}')); -$('div.container-fluid').prepend(successDiv); - -$('#stockArticle-#{@article.id}').remove(); --# WARNING: Do not use a simple .fadeOut() above, because it conflicts with the show/hide function of unavailable articles. diff --git a/app/views/stockit/edit.html.haml b/app/views/stockit/edit.html.haml deleted file mode 100644 index bdf498c6..00000000 --- a/app/views/stockit/edit.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- title t('.title') - -= render :partial => 'form', :locals => {:stock_article => @stock_article} diff --git a/app/views/stockit/edit.js.erb b/app/views/stockit/edit.js.erb new file mode 100644 index 00000000..e3bc3321 --- /dev/null +++ b/app/views/stockit/edit.js.erb @@ -0,0 +1,9 @@ +$('#modalContainer').html('<%= j(render( + :partial => "form", + :locals => { + :title => t('.title'), + :stock_article => @stock_article + } +)) %>'); + +$('#modalContainer').modal(); diff --git a/app/views/stockit/index.html.haml b/app/views/stockit/index.html.haml index c2899d9e..0fbd2722 100644 --- a/app/views/stockit/index.html.haml +++ b/app/views/stockit/index.html.haml @@ -3,6 +3,30 @@ :javascript $(function() { $('tr.unavailable').hide(); + + // Subscribe to database changes. + // See publish/subscribe design pattern in /doc. + $(document).on('StockArticle#create', function(e) { + $.ajax({ + url: '#{index_on_stock_article_create_stock_articles_path}', + type: 'get', + data: {id: e.stock_article_id}, + contentType: 'application/json; charset=UTF-8' + }); + }); + + $(document).on('StockArticle#destroy', function(e) { + $('#stockArticle-' + e.stock_article_id).remove(); + }); + + $(document).on('StockArticle#update', function(e) { + $.ajax({ + url: '#{index_on_stock_article_update_stock_articles_path}', + type: 'get', + data: {id: e.stock_article_id}, + contentType: 'application/json; charset=UTF-8' + }); + }); }) .well.well-small @@ -17,7 +41,7 @@ .btn-group = link_to_if @current_user.role_orders?, t('.order_online'), new_order_path(supplier_id: 0), class: 'btn', class: 'btn btn-primary' - = link_to t('.new_stock_article'), new_stock_article_path, class: 'btn' + = link_to t('.new_stock_article'), new_stock_article_path, remote: true, class: 'btn' = link_to t('.new_stock_taking'), new_stock_taking_path, class: 'btn' = link_to t('.show_stock_takings'), stock_takings_path, class: 'btn' @@ -42,22 +66,9 @@ %th= t '.article.supplier' %th= t '.article.category' %th - %tbody - - for article in @stock_articles - %tr{:class => stock_article_classes(article), :id => "stockArticle-#{article.id}"} - %td= link_to article.name, article - %td= article.quantity - %td= article.quantity - article.quantity_available - %th= article.quantity_available - %td= article.unit - %td= article.price - %td= number_to_percentage article.tax - %td= link_to article.supplier.name, article.supplier - %td= article.article_category.name - %td - = link_to t('ui.edit'), edit_stock_article_path(article), class: 'btn btn-mini' - = link_to t('ui.delete'), article, :method => :delete, :confirm => t('.confirm_delete'), - class: 'btn btn-mini btn-danger', :remote => true + %tbody#articles-tbody + - for stock_article in @stock_articles + = render :partial => 'stock_article', :locals => {:stock_article => stock_article} %p = t '.stock_worth' = number_to_currency StockArticle.stock_value diff --git a/app/views/stockit/index_on_stock_article_create.js.erb b/app/views/stockit/index_on_stock_article_create.js.erb new file mode 100644 index 00000000..eb48001b --- /dev/null +++ b/app/views/stockit/index_on_stock_article_create.js.erb @@ -0,0 +1,12 @@ +// Handle more advanced DOM update after AJAX database manipulation. +// See publish/subscribe design pattern in /doc. +(function() { + var stock_article_row = $('<%= j(render( + :partial => 'stock_article', + :locals => { + :stock_article => @stock_article + } + )) %>'); + + $('#articles-tbody').prepend(stock_article_row); +})(); diff --git a/app/views/stockit/index_on_stock_article_update.js.erb b/app/views/stockit/index_on_stock_article_update.js.erb new file mode 100644 index 00000000..6e43db8e --- /dev/null +++ b/app/views/stockit/index_on_stock_article_update.js.erb @@ -0,0 +1,12 @@ +// Handle more advanced DOM update after AJAX database manipulation. +// See publish/subscribe design pattern in /doc. +(function() { + var stock_article_row = $('<%= j(render( + :partial => 'stock_article', + :locals => { + :stock_article => @stock_article + } + )) %>'); + + $('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row); +})(); diff --git a/app/views/stockit/new.html.haml b/app/views/stockit/new.html.haml deleted file mode 100644 index 05609a84..00000000 --- a/app/views/stockit/new.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -- title t('.title') - -- content_for :head do - :javascript - $(function() { - $('#article_search').autocomplete({ - source: '#{articles_search_stock_articles_path}', - select: function(e, ui) { - alert(ui.item.value); - //location.href = '#{nil}' + ui.item.value; - } - }); - }) - - -/ - TODO: Fix this - %p - = t '.search_text' - = text_field_tag 'article_search' -#stock_article_form - = render :partial => 'form', :locals => {:stock_article => @stock_article} diff --git a/app/views/stockit/new.js.erb b/app/views/stockit/new.js.erb new file mode 100644 index 00000000..e3bc3321 --- /dev/null +++ b/app/views/stockit/new.js.erb @@ -0,0 +1,9 @@ +$('#modalContainer').html('<%= j(render( + :partial => "form", + :locals => { + :title => t('.title'), + :stock_article => @stock_article + } +)) %>'); + +$('#modalContainer').modal(); diff --git a/app/views/stockit/show.html.haml b/app/views/stockit/show.html.haml index 5f416bf9..077b6e3a 100644 --- a/app/views/stockit/show.html.haml +++ b/app/views/stockit/show.html.haml @@ -1,32 +1,22 @@ - title @stock_article.name +- content_for :javascript do + :javascript + $(function() { + // Subscribe to database changes. + // See publish/subscribe design pattern in /doc. + $(document).on('StockArticle#update', function(e) { + $.ajax({ + url: '#{show_on_stock_article_update_stock_articles_path}', + type: 'get', + data: {id: e.stock_article_id}, + contentType: 'application/json; charset=UTF-8' + }); + }); + }); .row-fluid .span6 - %dl.dl-horizontal - %dt= StockArticle.human_attribute_name 'supplier' - %dd= link_to @stock_article.supplier.name, @stock_article.supplier - %dt= StockArticle.human_attribute_name 'name' - %dd= @stock_article.name - %dt= StockArticle.human_attribute_name 'unit' - %dd= @stock_article.unit - %dt= StockArticle.human_attribute_name 'price' - %dd= number_to_currency @stock_article.price - %dt= StockArticle.human_attribute_name 'tax' - %dd= number_to_percentage @stock_article.tax - %dt= StockArticle.human_attribute_name 'deposit' - %dd= number_to_currency @stock_article.deposit - %dt= StockArticle.human_attribute_name 'fc_price' - %dd= number_to_currency @stock_article.fc_price - %dt= StockArticle.human_attribute_name 'article_category' - %dd= @stock_article.article_category.name - %dt= StockArticle.human_attribute_name 'note' - %dd= @stock_article.note - %dt= StockArticle.human_attribute_name 'quantity' - %dd= @stock_article.quantity - %dt= StockArticle.human_attribute_name 'quantity_available' - %dd= @stock_article.quantity_available - .form-actions - = link_to t('ui.edit'), edit_stock_article_path(@stock_article), class: 'btn' + = render :partial => 'stock_article_details', :locals => {:stock_article => @stock_article} .span6 %h2= t('.stock_changes') diff --git a/app/views/stockit/show_on_stock_article_update.js.erb b/app/views/stockit/show_on_stock_article_update.js.erb new file mode 100644 index 00000000..ce057f89 --- /dev/null +++ b/app/views/stockit/show_on_stock_article_update.js.erb @@ -0,0 +1,13 @@ +// Handle more advanced DOM update after AJAX database manipulation. +// See publish/subscribe design pattern in /doc. +(function() { + var stock_article_details = $('<%= j(render( + :partial => 'stock_article_details', + :locals => { + :stock_article => @stock_article + } + )) %>'); + + $('#stockArticleDetails').replaceWith(stock_article_details); + $('h1').first().text('<%= j(@stock_article.name) %>'); +})(); diff --git a/app/views/stockit/update.js.erb b/app/views/stockit/update.js.erb new file mode 100644 index 00000000..830d846c --- /dev/null +++ b/app/views/stockit/update.js.erb @@ -0,0 +1,15 @@ +$('div.container-fluid').prepend('<%= j(render( + :partial => 'shared/alert_success', + :locals => { + :alert_message => t('.notice', :name => @stock_article.name) + } +)) %>'); + +// Publish database changes. +// See publish/subscribe design pattern in /doc. +$(document).trigger({ + type: 'StockArticle#update', + stock_article_id: <%= @stock_article.id %> +}); + +$('#modalContainer').modal('hide'); diff --git a/config/locales/en.yml b/config/locales/en.yml index a48acd92..7011146f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1348,7 +1348,7 @@ en: units_to_order: If you change the total amount of delivered units, you also have to change individual group amounts by clicking on the article name. They will not be automatically recalculated and so ordergroups may be accounted for articles that were not delivered! update_current_price: Also update the price of the current order stock_article: - copy_stock_article: + copy: name: Please modify edit_stock_article: price:
  • Price changes are forbidden.
  • If necessary, %{stock_article_copy_link}.
@@ -1421,8 +1421,10 @@ en: stockit: check: not_empty: ! '%{name} could not be deleted, the inventory is not zero.' + create: + notice: New stock article »%{name}« was created. destroy: - notice: Article %{name} was deleted. + notice: Article »%{name}« was deleted. edit: title: Edit stock articles form: @@ -1461,10 +1463,10 @@ en: reason: Reason stock_changes: Stock quantity changes stock_taking: Inventory - stock_create: - notice: Stock article was created. - stock_update: - notice: Stock article was saved. + stock_article: + confirm_delete: Are you sure you want to delete the stock article »%{name}«? + update: + notice: Stock article »%{name}« was saved. suppliers: create: notice: Supplier was created diff --git a/config/routes.rb b/config/routes.rb index 655a1038..62678230 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -86,9 +86,15 @@ Foodsoft::Application.routes.draw do end resources :stock_articles, :to => 'stockit' do + get :copy collection do get :articles_search get :fill_new_stock_article_form + + get :index_on_stock_article_create + get :index_on_stock_article_update + + get :show_on_stock_article_update end end diff --git a/doc/design_patterns/publish_subscribe.md b/doc/design_patterns/publish_subscribe.md new file mode 100644 index 00000000..d261d45a --- /dev/null +++ b/doc/design_patterns/publish_subscribe.md @@ -0,0 +1,33 @@ +# Publish/subscribe pattern +## Handling DOM updates after AJAX database manipulation + +As an example, let us consider the manipulation (create, update...) of `StockArticles`. This can be done in different views, e.g., `stock_articles/index`, `stock_articles/show` and `deliveries/_form` through modals using AJAX requests. As an advantage of the AJAX technique, the user does not need to reload the entire page. However, (after the update of the `StockArticle` in the database) it is generally required to update the DOM in the current view such that the page properly reacts to the asynchronous actions. + +The process can be divided in two steps: **1.** AJAX database manipulation and **2.** DOM updates for the particular view. The crucial point is the coupling of the two steps since the controller for the first step offers the same functionality to all views and does not need to know anything about the current view. + +1. AJAX database manipulation + 1. Example: current view `deliveries/_form` offers a link for the AJAX action `StockArticle#new`. This opens a modal filled with `stock_articles/_form`. + 2. AJAX form post addresses the `StockArticle#create` action which handles the database manipulation. + 3. The database manipulation is finished by the rendering of, e.g., `stock_articles/create.js.erb`. The key task there is to **publish** the database changes by calling `trigger`, i.e., + $(document).trigger({ + type: 'StockArticle#create', + stock_article_id: <%= @stock_article.id %> + }); +2. DOM updates for the particular view + 1. Each view has the opportunity to **subscribe** to particular events of the previous step. A very simple example is the update of the `stock_articles/index` view after `StockArticle#destroy`: + $(document).on('StockArticle#destroy', function(e) { + $('#stockArticle-' + e.stock_article_id).remove(); + }); + + However, in most of the situations you will like to use the full power of the MVC framework in order to read new data from the database and render some partial. Let us consider this slightly more advanced case in the following. + + The view `stock_articles/index` could listen (amongst others) to `StockArticle#create` like this: + $(document).on('StockArticle#create', function(e) { + $.ajax({ + url: '#{index_on_stock_article_create_stock_articles_path}', + type: 'get', + data: {id: e.stock_article_id}, + contentType: 'application/json; charset=UTF-8' + }); + }); + 2. The action `StockArticles#index_on_stock_article_create` is a special helper action to handle DOM updates of the `stock_articles/index` view after the creation of a new `StockArticle` with the given `id`. From 13bb4e0a8be6fa708ab954ff8f95b1b715156250 Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 15:12:08 +0100 Subject: [PATCH 31/68] Rename 'simple_form.hints.stock_article.copy_stock_article' to 'simple_form.hints.stock_article.copy' --- config/locales/de.yml | 2 +- config/locales/fr.yml | 2 +- config/locales/nl.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 67285827..d2ca5be0 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1346,7 +1346,7 @@ de: units_to_order: Wenn Du die Gesamtanzahl gelieferter Gebinde änderst, musst Du auch die individuelle Anzahl der einzelnen Bestellgruppen anpassen, indem Du auf den Artikelnamen klickst. Sie werden nicht automatisch neuberechnet und andernfalls werden den Bestellgruppen Artikel in Rechnung gestellt, die nicht geliefert wurden! update_current_price: Ändert auch den Preis für aktuelle Bestellungen stock_article: - copy_stock_article: + copy: name: Bitte ändern edit_stock_article: price:
  • Preisänderung gesperrt.
  • Bei Bedarf %{stock_article_copy_link}.
diff --git a/config/locales/fr.yml b/config/locales/fr.yml index bf07f516..5b947f08 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1353,7 +1353,7 @@ fr: units_to_order: update_current_price: Modifie aussi le prix des commandes en cours stock_article: - copy_stock_article: + copy: name: Merci de modifier edit_stock_article: price:
  • Modification du prix enregistrée.
  • Si nécessaire %{stock_article_copy_link}.
diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 9f34742f..f907d54c 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1330,7 +1330,7 @@ nl: units_to_order: Als je het aantal geleverde eenheden wijzigt, moet je daarna de hoeveelheden voor huishoudens aanpassen. Klik daarvoor op de artikelnaam. Als je dit vergeet, kunnen huishoudens belast worden voor artikelen die ze niet hebben gekregen! update_current_price: Ook prijs in huidige besteling aanpassen stock_article: - copy_stock_article: + copy: name: Wijzigen alsjeblieft edit_stock_article: price:
  • De prijs mag niet aangepast worden.
  • Indien nodig, %{stock_article_copy_link}.
From bceabfec5c552917f70f1dffaca41d34296d6e04 Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 16:42:25 +0100 Subject: [PATCH 32/68] Apply publish/subscribe pattern to stock_article manipulation in delivery form --- app/controllers/deliveries_controller.rb | 59 ++++--------------- app/helpers/deliveries_helper.rb | 9 --- app/views/deliveries/_form.html.haml | 26 +++++++- .../_stock_article_for_adding.html.haml | 4 +- .../deliveries/_stock_article_form.html.haml | 23 -------- .../deliveries/copy_stock_article.js.erb | 5 -- .../deliveries/derive_stock_article.js.erb | 5 -- .../deliveries/edit_stock_article.js.erb | 5 -- ...rb => form_on_stock_article_create.js.erb} | 8 +-- ...rb => form_on_stock_article_update.js.erb} | 8 +-- app/views/deliveries/new_stock_article.js.erb | 5 -- app/views/stockit/derive.js.erb | 9 +++ config/routes.rb | 18 +++--- 13 files changed, 57 insertions(+), 127 deletions(-) delete mode 100644 app/views/deliveries/_stock_article_form.html.haml delete mode 100644 app/views/deliveries/copy_stock_article.js.erb delete mode 100644 app/views/deliveries/derive_stock_article.js.erb delete mode 100644 app/views/deliveries/edit_stock_article.js.erb rename app/views/deliveries/{create_stock_article.js.erb => form_on_stock_article_create.js.erb} (64%) rename app/views/deliveries/{update_stock_article.js.erb => form_on_stock_article_update.js.erb} (81%) delete mode 100644 app/views/deliveries/new_stock_article.js.erb create mode 100644 app/views/stockit/derive.js.erb diff --git a/app/controllers/deliveries_controller.rb b/app/controllers/deliveries_controller.rb index 86eedc14..3f18899f 100644 --- a/app/controllers/deliveries_controller.rb +++ b/app/controllers/deliveries_controller.rb @@ -50,57 +50,22 @@ class DeliveriesController < ApplicationController redirect_to supplier_deliveries_url(@supplier) end - # three possibilites to fill a new_stock_article form - # (1) start from blank or use params - def new_stock_article - @stock_article = @supplier.stock_articles.build(params[:stock_article]) - - render :layout => false - end - - # (2) StockArticle as template - def copy_stock_article - @stock_article = StockArticle.find(params[:old_stock_article_id]).dup - - render :layout => false - end - - # (3) non-stock Article as template - def derive_stock_article - @stock_article = Article.find(params[:old_article_id]).becomes(StockArticle).dup - - render :layout => false - end - - def create_stock_article - @stock_article = StockArticle.new(params[:stock_article]) - - if @stock_article.valid? and @stock_article.save - render :layout => false - else - render :action => 'new_stock_article', :layout => false - end - end - - def edit_stock_article - @stock_article = StockArticle.find(params[:stock_article_id]) - render :layout => false - end - - def update_stock_article - @stock_article = StockArticle.find(params[:stock_article][:id]) - - if @stock_article.update_attributes(params[:stock_article]) - render :layout => false - else - render :action => 'edit_stock_article', :layout => false - end - end - def add_stock_change @stock_change = StockChange.new @stock_change.stock_article = StockArticle.find(params[:stock_article_id]) render :layout => false end + + def form_on_stock_article_create # See publish/subscribe design pattern in /doc. + @stock_article = StockArticle.find(params[:id]) + + render :layout => false + end + + def form_on_stock_article_update # See publish/subscribe design pattern in /doc. + @stock_article = StockArticle.find(params[:id]) + + render :layout => false + end end diff --git a/app/helpers/deliveries_helper.rb b/app/helpers/deliveries_helper.rb index b23107cc..2ef5d14b 100644 --- a/app/helpers/deliveries_helper.rb +++ b/app/helpers/deliveries_helper.rb @@ -25,13 +25,4 @@ module DeliveriesHelper return output.html_safe end - def stock_article_price_hint(stock_article) - t('simple_form.hints.stock_article.edit_stock_article.price', - :stock_article_copy_link => link_to(t('.copy_stock_article'), - copy_stock_article_supplier_deliveries_path(@supplier, :old_stock_article_id => stock_article.id), - :remote => true - ) - ) - end - end diff --git a/app/views/deliveries/_form.html.haml b/app/views/deliveries/_form.html.haml index 3e1a3b6c..533f44c3 100644 --- a/app/views/deliveries/_form.html.haml +++ b/app/views/deliveries/_form.html.haml @@ -42,7 +42,7 @@ } if('new' == selectedArticle.id) { $.ajax({ - url: '#{new_stock_article_supplier_deliveries_path(@supplier)}', + url: '#{new_stock_article_path}', type: 'get', data: {stock_article: {name: selectedArticle.text}}, contentType: 'application/json; charset=UTF-8' @@ -52,7 +52,7 @@ } if('' != selectedArticle.id) { $.ajax({ - url: '#{derive_stock_article_supplier_deliveries_path(@supplier)}', + url: '#{derive_stock_articles_path}', type: 'get', data: {old_article_id: selectedArticle.id}, contentType: 'application/json; charset=UTF-8' @@ -61,6 +61,26 @@ return true; } }); + + // Subscribe to database changes. + // See publish/subscribe design pattern in /doc. + $(document).on('StockArticle#create', function(e) { + $.ajax({ + url: '#{form_on_stock_article_create_supplier_deliveries_path(@supplier)}', + type: 'get', + data: {id: e.stock_article_id}, + contentType: 'application/json; charset=UTF-8' + }); + }); + + $(document).on('StockArticle#update', function(e) { + $.ajax({ + url: '#{form_on_stock_article_update_supplier_deliveries_path(@supplier)}', + type: 'get', + data: {id: e.stock_article_id}, + contentType: 'application/json; charset=UTF-8' + }); + }); }); function mark_article_for_delivery(stock_article_id) { @@ -96,7 +116,7 @@ %tr %th{:colspan => 5} - if articles_for_select2(@supplier).empty? - = link_to t('.create_stock_article'), new_stock_article_supplier_deliveries_path(@supplier), :remote => true, :class => 'btn' + = link_to t('.create_stock_article'), new_stock_article_path, :remote => true, :class => 'btn' - else %input#new_stock_article{:style => 'width: 500px;'} %tbody diff --git a/app/views/deliveries/_stock_article_for_adding.html.haml b/app/views/deliveries/_stock_article_for_adding.html.haml index b43df782..956d8379 100644 --- a/app/views/deliveries/_stock_article_for_adding.html.haml +++ b/app/views/deliveries/_stock_article_for_adding.html.haml @@ -5,7 +5,7 @@ %td= article.unit %td= article.article_category.name %td - = link_to t('.action_edit'), edit_stock_article_supplier_deliveries_path(@supplier, :stock_article_id => article.id), remote: true, class: 'btn btn-mini' - = link_to t('.action_other_price'), copy_stock_article_supplier_deliveries_path(@supplier, :old_stock_article_id => article.id), remote: true, class: 'btn btn-mini' + = link_to t('.action_edit'), edit_stock_article_path(article), remote: true, class: 'btn btn-mini' + = link_to t('.action_other_price'), stock_article_copy_path(article), remote: true, class: 'btn btn-mini' - deliver_button_disabled = ( @delivery and @delivery.includes_article? article ) ? ( 'disabled' ) : ( false ) = link_to t('.action_add_to_delivery'), add_stock_change_supplier_deliveries_path(@supplier, :stock_article_id => article.id), :method => :post, remote: true, class: 'button-add-stock-change btn btn-mini btn-primary', disabled: deliver_button_disabled diff --git a/app/views/deliveries/_stock_article_form.html.haml b/app/views/deliveries/_stock_article_form.html.haml deleted file mode 100644 index 5fdce8de..00000000 --- a/app/views/deliveries/_stock_article_form.html.haml +++ /dev/null @@ -1,23 +0,0 @@ -- url = ( stock_article.new_record? ) ? ( create_stock_article_supplier_deliveries_path(@supplier) ) : ( update_stock_article_supplier_deliveries_path(@supplier) ) -= simple_form_for stock_article, url: url, remote: true, validate: true do |f| - = f.association :supplier, :as => :hidden - = f.hidden_field :id unless stock_article.new_record? - .modal-header - = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'} - %h3= t 'activerecord.models.stock_article' - .modal-body - = f.input :name - = f.input :unit - = f.input :note - - if stock_article.new_record? - = f.input :price - = f.input :tax, :wrapper => :append do - = f.input_field :tax - %span.add-on % - = f.input :deposit - - else - = f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article).html_safe - = f.association :article_category - .modal-footer - = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} - = f.submit :class => 'btn btn-primary', 'data-disable-with' => t('ui.please_wait') diff --git a/app/views/deliveries/copy_stock_article.js.erb b/app/views/deliveries/copy_stock_article.js.erb deleted file mode 100644 index de5d260e..00000000 --- a/app/views/deliveries/copy_stock_article.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -$('#modalContainer').html( - '<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>' -); - -$('#modalContainer').modal(); diff --git a/app/views/deliveries/derive_stock_article.js.erb b/app/views/deliveries/derive_stock_article.js.erb deleted file mode 100644 index de5d260e..00000000 --- a/app/views/deliveries/derive_stock_article.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -$('#modalContainer').html( - '<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>' -); - -$('#modalContainer').modal(); diff --git a/app/views/deliveries/edit_stock_article.js.erb b/app/views/deliveries/edit_stock_article.js.erb deleted file mode 100644 index de5d260e..00000000 --- a/app/views/deliveries/edit_stock_article.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -$('#modalContainer').html( - '<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>' -); - -$('#modalContainer').modal(); diff --git a/app/views/deliveries/create_stock_article.js.erb b/app/views/deliveries/form_on_stock_article_create.js.erb similarity index 64% rename from app/views/deliveries/create_stock_article.js.erb rename to app/views/deliveries/form_on_stock_article_create.js.erb index cb9d0159..25360761 100644 --- a/app/views/deliveries/create_stock_article.js.erb +++ b/app/views/deliveries/form_on_stock_article_create.js.erb @@ -1,7 +1,5 @@ -$('div.container-fluid').prepend( - '<%= j(render(:partial => 'shared/alert_success', :locals => {:alert_message => t('.notice', :name => @stock_article.name)})) %>' -); - +// Handle more advanced DOM update after AJAX database manipulation. +// See publish/subscribe design pattern in /doc. (function() { $('#stock_articles_for_adding tr').removeClass('success'); @@ -12,5 +10,3 @@ $('div.container-fluid').prepend( $('#stock_articles_for_adding tbody').append(stock_article_for_adding); updateSort('#stock_articles_for_adding'); })(); - -$('#modalContainer').modal('hide'); diff --git a/app/views/deliveries/update_stock_article.js.erb b/app/views/deliveries/form_on_stock_article_update.js.erb similarity index 81% rename from app/views/deliveries/update_stock_article.js.erb rename to app/views/deliveries/form_on_stock_article_update.js.erb index 7b2d56d6..a993ab8d 100644 --- a/app/views/deliveries/update_stock_article.js.erb +++ b/app/views/deliveries/form_on_stock_article_update.js.erb @@ -1,7 +1,5 @@ -$('div.container-fluid').prepend( - '<%= j(render(:partial => 'shared/alert_success', :locals => {:alert_message => t('.notice', :name => @stock_article.name)})) %>' -); - +// Handle more advanced DOM update after AJAX database manipulation. +// See publish/subscribe design pattern in /doc. (function() { // update entry in stock_article table @@ -28,5 +26,3 @@ $('div.container-fluid').prepend( updateSort('#stock_changes'); })(); - -$('#modalContainer').modal('hide'); diff --git a/app/views/deliveries/new_stock_article.js.erb b/app/views/deliveries/new_stock_article.js.erb deleted file mode 100644 index de5d260e..00000000 --- a/app/views/deliveries/new_stock_article.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -$('#modalContainer').html( - '<%= j(render(:partial => "stock_article_form", :locals => {:stock_article => @stock_article})) %>' -); - -$('#modalContainer').modal(); diff --git a/app/views/stockit/derive.js.erb b/app/views/stockit/derive.js.erb new file mode 100644 index 00000000..e3bc3321 --- /dev/null +++ b/app/views/stockit/derive.js.erb @@ -0,0 +1,9 @@ +$('#modalContainer').html('<%= j(render( + :partial => "form", + :locals => { + :title => t('.title'), + :stock_article => @stock_article + } +)) %>'); + +$('#modalContainer').modal(); diff --git a/config/routes.rb b/config/routes.rb index 62678230..efb355d9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -88,8 +88,7 @@ Foodsoft::Application.routes.draw do resources :stock_articles, :to => 'stockit' do get :copy collection do - get :articles_search - get :fill_new_stock_article_form + get :derive get :index_on_stock_article_create get :index_on_stock_article_update @@ -102,15 +101,12 @@ Foodsoft::Application.routes.draw do get :shared_suppliers, :on => :collection resources :deliveries do - post :add_stock_change, :on => :collection - - get :new_stock_article, :on => :collection - get :copy_stock_article, :on => :collection - get :derive_stock_article, :on => :collection - post :create_stock_article, :on => :collection - - get :edit_stock_article, :on => :collection - put :update_stock_article, :on => :collection + collection do + post :add_stock_change + + get :form_on_stock_article_create + get :form_on_stock_article_update + end end resources :articles do From 3e49104318737228f50e02c5ab42169933a1df2e Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 16:44:16 +0100 Subject: [PATCH 33/68] Revert wrong quotation mark in English locale --- config/locales/en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 5912b041..989c09ae 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1425,7 +1425,7 @@ en: check: not_empty: ! '%{name} could not be deleted, the inventory is not zero.' create: - notice: New stock article »%{name}« was created. + notice: New stock article %{name} was created. destroy: notice: Article »%{name}« was deleted. edit: From 92f560e1895334e50336c5dc31dbead6084016aa Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 16:46:16 +0100 Subject: [PATCH 34/68] Again revert wrong quotation mark in English locale --- config/locales/en.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 989c09ae..286847d9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1427,7 +1427,7 @@ en: create: notice: New stock article %{name} was created. destroy: - notice: Article »%{name}« was deleted. + notice: Article %{name} was deleted. edit: title: Edit stock articles form: @@ -1454,9 +1454,9 @@ en: reason: Reason stock_changes: Stock quantity changes stock_article: - confirm_delete: Are you sure you want to delete the stock article »%{name}«? + confirm_delete: Are you sure you want to delete the stock article %{name}? update: - notice: Stock article »%{name}« was saved. + notice: Stock article %{name} was saved. suppliers: create: notice: Supplier was created From 012327dd7c588fc6395eb76e76765f422fcb386e Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 16:57:53 +0100 Subject: [PATCH 35/68] Slightly cleanup delivery form --- app/views/deliveries/_stock_article_for_adding.html.haml | 6 ++++-- app/views/deliveries/form_on_stock_article_update.js.erb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/deliveries/_stock_article_for_adding.html.haml b/app/views/deliveries/_stock_article_for_adding.html.haml index 956d8379..8575c121 100644 --- a/app/views/deliveries/_stock_article_for_adding.html.haml +++ b/app/views/deliveries/_stock_article_for_adding.html.haml @@ -1,4 +1,7 @@ -- css_class = ( @delivery and @delivery.includes_article? article ) ? ( 'unavailable' ) : ( false ) +- disable_delivery_action = ( @delivery and @delivery.includes_article? article ) +- css_class = ( disable_delivery_action ) ? ( 'unavailable' ) : ( false ) +- deliver_button_disabled = ( disable_delivery_action ) ? ( 'disabled' ) : ( false ) + %tr{:id => "stock_article_#{article.id}", :class => css_class} %td= article.name %td{:data => {:toggle => :tooltip, :title => render(:partial => 'shared/article_price_info', :locals => {:article => article})}}= number_to_currency article.price @@ -7,5 +10,4 @@ %td = link_to t('.action_edit'), edit_stock_article_path(article), remote: true, class: 'btn btn-mini' = link_to t('.action_other_price'), stock_article_copy_path(article), remote: true, class: 'btn btn-mini' - - deliver_button_disabled = ( @delivery and @delivery.includes_article? article ) ? ( 'disabled' ) : ( false ) = link_to t('.action_add_to_delivery'), add_stock_change_supplier_deliveries_path(@supplier, :stock_article_id => article.id), :method => :post, remote: true, class: 'button-add-stock-change btn btn-mini btn-primary', disabled: deliver_button_disabled diff --git a/app/views/deliveries/form_on_stock_article_update.js.erb b/app/views/deliveries/form_on_stock_article_update.js.erb index a993ab8d..a5a90d94 100644 --- a/app/views/deliveries/form_on_stock_article_update.js.erb +++ b/app/views/deliveries/form_on_stock_article_update.js.erb @@ -6,7 +6,7 @@ $('#stock_articles_for_adding tr').removeClass('success'); var stock_article_for_adding = $( - '<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article, :delivery => @delivery})) %>' + '<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>' ).addClass('success'); $('#stock_article_<%= @stock_article.id %>').replaceWith(stock_article_for_adding); From cdb87a838986b50c69a330ac6d87ee81007ee4b2 Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 17:10:40 +0100 Subject: [PATCH 36/68] Highlight created/updated stock_article in StockArticle#index view --- app/assets/stylesheets/bootstrap_and_overrides.css.less | 4 ++++ app/views/stockit/_stock_article.html.haml | 2 +- app/views/stockit/index_on_stock_article_create.js.erb | 4 +++- app/views/stockit/index_on_stock_article_update.js.erb | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 42fde3d5..06360aa2 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -104,6 +104,10 @@ table { td.odd { background-color: @tableBackgroundAccent; } + + td.main_info { + font-weight: bold; + } tr.selected td { background-color: @successBackground; diff --git a/app/views/stockit/_stock_article.html.haml b/app/views/stockit/_stock_article.html.haml index 3a76083c..72d4c510 100644 --- a/app/views/stockit/_stock_article.html.haml +++ b/app/views/stockit/_stock_article.html.haml @@ -2,7 +2,7 @@ %td= link_to stock_article.name, stock_article %td= stock_article.quantity %td= stock_article.quantity_ordered - %th= stock_article.quantity_available + %td.main_info= stock_article.quantity_available %td= stock_article.unit %td= stock_article.price %td= number_to_percentage stock_article.tax diff --git a/app/views/stockit/index_on_stock_article_create.js.erb b/app/views/stockit/index_on_stock_article_create.js.erb index eb48001b..14a3bc90 100644 --- a/app/views/stockit/index_on_stock_article_create.js.erb +++ b/app/views/stockit/index_on_stock_article_create.js.erb @@ -1,12 +1,14 @@ // Handle more advanced DOM update after AJAX database manipulation. // See publish/subscribe design pattern in /doc. (function() { + $('#articles-tbody tr').removeClass('success'); + var stock_article_row = $('<%= j(render( :partial => 'stock_article', :locals => { :stock_article => @stock_article } - )) %>'); + )) %>').addClass('success'); $('#articles-tbody').prepend(stock_article_row); })(); diff --git a/app/views/stockit/index_on_stock_article_update.js.erb b/app/views/stockit/index_on_stock_article_update.js.erb index 6e43db8e..f2f644ba 100644 --- a/app/views/stockit/index_on_stock_article_update.js.erb +++ b/app/views/stockit/index_on_stock_article_update.js.erb @@ -1,12 +1,14 @@ // Handle more advanced DOM update after AJAX database manipulation. // See publish/subscribe design pattern in /doc. (function() { + $('#articles-tbody tr').removeClass('success'); + var stock_article_row = $('<%= j(render( :partial => 'stock_article', :locals => { :stock_article => @stock_article } - )) %>'); + )) %>').addClass('success'); $('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row); })(); From 0f141cb709b83ad54eed0b4d2956b844993255e6 Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 17:14:30 +0100 Subject: [PATCH 37/68] Try to fix markdown formating issue in publish_subscribe.md --- doc/design_patterns/publish_subscribe.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/design_patterns/publish_subscribe.md b/doc/design_patterns/publish_subscribe.md index d261d45a..6d7d9696 100644 --- a/doc/design_patterns/publish_subscribe.md +++ b/doc/design_patterns/publish_subscribe.md @@ -9,12 +9,15 @@ The process can be divided in two steps: **1.** AJAX database manipulation and * 1. Example: current view `deliveries/_form` offers a link for the AJAX action `StockArticle#new`. This opens a modal filled with `stock_articles/_form`. 2. AJAX form post addresses the `StockArticle#create` action which handles the database manipulation. 3. The database manipulation is finished by the rendering of, e.g., `stock_articles/create.js.erb`. The key task there is to **publish** the database changes by calling `trigger`, i.e., + $(document).trigger({ type: 'StockArticle#create', stock_article_id: <%= @stock_article.id %> }); + 2. DOM updates for the particular view 1. Each view has the opportunity to **subscribe** to particular events of the previous step. A very simple example is the update of the `stock_articles/index` view after `StockArticle#destroy`: + $(document).on('StockArticle#destroy', function(e) { $('#stockArticle-' + e.stock_article_id).remove(); }); @@ -22,6 +25,7 @@ The process can be divided in two steps: **1.** AJAX database manipulation and * However, in most of the situations you will like to use the full power of the MVC framework in order to read new data from the database and render some partial. Let us consider this slightly more advanced case in the following. The view `stock_articles/index` could listen (amongst others) to `StockArticle#create` like this: + $(document).on('StockArticle#create', function(e) { $.ajax({ url: '#{index_on_stock_article_create_stock_articles_path}', @@ -30,4 +34,5 @@ The process can be divided in two steps: **1.** AJAX database manipulation and * contentType: 'application/json; charset=UTF-8' }); }); + 2. The action `StockArticles#index_on_stock_article_create` is a special helper action to handle DOM updates of the `stock_articles/index` view after the creation of a new `StockArticle` with the given `id`. From 38cbd47a2fca53d415046b71179b43d2ab8a867f Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 17:27:45 +0100 Subject: [PATCH 38/68] Fix markdown formating issue in publish_subscribe.md --- doc/design_patterns/publish_subscribe.md | 34 +++++++++++++----------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/doc/design_patterns/publish_subscribe.md b/doc/design_patterns/publish_subscribe.md index 6d7d9696..7c9884ad 100644 --- a/doc/design_patterns/publish_subscribe.md +++ b/doc/design_patterns/publish_subscribe.md @@ -5,27 +5,29 @@ As an example, let us consider the manipulation (create, update...) of `StockArt The process can be divided in two steps: **1.** AJAX database manipulation and **2.** DOM updates for the particular view. The crucial point is the coupling of the two steps since the controller for the first step offers the same functionality to all views and does not need to know anything about the current view. -1. AJAX database manipulation - 1. Example: current view `deliveries/_form` offers a link for the AJAX action `StockArticle#new`. This opens a modal filled with `stock_articles/_form`. - 2. AJAX form post addresses the `StockArticle#create` action which handles the database manipulation. - 3. The database manipulation is finished by the rendering of, e.g., `stock_articles/create.js.erb`. The key task there is to **publish** the database changes by calling `trigger`, i.e., - +### 1. AJAX database manipulation +**(i)** Example: current view `deliveries/_form` offers a link for the AJAX action `StockArticle#new`. This opens a modal filled with `stock_articles/_form`. + +**(ii)** AJAX form post addresses the `StockArticle#create` action which handles the database manipulation. + +**(iii)** The database manipulation is finished by the rendering of, e.g., `stock_articles/create.js.erb`. The key task there is to **publish** the database changes by calling `trigger`, i.e., + $(document).trigger({ type: 'StockArticle#create', stock_article_id: <%= @stock_article.id %> }); - -2. DOM updates for the particular view - 1. Each view has the opportunity to **subscribe** to particular events of the previous step. A very simple example is the update of the `stock_articles/index` view after `StockArticle#destroy`: - + +### 2. DOM updates for the particular view +**(i)** Each view has the opportunity to **subscribe** to particular events of the previous step. A very simple example is the update of the `stock_articles/index` view after `StockArticle#destroy`: + $(document).on('StockArticle#destroy', function(e) { $('#stockArticle-' + e.stock_article_id).remove(); }); - - However, in most of the situations you will like to use the full power of the MVC framework in order to read new data from the database and render some partial. Let us consider this slightly more advanced case in the following. - - The view `stock_articles/index` could listen (amongst others) to `StockArticle#create` like this: - + +However, in most of the situations you will like to use the full power of the MVC framework in order to read new data from the database and render some partial. Let us consider this slightly more advanced case in the following. + +The view `stock_articles/index` could listen (amongst others) to `StockArticle#create` like this: + $(document).on('StockArticle#create', function(e) { $.ajax({ url: '#{index_on_stock_article_create_stock_articles_path}', @@ -34,5 +36,5 @@ The process can be divided in two steps: **1.** AJAX database manipulation and * contentType: 'application/json; charset=UTF-8' }); }); - - 2. The action `StockArticles#index_on_stock_article_create` is a special helper action to handle DOM updates of the `stock_articles/index` view after the creation of a new `StockArticle` with the given `id`. + +**(ii)** The action `StockArticles#index_on_stock_article_create` is a special helper action to handle DOM updates of the `stock_articles/index` view after the creation of a new `StockArticle` with the given `id`. From 047a3f63c1d8adcd212263d6bace54812c692a06 Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 17:29:44 +0100 Subject: [PATCH 39/68] Finally fix markdown formating issue in publish_subscribe.md --- doc/design_patterns/publish_subscribe.md | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/design_patterns/publish_subscribe.md b/doc/design_patterns/publish_subscribe.md index 7c9884ad..eef6fa1d 100644 --- a/doc/design_patterns/publish_subscribe.md +++ b/doc/design_patterns/publish_subscribe.md @@ -12,29 +12,29 @@ The process can be divided in two steps: **1.** AJAX database manipulation and * **(iii)** The database manipulation is finished by the rendering of, e.g., `stock_articles/create.js.erb`. The key task there is to **publish** the database changes by calling `trigger`, i.e., - $(document).trigger({ - type: 'StockArticle#create', - stock_article_id: <%= @stock_article.id %> - }); + $(document).trigger({ + type: 'StockArticle#create', + stock_article_id: <%= @stock_article.id %> + }); ### 2. DOM updates for the particular view **(i)** Each view has the opportunity to **subscribe** to particular events of the previous step. A very simple example is the update of the `stock_articles/index` view after `StockArticle#destroy`: - $(document).on('StockArticle#destroy', function(e) { - $('#stockArticle-' + e.stock_article_id).remove(); - }); + $(document).on('StockArticle#destroy', function(e) { + $('#stockArticle-' + e.stock_article_id).remove(); + }); However, in most of the situations you will like to use the full power of the MVC framework in order to read new data from the database and render some partial. Let us consider this slightly more advanced case in the following. The view `stock_articles/index` could listen (amongst others) to `StockArticle#create` like this: - $(document).on('StockArticle#create', function(e) { - $.ajax({ - url: '#{index_on_stock_article_create_stock_articles_path}', - type: 'get', - data: {id: e.stock_article_id}, - contentType: 'application/json; charset=UTF-8' - }); - }); + $(document).on('StockArticle#create', function(e) { + $.ajax({ + url: '#{index_on_stock_article_create_stock_articles_path}', + type: 'get', + data: {id: e.stock_article_id}, + contentType: 'application/json; charset=UTF-8' + }); + }); **(ii)** The action `StockArticles#index_on_stock_article_create` is a special helper action to handle DOM updates of the `stock_articles/index` view after the creation of a new `StockArticle` with the given `id`. From 7a673b1a8b99d6229015795a051e051dc09126d4 Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 17:48:04 +0100 Subject: [PATCH 40/68] Move stock_article locales from delivery to stock_article --- config/locales/de.yml | 15 +++++---------- config/locales/en.yml | 7 +------ config/locales/fr.yml | 15 +++++---------- config/locales/nl.yml | 15 +++++---------- 4 files changed, 16 insertions(+), 36 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index d2ca5be0..93a1bc7f 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -405,8 +405,6 @@ de: how_many_units: Wie viele Einheiten (%{unit}) des Artikels »%{name}« liefern? create: notice: Lieferung wurde erstellt. Bitte nicht vergessen die Rechnung anzulegen! - create_stock_article: - notice: Neuer Lagerartikel »%{name}« gespeichert. destroy: notice: Lieferung wurde gelöscht. edit: @@ -446,15 +444,11 @@ de: action_add_to_delivery: Liefern action_edit: Bearbeiten action_other_price: Kopieren - stock_article_form: - copy_stock_article: Lagerartikel kopieren stock_change_fields: remove_article: Artikel aus Lieferung entfernen suppliers_overview: Lieferantenübersicht update: notice: Lieferung wurde aktualisiert. - update_stock_article: - notice: Lagerartikel »%{name}« aktualisiert. documents: order_by_articles: filename: Bestellung %{name}-%{date} - Artikelsortierung @@ -1420,11 +1414,14 @@ de: stockit: check: not_empty: ! '%{name} kann nicht gelöscht werden. Der Lagerbestand ist nicht null.' + create: + notice: Neuer Lagerartikel »%{name}« gespeichert. destroy: notice: Artikel %{name} gelöscht. edit: title: Lagerartikel bearbeiten form: + copy_stock_article: Lagerartikel kopieren price_hint: Um Chaos zu vermeiden können bis auf weiteres die Preise von angelegten Lagerartikeln nicht mehr verändert werden. index: confirm_delete: Bist Du sicher? @@ -1447,10 +1444,8 @@ de: new_quantity: Neuer Bestand reason: Ereignis stock_changes: Verlauf des Lagerbestands - stock_create: - notice: Lagerartikel wurde gespeichert. - stock_update: - notice: Lagerartikel wurde gespeichert. + update_stock_article: + notice: Lagerartikel »%{name}« aktualisiert. suppliers: create: notice: Lieferant wurde erstellt diff --git a/config/locales/en.yml b/config/locales/en.yml index 286847d9..e95ae192 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -407,8 +407,6 @@ en: how_many_units: ! 'How many units (%{unit}) to deliver? Stock article name: %{name}.' create: notice: Delivery was created. Please don’t forget to create invoice! - create_stock_article: - notice: The new stock article "%{name}" was saved. destroy: notice: Delivery was deleted. edit: @@ -448,15 +446,11 @@ en: action_add_to_delivery: Add to delivery action_edit: Edit action_other_price: Copy - stock_article_form: - copy_stock_article: Copy stock article stock_change_fields: remove_article: Remove article from delivery suppliers_overview: Supplier overview update: notice: Delivery was updated. - update_stock_article: - notice: The stock article "%{name}" was updated. documents: order_by_articles: filename: Order %{name}-%{date} - by articles @@ -1431,6 +1425,7 @@ en: edit: title: Edit stock articles form: + copy_stock_article: copy stock article price_hint: To avoid choas, it is not possible to edit the prices of already added stock articles until further notice. index: confirm_delete: Are you sure you want to delete? diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5b947f08..1a62008a 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -411,8 +411,6 @@ fr: how_many_units: Combien d unités (%{unit}) de l article %{name} doivent-elles être livrées? create: notice: Le réapprovisionnement a bien a été défini. Attention à ne pas oublier de déposer la facture correspondante! - create_stock_article: - notice: L'article "%{name}" a été ajouté au stock. destroy: notice: Le réapprovisionnement a été annulé. edit: @@ -452,15 +450,11 @@ fr: action_add_to_delivery: Commander action_edit: Modifier action_other_price: Copier - stock_article_form: - copy_stock_article: Copier l'article stock_change_fields: remove_article: Retirer l'article de cette commande suppliers_overview: Liste des fournisseusEs_rs update: notice: La commande a été actualisée - update_stock_article: - notice: Les données de l'article "%{name}" ont été mises à jour. documents: order_by_articles: filename: Commande %{name}-%{date} - Trier par @@ -1429,11 +1423,14 @@ fr: stockit: check: not_empty: ! '%{name} ne peut pas être supprimé, car il y en a encore en stock.' + create: + notice: L'article "%{name}" a été ajouté au stock. destroy: notice: L'article %{name} a bien été supprimé du stock. edit: title: Modifier l'article form: + copy_stock_article: Copier l'article price_hint: Pour éviter que ça soit le bazar, les prix des articles en stock ne peuvent plus être modifiés. index: confirm_delete: T'es sûrE de ton coup? @@ -1456,10 +1453,8 @@ fr: new_quantity: Nouveau stock reason: Raison stock_changes: Afficher l'historique - stock_create: - notice: L'article a été sauvegardé. - stock_update: - notice: L'article a été sauvegardé. + update: + notice: Les données de l'article "%{name}" ont été mises à jour. suppliers: create: notice: FournisseusE_r misE à jour diff --git a/config/locales/nl.yml b/config/locales/nl.yml index f907d54c..0d768c9d 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -407,8 +407,6 @@ nl: how_many_units: ! 'Hoeveel eenheden (%{unit}) leveren? Voorraadartikel: %{name}.' create: notice: Levering is aangemaakt. Vergeet niet een factuur te maken! - create_stock_article: - notice: Nieuw voorraadsartikel "%{name}" gemaakt. destroy: notice: Levering is verwijdered. edit: @@ -448,15 +446,11 @@ nl: action_add_to_delivery: Voeg toe aan levering action_edit: Bewerk action_other_price: Kopieer - stock_article_form: - copy_stock_article: kopieer het voorraadartikel stock_change_fields: remove_article: Artikel uit levering halen suppliers_overview: Leverancieroverzicht update: notice: Levering is bijgewerkt. - update_stock_article: - notice: Voorraadartikel "%{name}" is bijgewerkt. documents: order_by_articles: filename: Bestelling %{name}-%{date} - Artikellijst @@ -1404,11 +1398,14 @@ nl: stockit: check: not_empty: ! '%{name} kon niet worden verwijderd, de inventaris is niet leeg.' + create: + notice: Nieuw voorraadsartikel "%{name}" gemaakt. destroy: notice: Artikel %{name} is verwijdered. edit: title: Voorraadartikelen bewerken form: + copy_stock_article: kopieer het voorraadartikel price_hint: Om chaos te voorkomen, kun je de prijs van bestaande voorraadartikelen niet aanpassen. index: confirm_delete: Weet je zeker dat je dit wilt verwijderen? @@ -1431,10 +1428,8 @@ nl: new_quantity: Nieuw aantal reason: Reden stock_changes: Verloop - stock_create: - notice: Voorraadsartikel is opgeslagen. - stock_update: - notice: Voorraadsartikel is bijgewerkt. + update: + notice: Voorraadartikel "%{name}" is bijgewerkt. suppliers: create: notice: Leverancier is aangemaakt. From 7eb64e3c9d8ebef7ebcb86155be66e9c1110164b Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 7 Dec 2013 17:58:06 +0100 Subject: [PATCH 41/68] Update locales --- config/locales/de.yml | 4 +++- config/locales/en.yml | 2 ++ config/locales/fr.yml | 2 ++ config/locales/nl.yml | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 93a1bc7f..2e5e11a3 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1414,6 +1414,8 @@ de: stockit: check: not_empty: ! '%{name} kann nicht gelöscht werden. Der Lagerbestand ist nicht null.' + copy: + title: Lagerartikel kopieren create: notice: Neuer Lagerartikel »%{name}« gespeichert. destroy: @@ -1444,7 +1446,7 @@ de: new_quantity: Neuer Bestand reason: Ereignis stock_changes: Verlauf des Lagerbestands - update_stock_article: + update: notice: Lagerartikel »%{name}« aktualisiert. suppliers: create: diff --git a/config/locales/en.yml b/config/locales/en.yml index e95ae192..9d7849f6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1418,6 +1418,8 @@ en: stockit: check: not_empty: ! '%{name} could not be deleted, the inventory is not zero.' + copy: + title: Copy stock article create: notice: New stock article %{name} was created. destroy: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 1a62008a..17a6410b 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1423,6 +1423,8 @@ fr: stockit: check: not_empty: ! '%{name} ne peut pas être supprimé, car il y en a encore en stock.' + copy: + title: create: notice: L'article "%{name}" a été ajouté au stock. destroy: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 0d768c9d..a1a70c25 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -1398,6 +1398,8 @@ nl: stockit: check: not_empty: ! '%{name} kon niet worden verwijderd, de inventaris is niet leeg.' + copy: + title: create: notice: Nieuw voorraadsartikel "%{name}" gemaakt. destroy: From 30b35cdd110fba80242cdea9d3b5c43f1804a462 Mon Sep 17 00:00:00 2001 From: Julius Date: Mon, 9 Dec 2013 00:03:07 +0100 Subject: [PATCH 42/68] Improve usability of supplier selection for stock_articles in delivery form --- app/views/deliveries/_form.html.haml | 2 +- .../form_on_stock_article_create.js.erb | 23 +++++++++++-- .../form_on_stock_article_update.js.erb | 33 +++++++++++++++---- config/locales/de.yml | 1 + config/locales/en.yml | 1 + 5 files changed, 50 insertions(+), 10 deletions(-) diff --git a/app/views/deliveries/_form.html.haml b/app/views/deliveries/_form.html.haml index 533f44c3..a0f1594a 100644 --- a/app/views/deliveries/_form.html.haml +++ b/app/views/deliveries/_form.html.haml @@ -44,7 +44,7 @@ $.ajax({ url: '#{new_stock_article_path}', type: 'get', - data: {stock_article: {name: selectedArticle.text}}, + data: {stock_article: {name: selectedArticle.text, supplier_id: #{@supplier.id}}}, contentType: 'application/json; charset=UTF-8' }); $('#new_stock_article').select2('data', null); diff --git a/app/views/deliveries/form_on_stock_article_create.js.erb b/app/views/deliveries/form_on_stock_article_create.js.erb index 25360761..fd1b2d0f 100644 --- a/app/views/deliveries/form_on_stock_article_create.js.erb +++ b/app/views/deliveries/form_on_stock_article_create.js.erb @@ -1,12 +1,31 @@ // Handle more advanced DOM update after AJAX database manipulation. // See publish/subscribe design pattern in /doc. -(function() { +(function(w) { + $('#stock_articles_for_adding tr').removeClass('success'); + if(<%= @supplier.id != @stock_article.supplier.id %>) { + // the stock_article does _NOT_ belong to the current supplier + var try_again = w.confirm('<%= j( + t('deliveries.form.confirm_foreign_supplier_reedit', :name => @stock_article.name) + ) %>'); + + if(try_again) { + $.ajax({ + url: '<%= j edit_stock_article_path(@stock_article) %>', + type: 'get', + contentType: 'application/json; charset=UTF-8' + }); + } + + return false; + } + + // the stock_article _DOES_ belong to the current supplier var stock_article_for_adding = $( '<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>' ).addClass('success'); $('#stock_articles_for_adding tbody').append(stock_article_for_adding); updateSort('#stock_articles_for_adding'); -})(); +})(window); diff --git a/app/views/deliveries/form_on_stock_article_update.js.erb b/app/views/deliveries/form_on_stock_article_update.js.erb index a5a90d94..3d78eb0d 100644 --- a/app/views/deliveries/form_on_stock_article_update.js.erb +++ b/app/views/deliveries/form_on_stock_article_update.js.erb @@ -1,16 +1,35 @@ // Handle more advanced DOM update after AJAX database manipulation. // See publish/subscribe design pattern in /doc. -(function() { +(function(w) { // update entry in stock_article table $('#stock_articles_for_adding tr').removeClass('success'); - var stock_article_for_adding = $( - '<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>' - ).addClass('success'); + $('#stock_article_<%= @stock_article.id %>').remove(); - $('#stock_article_<%= @stock_article.id %>').replaceWith(stock_article_for_adding); - updateSort('#stock_articles_for_adding'); + if(<%= @supplier.id != @stock_article.supplier.id %>) { + // the stock_article does _NOT_ belong to the current supplier + var try_again = w.confirm('<%= j( + t('deliveries.form.confirm_foreign_supplier_reedit', :name => @stock_article.name) + ) %>'); + + if(try_again) { + $.ajax({ + url: '<%= j edit_stock_article_path(@stock_article) %>', + type: 'get', + contentType: 'application/json; charset=UTF-8' + }); + } + } + else { + // the stock_article _DOES_ belong to the current supplier + var stock_article_for_adding = $( + '<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>' + ).addClass('success'); + + $('#stock_articles_for_adding tbody').append(stock_article_for_adding); + updateSort('#stock_articles_for_adding'); + } mark_article_for_delivery(<%= @stock_article.id %>); @@ -25,4 +44,4 @@ stock_change_entry.addClass('success'); updateSort('#stock_changes'); -})(); +})(window); diff --git a/config/locales/de.yml b/config/locales/de.yml index 2e5e11a3..d33f5266 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -413,6 +413,7 @@ de: actions: Optionen article: Artikel category: Kategorie + confirm_foreign_supplier_reedit: Der Lagerartikel »%{name}« wurde erfolgreich gespeichert. Er gehört jedoch nicht zu dem Lieferanten dieser Lieferung. Möchtest Du diesen Lagerartikel erneut bearbeiten? create_from_blank: Ohne Vorlage anlegen create_stock_article: Lagerartikel anlegen price: Nettopreis diff --git a/config/locales/en.yml b/config/locales/en.yml index 9d7849f6..bf0127b5 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -415,6 +415,7 @@ en: actions: Tasks article: Article category: Category + confirm_foreign_supplier_reedit: The stock article %{name} was successfully saved. However, it belongs to a different supplier than this delivery. Would you like to edit the stock article again? create_from_blank: Create new article create_stock_article: Create stock article price: Netprice From 58de1a231b67fb37706061f5d5afbf150ac1f5c5 Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 10 Dec 2013 13:30:15 +0100 Subject: [PATCH 43/68] update price during editing as well --- app/views/articles/_form.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index 2ffd3f0a..a5c04bc8 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -46,12 +46,12 @@ :javascript var form = $('form.edit_article, form.new_article'); - $('#article_price, #article_tax, #article_deposit', form).on('change', function() { + $('#article_price, #article_tax, #article_deposit', form).on('change keyup', function() { var price = parseFloat($('#article_price', form).val()); var tax = parseFloat($('#article_tax', form).val()); var deposit = parseFloat($('#article_deposit', form).val()); // 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(I18n.l("currency", fc_price)); + $('#fc_price').html($.isNumeric(fc_price) ? I18n.l("currency", fc_price) : '…'); }); From 85b6ff908b7e8ad9288731b47a9a31792b40525b Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 10 Dec 2013 16:41:26 +0100 Subject: [PATCH 44/68] make new article dialog more responsive --- .../bootstrap_and_overrides.css.less | 29 +++++++++++---- app/views/articles/_form.html.haml | 35 +++++++++---------- config/locales/en.yml | 2 +- 3 files changed, 41 insertions(+), 25 deletions(-) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index c3e0a875..130ef9da 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -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; +} + diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index a5c04bc8..3fcb4e9b 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -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) : '…'); }); diff --git a/config/locales/en.yml b/config/locales/en.yml index a48acd92..c53539bb 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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 doesn’t show in Foodsoft mail inbox order_article: From da737793e8782a618bec699cdd4de8c9c925d08a Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 10 Dec 2013 16:48:39 +0100 Subject: [PATCH 45/68] workaround help block margin issue [ci skip] --- app/assets/stylesheets/bootstrap_and_overrides.css.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 130ef9da..07553a8b 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -262,7 +262,8 @@ tr.unavailable { // fix margin somehow off // XXX there must be a better way margin-bottom: 0; - .controls p { + .help-block { + margin-top: 0; margin-bottom: 20px; } } From e42e27957d50d0fd93bc3caa9d9da3042362c14c Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 10 Dec 2013 17:58:32 +0100 Subject: [PATCH 46/68] improve task i18n (affects foodcoops#137) --- app/helpers/tasks_helper.rb | 4 ++++ app/views/tasks/_archive_tasks.html.haml | 8 ++++---- app/views/tasks/_list.haml | 6 +++--- app/views/tasks/show.haml | 12 ++++++------ config/locales/en.yml | 9 +-------- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/app/helpers/tasks_helper.rb b/app/helpers/tasks_helper.rb index f2a9bea5..e9db9e22 100644 --- a/app/helpers/tasks_helper.rb +++ b/app/helpers/tasks_helper.rb @@ -13,4 +13,8 @@ module TasksHelper title: I18n.t('helpers.tasks.required_users', :count => task.still_required_users) end end + + def task_title(task) + I18n.t('helpers.tasks.task_title', name: task.name, duration: task.duration) + end end diff --git a/app/views/tasks/_archive_tasks.html.haml b/app/views/tasks/_archive_tasks.html.haml index 9ece4d05..95f6fd4a 100644 --- a/app/views/tasks/_archive_tasks.html.haml +++ b/app/views/tasks/_archive_tasks.html.haml @@ -5,13 +5,13 @@ %table.table.table-striped %thead %tr - %th= t '.due_date' - %th= t '.task' - %th= t '.who' + %th= heading_helper Task, :due_date + %th= heading_helper Task, :name + %th= heading_helper Task, :user_list %th %tbody - @tasks.each do |task| %tr %td= task.due_date unless task.due_date.nil? - %td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task) + %td= link_to task_title(task), task_path(task) %td= task_assignments task diff --git a/app/views/tasks/_list.haml b/app/views/tasks/_list.haml index da91cec8..f3b191ee 100644 --- a/app/views/tasks/_list.haml +++ b/app/views/tasks/_list.haml @@ -1,9 +1,9 @@ %table.table.table-striped %thead %tr - %th= t '.due_date' + %th= heading_helper Task, :due_date %th - %th= t '.task' + %th= heading_helper Task, :name %th{:colspan => '2'} = t '.who' %small= t '.who_hint' @@ -15,7 +15,7 @@ %td - if task.periodic? %i.icon-repeat{title: t('tasks.repeated')} - %td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task) + %td= link_to task_title(task), task_path(task) %td = task_assignments task = highlighted_required_users task diff --git a/app/views/tasks/show.haml b/app/views/tasks/show.haml index 86de92bf..fd3805ba 100644 --- a/app/views/tasks/show.haml +++ b/app/views/tasks/show.haml @@ -3,22 +3,22 @@ %section %dl.dl-horizontal - %dt= Task.human_attribute_name(:name) + %dt= heading_helper Task, :name %dd= @task.name - if @task.description.present? - %dt= Task.human_attribute_name(:description) + %dt= heading_helper Task, :description %dd= simple_format(@task.description) - if @task.due_date.present? - %dt= Task.human_attribute_name(:due_date) + %dt= heading_helper Task, :due_date %dd = format_date(@task.due_date) - if @task.periodic? %i.icon-repeat{title: t('tasks.repeated')} - %dt= Task.human_attribute_name(:duration) + %dt= heading_helper Task, :duration %dd= t('.hours', count: @task.duration) - %dt= Task.human_attribute_name(:user_list) + %dt= heading_helper Task, :user_list %dd= task_assignments(@task) - %dt= Task.human_attribute_name(:workgroup) + %dt= heading_helper Task, :workgroup %dd - if @task.workgroup = link_to @task.workgroup.name, workgroup_tasks_path(workgroup_id: @task.workgroup_id) diff --git a/config/locales/en.yml b/config/locales/en.yml index 13c5299c..83100dd8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -802,6 +802,7 @@ en: message: create: send message tasks: + task_title: ! '%{name} (%{duration}h)' required_users: ! '%{count} members are still needed!' home: apple_bar: @@ -1491,11 +1492,6 @@ en: notice: You have accepted the task archive: title: Task archive - archive_tasks: - due_date: Due date - task: Subject - task_format: ! '%{name} (%{duration}h)' - who: People in charge create: notice: Task has been created destroy: @@ -1519,11 +1515,8 @@ en: accept_task: Accept task done: Done done_q: Done? - due_date: Due date mark_done: Mark task as done reject_task: Reject task - task: subject - task_format: ! '%{name} (%{duration}h)' who: Who is doing it? who_hint: (How much are still needed?) nav: From 6bbc614e42a89cb19de35e75b47ed0dcefa760d5 Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 10 Dec 2013 18:03:50 +0100 Subject: [PATCH 47/68] localeapp roundtrip (closes foodcoops#156) --- config/locales/de.yml | 13 ++--- config/locales/en.yml | 6 +-- config/locales/fr.yml | 11 +---- config/locales/nl.yml | 109 ++++++++++++++++++++---------------------- 4 files changed, 59 insertions(+), 80 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 67285827..0d1466a3 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -124,9 +124,9 @@ de: done: Erledigt? due_date: Wann erledigen? duration: Dauer - name: Name + name: required_users: Anzahl - user_list: Verantwortliche + user_list: Verantwortlichen workgroup: Arbeitsgruppe user: email: Email @@ -799,6 +799,7 @@ de: create: Nachricht verschicken tasks: required_users: Es fehlen %{count} Mitstreiterinnen! + task_title: ! '%{name} (%{duration}h)' home: apple_bar: desc: ! 'Abgebildet ist das Verhältnis von erledigten Aufgaben zu dem Bestellvolumen Deiner Bestellgruppe im Vergleich zum Durchschnitt in der Foodcoop. Konkret: Pro %{amount} Bestellsumme solltest Du eine Aufgabe machen!' @@ -1487,11 +1488,6 @@ de: notice: Du hast die Aufgabe übernommen archive: title: Aufgabenarchiv - archive_tasks: - due_date: Fälligkeitsdatum - task: Betreff - task_format: ! '%{name} (%{duration}h)' - who: Verantwortliche Menschen create: notice: Aufgabe wurde erstellt destroy: @@ -1515,11 +1511,8 @@ de: accept_task: Aufgabe übernehmen done: Erledigt done_q: Erledigt? - due_date: Fälligkeit mark_done: Aufgabe als erledigt markieren reject_task: Aufgabe ablehnen - task: Betreff - task_format: ! '%{name} (%{duration}h)' who: Wer machts? who_hint: (Wie viele werden noch benötigt?) nav: diff --git a/config/locales/en.yml b/config/locales/en.yml index 83100dd8..2d80d0a7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -124,9 +124,9 @@ en: done: Done? due_date: Due date duration: Duration - name: Name + name: Activity required_users: People required - user_list: Responsible user + user_list: Responsible users workgroup: Workgroup user: email: Email @@ -802,8 +802,8 @@ en: message: create: send message tasks: - task_title: ! '%{name} (%{duration}h)' required_users: ! '%{count} members are still needed!' + task_title: ! '%{name} (%{duration}h)' home: apple_bar: desc: ! 'This shows the proportion of completed tasks to the volume of orders for your ordergroup in comparison to the average of the Foodcoop. In practice: for every %{amount} of total orders, you should execute a task!' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index bf07f516..d69b6bc8 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -124,7 +124,7 @@ fr: done: Fait? due_date: Echéance duration: Durée - name: Nom + name: required_users: Nombre de personnes nécessaires user_list: Responsables inscritEs workgroup: Équipe @@ -819,6 +819,7 @@ fr: create: Envoyer un message tasks: required_users: Il manque encore %{count} camarades! + task_title: ! '%{name} (%{duration}h)' home: apple_bar: desc: ! 'Ce système de glands sert à comparer la durée du travail collectif auquel ta cellule a contribué (rapportée à la quantité commandée) avec @@ -1500,11 +1501,6 @@ fr: notice: Tu as accepté ce boulot archive: title: Historique du boulot - archive_tasks: - due_date: Échéance - task: Sujet - task_format: ! '%{name} (%{duration}h)' - who: Personnes en charge create: notice: Le boulot a bien été défini. destroy: @@ -1532,11 +1528,8 @@ fr: accept_task: Te charger de ce boulot done: Effectué done_q: Effectué? - due_date: À faire pour le mark_done: Marquer ce boulot comme étant effectué reject_task: Refuser ce boulot - task: Description - task_format: ! '%{name} (%{duration}h)' who: Qui le fait? who_hint: (Combien manquent encore?) nav: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 9f34742f..0b5b2d08 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -124,8 +124,8 @@ nl: done: Gedaan? due_date: Voor wanneer? duration: Tijdsduur - name: Naam - required_users: Aantal + name: Activiteit + required_users: Aantal mensen user_list: Verantwoordelijken workgroup: Werkgroep user: @@ -208,7 +208,7 @@ nl: here: hier index: first_paragraph: Hier kun je %{url} toevoegen, bewerken en verwijderen. - new_ordergroup: Nieuw huishouden toevoegen + new_ordergroup: Nieuw huishouden new_ordergroups: nieuwe huishoudens second_paragraph: ! 'Bedenk het onderscheid tussen werkgroep en huishouden: een huishouden heeft een rekening en kan bestellen. in een %{url} (bijv. sorteergroep) werken leden samen om taken te vervullen. Leden kunnen slechts lid zijn van éen huishouden, maar van meerdere werkgroepen.' title: Huishoudens @@ -231,7 +231,7 @@ nl: title: Lid bewerken index: first_paragraph: Hier kun je gebruikers %{url}, bewerken en wissen. - new_user: Nieuwe gebruiker toevoegen + new_user: Nieuwe gebruiker new_users: toevoegen title: Gebruikers admin new: @@ -263,11 +263,11 @@ nl: here: hier index: first_paragraph: Hier kun je %{url} toevoegen, bewerken en wissen. - new_workgroup: Nieuwe werkgroep creëren + new_workgroup: Nieuwe werkgroep new_workgroups: nieuwe werkgroepen ordergroup: huishouden second_paragraph: ! 'Let op het verschil tussen een groep en een huishouden: een %{url} heeft een tegoed en kan bestellen. In een werkgroep (bijv. ''sorteergroep'') organizeren zich de leden met behulp van taken en berichten. Gebruikers kunnen slechts lid zijn van één huishouden, maar van meerdere werkgroepen.' - title: werkgroepen + title: Werkgroepen new: title: Werkgroep toevoegen show: @@ -803,6 +803,7 @@ nl: create: bericht versturen tasks: required_users: Nog %{count} leden nodig! + task_title: ! '%{name} (%{duration}u)' home: apple_bar: desc: ! 'Deze balk laat zien hoeveel taken je gedaan hebt per bestelhoeveelheid, vergeleken met het gemiddelde van de foodcoop. @@ -1108,7 +1109,7 @@ nl: title: Bestellingen tasks: Taken wiki: - all_pages: Alle Pagina's + all_pages: Alle pagina's home: Hoofdpagina title: Wiki workgroups: Werkgroepen @@ -1470,75 +1471,67 @@ nl: accept: notice: Je hebt de taak geaccepteerd archive: - title: - archive_tasks: - due_date: - task: - task_format: - who: + title: Takenarchief create: notice: Taak is aangemaakt destroy: notice: Taak is verwijderd edit: - title: - warning_periodic: - error_not_found: + title: Taak bewerken + warning_periodic: Opgelet: deze taak is onderdeel van een wekelijkse taak. Wanneer deze opslaat, zal de uitzondering als een normale taak worden opgeslagen. + error_not_found: Geen werkgroep gevonden form: search: hint: Gebruiker zoeken noresult: Geen gebruiker gevonden placeholder: Zoeken ... submit: - periodic: + periodic: Wekelijkse taak bewaren index: - show_group_tasks: - title: - title_non_group: + show_group_tasks: Groepstaken tonen + title: Taken + title_non_group: Taken voor iedereen! list: - accept_task: - done: - done_q: - due_date: - mark_done: - reject_task: - task: - task_format: - who: - who_hint: + accept_task: Taak accepteren + done: Gedaan + done_q: Gedaan? + mark_done: Taak als gedaan markeren + reject_task: Taak laten vallen + who: Wie doet het? + who_hint: (Hoeveel zijn er nog nodig?) nav: - all_tasks: - archive: - group_tasks: - my_tasks: - new_task: - pages: + all_tasks: Alle taken + archive: Gedane taken (archief) + group_tasks: Groepstaken + my_tasks: Mijn taken + new_task: Nieuwe taak + pages: Pagina's new: - title: - repeated: + title: Nieuwe taken maken + repeated: Taak wordt wekelijks herhaald set_done: notice: De status van de taak is aangepast show: - accept_task: - confirm_delete_group: - confirm_delete_single: - delete_group: - hours: - mark_done: - reject_task: - title: + accept_task: Accepteren + confirm_delete_group: Deze en alle volgende taken echt verwijderen? + confirm_delete_single: Weet je zeker dat je deze taak wilt verwijderen? + delete_group: Deze en volgende taken verwijderen + hours: ! '%{count}u' + mark_done: Als gedaan markeren + reject_task: Taak laten vallen + title: Taak bekijken update: notice: Taak is bijgewerkt notice_converted: Taak is bijgewerkt en omgezet naar een eenmalige taak. user: - more: - tasks_link: - title: - title_accepted: - title_open: + more: Niets voor jou? %{tasks_link} is vast wat te doen + tasks_link: Hier + title: Mijn taken + title_accepted: Aangenomen taken + title_open: Open taken workgroup: - title: - title_all: + title: Taken voor %{workgroup} + title_all: Alle groepstaken ui: close: Sluiten delete: Verwijder @@ -1552,11 +1545,11 @@ nl: show: Tonen views: pagination: - first: - last: - next: - previous: - truncate: + first: ! '«' + last: ! '»' + next: ! '›' + previous: ! '‹' + truncate: ! '...' workgroups: edit: title: Werkgroep bewerken From 675f0e6d16b0b9d5fca7ef04920fecf49aa5cec5 Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 10 Dec 2013 19:12:29 +0100 Subject: [PATCH 48/68] fix workgroup link task list --- app/views/tasks/index.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/tasks/index.haml b/app/views/tasks/index.haml index e8d7df44..044dc05c 100644 --- a/app/views/tasks/index.haml +++ b/app/views/tasks/index.haml @@ -13,6 +13,6 @@ %section %h3 = group.name - %small= link_to t('.show_group_tasks'), workgroup_tasks_path(group) + %small= link_to t('.show_group_tasks'), workgroup_tasks_path(workgroup_id: group) = render 'list', tasks: tasks = link_to_top From 3f497e9274f1f1fc99d9879627a7a954d7fa16bb Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 10 Dec 2013 23:41:45 +0100 Subject: [PATCH 49/68] allow more than two columns in horizontal form --- .../bootstrap_and_overrides.css.less | 18 ++++++++++++++---- app/views/articles/_form.html.haml | 5 +++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 07553a8b..8d03444d 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -248,17 +248,21 @@ tr.unavailable { margin: 0; } -// two-column layout in forms (landscape tablet and wider only) +// multiple-column layout in forms (landscape tablet and wider only) @media (min-width: 768px) { - .form-horizontal .twocol { - .control-group:nth-child(odd) { + .form-horizontal .fold-line { + .control-group { float: left; } - .control-group:nth-child(even) { + .control-group + .control-group { .control-label { width: auto; margin: 0 10px; } + .controls { + float: left; + margin-left: 0; + } // fix margin somehow off // XXX there must be a better way margin-bottom: 0; @@ -267,6 +271,12 @@ tr.unavailable { margin-bottom: 20px; } } + .control-group:last-child { + float: none; + .controls { + float: none; + } + } } } // allow to have indicator text instead of input with same markup diff --git a/app/views/articles/_form.html.haml b/app/views/articles/_form.html.haml index 3fcb4e9b..b63db423 100644 --- a/app/views/articles/_form.html.haml +++ b/app/views/articles/_form.html.haml @@ -7,7 +7,7 @@ .modal-body = f.input :availability = f.input :name - .twocol + .fold-line = 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, @@ -17,7 +17,7 @@ = f.association :article_category / TODO labels - .twocol + .fold-line = f.input :price do .input-prepend %span.add-on= t 'number.currency.format.unit' @@ -26,6 +26,7 @@ .input-append = f.input_field :tax, class: 'input-mini' %span.add-on % + .fold-line = f.input :deposit do .input-prepend %span.add-on= t 'number.currency.format.unit' From b53cb3671488a67cf8724abc8f77de5b302eeb9b Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 11 Dec 2013 22:58:45 +0100 Subject: [PATCH 50/68] give proper block to link_to_ordering (closes #201) --- app/helpers/group_orders_helper.rb | 16 ++++++++-------- app/views/shared/_open_orders.html.haml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/helpers/group_orders_helper.rb b/app/helpers/group_orders_helper.rb index 11434a83..bf490903 100644 --- a/app/helpers/group_orders_helper.rb +++ b/app/helpers/group_orders_helper.rb @@ -9,17 +9,17 @@ module GroupOrdersHelper # Returns a link to the page where a group_order can be edited. # If the option :show is true, the link is for showing the group_order. - def link_to_ordering(order, options = {}) + def link_to_ordering(order, options = {}, &block) group_order = order.group_order(current_user.ordergroup) path = if options[:show] and group_order - group_order_path(group_order) - elsif group_order - edit_group_order_path(group_order, :order_id => order.id) - else - new_group_order_path(:order_id => order.id) - end + group_order_path(group_order) + elsif group_order + edit_group_order_path(group_order, :order_id => order.id) + else + new_group_order_path(:order_id => order.id) + end options.delete(:show) - name = block_given? ? yield(order, group_order) : order.name + name = block_given? ? capture(&block) : order.name path ? link_to(name, path, options) : name end diff --git a/app/views/shared/_open_orders.html.haml b/app/views/shared/_open_orders.html.haml index 7a6f8591..eddc82ab 100644 --- a/app/views/shared/_open_orders.html.haml +++ b/app/views/shared/_open_orders.html.haml @@ -22,7 +22,7 @@ %td= "#{show_user group_order.updated_by} (#{format_time(group_order.updated_on)})" %td.numeric = link_to_ordering(order, show: true) do - - number_to_currency(group_order.price) + = number_to_currency(group_order.price) - else %td{:colspan => 2} - if total > 0 From d448707b1a5721397f21a7731825e9777fac8ee4 Mon Sep 17 00:00:00 2001 From: wvengen Date: Thu, 12 Dec 2013 00:13:19 +0100 Subject: [PATCH 51/68] i18n cleanup (affects foodcoops#137) --- .../admin/ordergroups/_ordergroups.html.haml | 10 +-- app/views/admin/users/_users.html.haml | 10 +-- app/views/admin/users/show.html.haml | 8 +-- .../admin/workgroups/_workgroups.html.haml | 2 +- app/views/deliveries/_form.html.haml | 18 ++--- app/views/deliveries/show.html.haml | 8 +-- .../_edit_results_by_articles.html.haml | 10 +-- .../balancing/_group_order_articles.html.haml | 2 +- .../balancing/_order_article.html.haml | 4 +- app/views/finance/index.html.haml | 20 +++--- .../finance/invoices/_invoices.html.haml | 2 +- .../ordergroups/_ordergroups.html.haml | 6 +- .../ordergroups/_ordergroups.html.haml | 6 +- .../shared/_articles_by_groups.html.haml | 4 +- app/views/shared/_group.html.haml | 8 +-- config/locales/en.yml | 70 ++----------------- 16 files changed, 64 insertions(+), 124 deletions(-) diff --git a/app/views/admin/ordergroups/_ordergroups.html.haml b/app/views/admin/ordergroups/_ordergroups.html.haml index 54618b6f..6670c05f 100644 --- a/app/views/admin/ordergroups/_ordergroups.html.haml +++ b/app/views/admin/ordergroups/_ordergroups.html.haml @@ -4,11 +4,11 @@ %table.table.table-striped %thead %tr - %th= t '.name' - %th= t '.contact' - %th= t '.address' - %th= t '.members' - %th= t 'admin.actions' + %th= heading_helper Ordergroup, :name + %th= heading_helper Ordergroup, :contact + %th= heading_helper Ordergroup, :contact_address + %th= heading_helper Ordergroup, :user_tokens + %th= t 'ui.actions' %tbody - for ordergroup in @ordergroups %tr{:class => cycle('even','odd', :name => 'groups')} diff --git a/app/views/admin/users/_users.html.haml b/app/views/admin/users/_users.html.haml index 5fd16bf5..95d39464 100644 --- a/app/views/admin/users/_users.html.haml +++ b/app/views/admin/users/_users.html.haml @@ -5,12 +5,12 @@ %thead %tr - if FoodsoftConfig[:use_nick] - %th= t '.login' - %th= t '.name' - %th= t '.email' + %th= heading_helper User, :nick + %th= heading_helper User, :name + %th= heading_helper User, :email %th= t 'admin.access_to' - %th= t '.last_login' - %th(colspan="2")= t 'admin.actions' + %th= heading_helper User, :last_login + %th(colspan="2")= t 'ui.actions' %tbody - for user in @users %tr diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 2321ccdb..21d03e0a 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -7,13 +7,13 @@ %p= t '.member_since', time: distance_of_time_in_words(Time.now, @user.created_on) %dl - if FoodsoftConfig[:use_nick] - %dt= t '.nick' + %dt= heading_helper User, :nick %dd= @user.nick - %dt= t '.name' + %dt= heading_helper User, :name %dd= h @user.name - %dt= t '.email' + %dt= heading_helper User, :email %dd= @user.email - %dt= t '.phone' + %dt= heading_helper User, :phone %dd= @user.phone %dt= t 'admin.access_to' %dd= format_roles(@user) diff --git a/app/views/admin/workgroups/_workgroups.html.haml b/app/views/admin/workgroups/_workgroups.html.haml index c7250e83..fd61b463 100644 --- a/app/views/admin/workgroups/_workgroups.html.haml +++ b/app/views/admin/workgroups/_workgroups.html.haml @@ -7,7 +7,7 @@ %th= t '.name' %th= t '.members' %th= t 'admin.access_to' - %th= t 'admin.actions' + %th= t 'ui.actions' %tbody - for workgroup in @workgroups %tr diff --git a/app/views/deliveries/_form.html.haml b/app/views/deliveries/_form.html.haml index 3e1a3b6c..9b4549fe 100644 --- a/app/views/deliveries/_form.html.haml +++ b/app/views/deliveries/_form.html.haml @@ -87,11 +87,11 @@ %table#stock_articles_for_adding.table.table-hover.stupidtable %thead %tr - %th.default-sort{:data => {:sort => 'string'}}= t '.article' - %th= t '.price' - %th= t '.unit' - %th= t '.category' - %th= t '.actions' + %th.default-sort{:data => {:sort => 'string'}}= Article.model_name.human + %th= heading_helper StockArticle, :price + %th= heading_helper StockArticle, :unit + %th= heading_helper StockArticle, :article_category + %th= t 'ui.actions' %tfoot %tr %th{:colspan => 5} @@ -108,10 +108,10 @@ %thead %tr %th.default-sort{:data => {:sort => 'string'}}= t '.article' - %th= t '.price' - %th= t '.unit' - %th= t '.quantity' - %th= t '.actions' + %th= heading_helper StockArticle, :price + %th= heading_helper StockArticle, :unit + %th= heading_helper StockChange, :quantity + %th= t 'ui.actions' %tbody = f.simple_fields_for :stock_changes do |stock_change_form| = render :partial => 'stock_change_fields', :locals => {:f => stock_change_form} diff --git a/app/views/deliveries/show.html.haml b/app/views/deliveries/show.html.haml index d5df7fd5..8f2cdeee 100644 --- a/app/views/deliveries/show.html.haml +++ b/app/views/deliveries/show.html.haml @@ -17,10 +17,10 @@ %table.table.table-striped(style="width:500px") %thead %tr - %th= t '.article' - %th= t '.unit' - %th.numeric= t '.amount' - %th.numeric= t '.price' + %th= Article.model_name.human + %th= heading_helper StockArticle, :unit + %th.numeric= heading_helper StockChange, :quantity + %th.numeric= heading_helper Article, :price %th.numeric= t '.sum' %tbody - total_net, total_gross = 0,0 diff --git a/app/views/finance/balancing/_edit_results_by_articles.html.haml b/app/views/finance/balancing/_edit_results_by_articles.html.haml index 0ab5e81e..ab77723e 100644 --- a/app/views/finance/balancing/_edit_results_by_articles.html.haml +++ b/app/views/finance/balancing/_edit_results_by_articles.html.haml @@ -1,14 +1,14 @@ %table.ordered-articles.table.table-striped %thead %tr - %th= sort_link_helper t('.article'), "name" - %th= sort_link_helper t('.number'), "order_number" + %th= sort_link_helper Article.model_name.human, "name" + %th= sort_link_helper Article.human_attribute_name(:order_number_short), "order_number" %th= t('.amount') - %th= t('.amount_per_unit') + %th= heading_helper Article, :units %th= t('.net') %th= t('.gross') - %th= t('.tax') - %th= t('.refund') + %th= heading_helper Article, :tax + %th= heading_helper Article, :deposit %th{:colspan => "2"} = link_to t('.add_article'), new_finance_order_order_article_path(@order), remote: true, class: 'btn btn-small' diff --git a/app/views/finance/balancing/_group_order_articles.html.haml b/app/views/finance/balancing/_group_order_articles.html.haml index 6689cd95..2658878b 100644 --- a/app/views/finance/balancing/_group_order_articles.html.haml +++ b/app/views/finance/balancing/_group_order_articles.html.haml @@ -3,7 +3,7 @@ %thead %tr %td - %td{:style => "width:8em"}= t('.group') + %td{:style => "width:8em"}= Ordergroup.model_name.human %td= t('.units') %td= t('.total') %td{:colspan => "3",:style => "width:14em"} diff --git a/app/views/finance/balancing/_order_article.html.haml b/app/views/finance/balancing/_order_article.html.haml index 8bc4e268..6512d0c4 100644 --- a/app/views/finance/balancing/_order_article.html.haml +++ b/app/views/finance/balancing/_order_article.html.haml @@ -5,7 +5,7 @@ = order_article.units_to_order - unless order_article.ordered_quantities_equal_to_group_orders? %span{:style => "color:red;font-weight: bold"} ! -%td= order_article.price.unit_quantity.to_s + ' * ' + order_article.article.unit.to_s +%td #{order_article.price.unit_quantity} × #{order_article.article.unit} %td = number_to_currency(order_article.price.price, :unit => "") :plain @@ -16,7 +16,7 @@ :plain / = number_to_currency(order_article.total_gross_price, :unit => "") -%td= order_article.price.tax +%td #{order_article.price.tax}% %td= order_article.price.deposit %td = link_to t('ui.edit'), edit_finance_order_order_article_path(order_article.order, order_article), remote: true, diff --git a/app/views/finance/index.html.haml b/app/views/finance/index.html.haml index 731528bd..e2d64811 100644 --- a/app/views/finance/index.html.haml +++ b/app/views/finance/index.html.haml @@ -8,9 +8,9 @@ %table.table.table-striped %thead %tr - %th= t('.date') - %th.numeric= t('.amount') - %th= t('.supplier') + %th= heading_helper Invoice, :date + %th.numeric= heading_helper Invoice, :amount + %th= heading_helper Invoice, :supplier %th %tbody - for invoice in @unpaid_invoices @@ -26,10 +26,10 @@ %table.table.table-striped %thead %tr - %th= t('.date') - %th= t('.group') - %th= t('.note') - %th.numeric= t('.amount') + %th= heading_helper FinancialTransaction, :created_on + %th= heading_helper FinancialTransaction, :ordergroup + %th= heading_helper FinancialTransaction, :note + %th.numeric= heading_helper FinancialTransaction, :amount %tbody - @financial_transactions.each do |ft| %tr @@ -45,8 +45,8 @@ %table.table.table-striped %thead %tr - %th= t('.supplier') - %th= t('.end') + %th= heading_helper Order, :name + %th= t '.end' %th.numeric= t('.amount_fc') %th %tbody @@ -55,6 +55,6 @@ %td= order.name %td= format_date(order.ends) %td.numeric= number_to_currency(order.sum(:fc)) - %td= link_to t('.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-mini' + %td= link_to t('finance.balancing.orders.clear'), new_finance_order_path(order_id: order.id), class: 'btn btn-mini' - else = t('.everything_cleared') diff --git a/app/views/finance/invoices/_invoices.html.haml b/app/views/finance/invoices/_invoices.html.haml index 621a08fe..0d3920ef 100644 --- a/app/views/finance/invoices/_invoices.html.haml +++ b/app/views/finance/invoices/_invoices.html.haml @@ -23,7 +23,7 @@ %td= format_date invoice.date %td= format_date invoice.paid_on %td= number_to_currency invoice.amount - %td= link_to t('.delivery'), [invoice.supplier,invoice.delivery] if invoice.delivery + %td= link_to Delivery.model_name.human, [invoice.supplier,invoice.delivery] if invoice.delivery %td= link_to format_date(invoice.order.ends), new_finance_order_path(order_id: invoice.order_id) if invoice.order %td= truncate(invoice.note) %td= link_to t('ui.edit'), edit_finance_invoice_path(invoice), class: 'btn btn-mini' diff --git a/app/views/finance/ordergroups/_ordergroups.html.haml b/app/views/finance/ordergroups/_ordergroups.html.haml index 4e67df73..058fecee 100644 --- a/app/views/finance/ordergroups/_ordergroups.html.haml +++ b/app/views/finance/ordergroups/_ordergroups.html.haml @@ -4,9 +4,9 @@ %table.table.table-striped %thead %tr - %th= sort_link_helper t('.name'), "name", :per_page => @per_page - %th= t '.contact' - %th.numeric= sort_link_helper t('.account_balance'), "account_balance", :per_page => @per_page + %th= sort_link_helper heading_helper(Ordergroup, :name), "name", :per_page => @per_page + %th= heading_helper Ordergroup, :contact + %th.numeric= sort_link_helper heading_helper(Ordergroup, :account_balance), "account_balance", :per_page => @per_page %th %tbody - for ordergroup in @ordergroups diff --git a/app/views/foodcoop/ordergroups/_ordergroups.html.haml b/app/views/foodcoop/ordergroups/_ordergroups.html.haml index 20fbd0c9..b8b34084 100644 --- a/app/views/foodcoop/ordergroups/_ordergroups.html.haml +++ b/app/views/foodcoop/ordergroups/_ordergroups.html.haml @@ -5,9 +5,9 @@ %table.table.table-striped %thead %tr - %th= t '.name' - %th= t '.user' - %th= t '.last_ordered' + %th= heading_helper Ordergroup, :name + %th= heading_helper Ordergroup, :user_tokens + %th= heading_helper Ordergroup, :last_ordered %tbody - for ordergroup in @ordergroups diff --git a/app/views/shared/_articles_by_groups.html.haml b/app/views/shared/_articles_by_groups.html.haml index 9470fb49..b55c7c1c 100644 --- a/app/views/shared/_articles_by_groups.html.haml +++ b/app/views/shared/_articles_by_groups.html.haml @@ -1,7 +1,7 @@ %table.table.table-hover %thead %tr - %th{:style => "width:40%"}= t '.name' + %th{:style => "width:40%"}= heading_helper Article, :name %th %acronym{:title => t('shared.articles.ordered_desc')}= t 'shared.articles.ordered' %th @@ -10,7 +10,7 @@ %acronym{:title => t('.fc_price_desc')}= t '.fc_price' %th %acronym{:title => t('.unit_quantity_desc')}= t '.unit_quantity' - %th= t '.unit' + %th= heading_helper Article, :unit %th= t '.price' - for group_order in order.group_orders.ordered diff --git a/app/views/shared/_group.html.haml b/app/views/shared/_group.html.haml index ebd34405..3de9b38c 100644 --- a/app/views/shared/_group.html.haml +++ b/app/views/shared/_group.html.haml @@ -1,14 +1,14 @@ %dl - %dt= t('.description') + ':' + %dt= heading_helper(Ordergroup, :description) + ':' %dd=h group.description - if group.is_a?(Ordergroup) and (@current_user.role_admin? or @current_user.role_finance?) - %dt= t('.contact') + ':' + %dt= heading_helper(Ordergroup, :contact) + ':' %dd=h group.contact - %dt= t('.address') + ':' + %dt= heading_helper(Ordergroup, :contact_address) + ':' %dd= link_to_gmaps group.contact_address %dt= t('.access') + ':' %dd= format_roles(group) - %dt= t('.members') + ':' + %dt= heading_helper(Ordergroup, :user_tokens) + ':' %dd - members = group.users = "(#{members.size})" diff --git a/config/locales/en.yml b/config/locales/en.yml index 2d80d0a7..a2c87178 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -15,6 +15,7 @@ en: name: Name note: Note order_number: Order number + order_number_short: Nr. origin: Origin price: Price (net) supplier: Supplier @@ -81,6 +82,7 @@ en: ordergroup: account_balance: Account balance available_funds: Available credit + contact: Contact contact_address: Address contact_person: Contact person contact_phone: Phone @@ -131,6 +133,7 @@ en: user: email: Email first_name: First name + last_login: Last login last_name: Last name name: Name nick: Username @@ -177,7 +180,6 @@ en: workgroup: Workgroup admin: access_to: access to - actions: Actions base: index: all_ordergroups: All ordergroups @@ -215,11 +217,6 @@ en: workgroup: workgroup new: title: Create ordergroup - ordergroups: - address: Address - contact: Contact - members: Members - name: Name show: confirm: Are you sure? edit: Edit group/members @@ -238,20 +235,11 @@ en: title: Create new user show: confirm: Do you really want to kick out %{user}? - email: Email groupabos: Group subscriptions member_since: Member since %{time} - name: Name - nick: Nick person: Person - phone: Phone preference: Preferences send_message: Send message - users: - email: email - last_login: last login - login: login - name: name workgroups: destroy: error: ! 'Workgroup could not be deleted: %{error}' @@ -339,15 +327,6 @@ en: submit: Update all articles title: Edit all articles from %{supplier} warning: ! 'Warning: all articles will be updated!' - edit_all_table: - available_desc: available - available_short: avail - order_number_desc: Order number - order_number_short: Ordernr. - price_desc: Net price - price_short: Price - unit_quantity_desc: Unit quantity - unit_quantity_short: Quantity form: title_edit: Edit article title_new: Add new article @@ -414,17 +393,11 @@ en: edit: title: Edit delivery form: - actions: Tasks - article: Article - category: Category create_from_blank: Create new article create_stock_article: Create stock article - price: Netprice - quantity: Quantity title_fill_quantities: 2. Set delivery quantities title_finish_delivery: 3. Finish delivery title_select_stock_articles: 1. Select stock articles - unit: Unit index: confirm_delete: Are you sure? new_delivery: ! 'Create new delivery for %{supplier} ' @@ -434,16 +407,12 @@ en: new: title: New delivery from %{supplier} show: - amount: Amount - article: Article - price: Netprice sum: Sum sum_diff: Gross - adjusted invoice amount sum_gross: Gross sum sum_net: Net sum title: Show delivery - title_articles: Article - unit: Unit + title_articles: Articles stock_article_for_adding: action_add_to_delivery: Add to delivery action_edit: Edit @@ -530,16 +499,10 @@ en: edit_results_by_articles: add_article: Add article amount: Amount - amount_per_unit: Unit quantity * Unit - article: Article gross: Gross net: Net - number: Nr. - refund: Deposit - tax: Tax group_order_articles: add_group: Add group - group: Group total: Total costs total_fc: Sum (FC-price) units: Units @@ -626,18 +589,12 @@ en: amount_change_for: Change amount for %{article} result_hint: ! 'Unit: %{unit}' index: - amount: Amount amount_fc: Amount(FC) - clear: To account - date: Date end: End everything_cleared: Great, everything is accounted... - group: Group last_transactions: Recent transactions - note: Note open_transactions: Unsettled orders show_all: show all - supplier: Supplier title: Finances unpaid_invoices: Unpaid invoices invoices: @@ -648,7 +605,6 @@ en: title: Invoices invoices: confirm_delete: Are you sure? - delivery: Delivery linked: This invoice is linked to %{what_link}. linked_delivery: a delivery linked_order: an order @@ -670,10 +626,7 @@ en: search_placeholder: Search ... title: Manage accounts ordergroups: - account_balance: Account balance account_statement: Account statement - contact: Contact - name: Name new_transaction: New transaction update: notice: Invoice was updated @@ -684,10 +637,6 @@ en: only_active: Only active groups only_active_desc: (have placed order at least once in the last 3 months) title: Ordergroups - ordergroups: - last_ordered: Last ordered - name: Name - user: Users users: index: body:

Here you can write a message to the members of your Foodcoop.

You have to approve in your %{profile_link} that your contact details are visible.

@@ -821,12 +770,8 @@ en: last_update: Last update was %{when} ago title: My ordergroup transactions: - amount: Amount - note: Note title: Last Transactions view: Show account statement - when: When - where: Who ordergroup: title: Engagement of your ordergroup tasks_move: @@ -1310,20 +1255,14 @@ en: articles_by_groups: fc_price: FC-Price fc_price_desc: Price including taxes, deposit and Foodcoop-charge - name: Name price: Total price - unit: Unit unit_quantity: Lot quantity unit_quantity_desc: How many units per lot. group: access: Access to activated: activated - address: Address apple_limit: Apple points order limit - contact: Contact deactivated: deactivated - description: Description - members: Members no_weekly_job: No weekly job defined weekly_job: Weekly job group_form_fields: @@ -1553,6 +1492,7 @@ en: title: Tasks for %{workgroup} title_all: All group tasks ui: + actions: Actions close: Close delete: Delete edit: Edit From 2b6a84ddf874a8b5079f224f0e75bb53f3eccb97 Mon Sep 17 00:00:00 2001 From: wvengen Date: Thu, 12 Dec 2013 00:33:35 +0100 Subject: [PATCH 52/68] localeapp roundtrip --- config/locales/de.yml | 68 +++-------------------------------------- config/locales/fr.yml | 70 ++++--------------------------------------- config/locales/nl.yml | 70 ++++--------------------------------------- 3 files changed, 14 insertions(+), 194 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 0d1466a3..e9313cd1 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -15,6 +15,7 @@ de: name: Name note: Notiz order_number: Bestellnummer + order_number_short: Nr. origin: Herkunft price: Nettopreis supplier: Lieferantin @@ -81,6 +82,7 @@ de: ordergroup: account_balance: Kontostand available_funds: Verfügbares Guthaben + contact: Kontakt contact_address: Adresse contact_person: Kontaktperson contact_phone: Telefon @@ -131,6 +133,7 @@ de: user: email: Email first_name: Vorname + last_login: Letzter login last_name: Nachname name: Name nick: Benutzername @@ -177,7 +180,6 @@ de: workgroup: Arbeitsgruppe admin: access_to: Zugriff auf - actions: Aktionen base: index: all_ordergroups: Alle Bestellgruppen @@ -215,11 +217,6 @@ de: workgroup: Arbeitsgruppe new: title: Bestellgruppe anlegen - ordergroups: - address: Adresse - contact: Kontakt - members: Mitglieder - name: Name show: confirm: Bist Du sicher? edit: Gruppe/Mitglieder bearbeiten @@ -238,20 +235,11 @@ de: title: Neue Benutzerin anlegen show: confirm: Willst du %{user} wirklich rausschmeißen? - email: Email groupabos: Gruppenabos member_since: Mitglied seit %{time} - name: Name - nick: Nick person: Person - phone: Telefon preference: Einstellungen send_message: Nachricht senden - users: - email: Email - last_login: Letzter login - login: Login - name: Name workgroups: destroy: error: ! 'Arbeitsgruppe konnte nicht gelöscht werden: %{error}' @@ -339,15 +327,6 @@ de: submit: Alle Artikel aktualisieren title: Alle Artikel von %{supplier} bearbeiten warning: Achtung, alle Artikel werden aktualisiert! - edit_all_table: - available_desc: verfügbar - available_short: verf. - order_number_desc: Bestellnummer - order_number_short: Best.Nr. - price_desc: Netto! - price_short: Preis - unit_quantity_desc: Gebindegröße - unit_quantity_short: GebGr form: title_edit: Artikel bearbeiten title_new: Neuen Artikel einfügen @@ -412,17 +391,11 @@ de: edit: title: Lieferung bearbeiten form: - actions: Optionen - article: Artikel - category: Kategorie create_from_blank: Ohne Vorlage anlegen create_stock_article: Lagerartikel anlegen - price: Nettopreis - quantity: Menge title_fill_quantities: 2. Liefermenge angeben title_finish_delivery: 3. Lieferung abschließen title_select_stock_articles: 1. Lagerartikel auswählen - unit: Einheit index: confirm_delete: Bist Du sicher? new_delivery: Neue Lieferung für %{supplier} anlegen @@ -432,16 +405,12 @@ de: new: title: Neue Lieferung von %{supplier} show: - amount: Menge - article: Artikel - price: Nettopreis sum: Summe sum_diff: Brutto - bereinigter Rechnungsbetrag sum_gross: Bruttosumme sum_net: Nettosumme title: Lieferung anzeigen title_articles: Artikel - unit: Einheit stock_article_for_adding: action_add_to_delivery: Liefern action_edit: Bearbeiten @@ -526,16 +495,10 @@ de: edit_results_by_articles: add_article: Artikel hinzufügen amount: Menge - amount_per_unit: GebGr * Einheit - article: Artikel gross: Brutto net: Netto - number: Nr. - refund: Pfand - tax: MwSt group_order_articles: add_group: Gruppe hinzufügen - group: Gruppe total: Gesamtpreis total_fc: Summe (FC-Preis) units: Einheiten @@ -622,18 +585,12 @@ de: amount_change_for: Mengenänderung für %{article} result_hint: ! 'Einheit: %{unit}' index: - amount: Betrag amount_fc: Betrag(FC) - clear: Abrechnen - date: Datum end: Ende everything_cleared: Super, alles schon abgerechnet... - group: Gruppe last_transactions: Letzte Überweisungen - note: Notiz open_transactions: Noch nicht abgerechnet show_all: alle anzeigen - supplier: Lieferantin title: Finanzbereich unpaid_invoices: Unbezahlte Rechnungen invoices: @@ -644,7 +601,6 @@ de: title: Rechnungen invoices: confirm_delete: Bist Du sicher? - delivery: Lieferung linked: Diese Rechnung ist mit %{what_link} verknüpft. linked_delivery: einer Lieferung linked_order: einer Bestellung @@ -666,10 +622,7 @@ de: search_placeholder: Suchen ... title: Konten verwalten ordergroups: - account_balance: Kontostand account_statement: Kontoauszug - contact: Kontakt - name: Name new_transaction: Neue Transaktion update: notice: Rechnung wurde aktualisiert. @@ -680,10 +633,6 @@ de: only_active: Nur aktive only_active_desc: (mindestens einmal in den letzten 3 Monaten bestellt) title: Bestellgruppen - ordergroups: - last_ordered: zuletzt bestellt - name: Name - user: Mitglieder users: index: body:

Hier kannst Du den Mitgliedern Deiner Foodcoop eine Nachricht schreiben.

Damit Deine Kontaktdaten einzusehen sind, musst Du sie unter %{profile_link} freigeben.

@@ -817,12 +766,8 @@ de: last_update: Letzte Aktualisiering ist %{when} her title: Meine Bestellgruppe transactions: - amount: Betrag - note: Notiz title: Letzte Transaktionen view: Kontoauszug anzeigen - when: Wann - where: Wer ordergroup: title: Engagement Deiner Bestellgruppe tasks_move: @@ -1306,20 +1251,14 @@ de: articles_by_groups: fc_price: FC-Preis fc_price_desc: Preis incl. MwSt, Pfand und Foodcoop-Aufschlag - name: Name price: Gesamtpreis - unit: Einheit unit_quantity: GebGr unit_quantity_desc: Gebindegröße group: access: Zugriff auf activated: aktiviert - address: Adresse apple_limit: Äpfel-Bestellbeschränkung - contact: Kontakt deactivated: deaktiviert - description: Beschreibung - members: Mitglieder no_weekly_job: kein wöchentlicher Job definiert weekly_job: Wöchentlicher Job group_form_fields: @@ -1549,6 +1488,7 @@ de: title: Aufgaben für %{workgroup} title_all: Alle Aufgaben der Gruppe ui: + actions: Aktionen close: Schließen delete: Löschen edit: Bearbeiten diff --git a/config/locales/fr.yml b/config/locales/fr.yml index d69b6bc8..e824f8e7 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -15,6 +15,7 @@ fr: name: Nom note: Note order_number: ! 'Numéro ' + order_number_short: Numéro origin: Lieu de production price: Prix net supplier: @@ -81,6 +82,7 @@ fr: ordergroup: account_balance: Crédit initial available_funds: Crédit disponible + contact: Contact contact_address: Adresse contact_person: Personne à contacter contact_phone: Téléphone @@ -131,6 +133,7 @@ fr: user: email: Email first_name: Prénom + last_login: Dernière connection last_name: Nom de famille name: Nom nick: Identifiant @@ -177,7 +180,6 @@ fr: workgroup: Équipe admin: access_to: accès à - actions: Actions base: index: all_ordergroups: Toutes les cellules @@ -215,11 +217,6 @@ fr: workgroup: équipe new: title: Définir une nouvelle cellule - ordergroups: - address: Adresse - contact: Contact - members: Membres - name: Nom show: confirm: T'es sûrE de ton coup? edit: Modifier les données sur les cellules et/ou leurs membres @@ -238,20 +235,11 @@ fr: title: Ajouter unE nouveLLE_eau membre show: confirm: Veux-tu vraiment expulser %{user}? - email: Email groupabos: Participation à des équipes member_since: Membre depuis %{time} - name: Nom - nick: Identifiant person: Personne - phone: Numéro de téléphone preference: Préférences send_message: Envoyer un message - users: - email: email - last_login: dernière connection - login: identifiant - name: nom workgroups: destroy: error: ! 'Cette équipe n''a pas pu être supprimée: %{error}' @@ -339,15 +327,6 @@ fr: submit: Mettre à jour tous les articles title: Modifier tous les articles de %{supplier} warning: Attention, tous les articles sont en train d'être mis à jour! - edit_all_table: - available_desc: disponible - available_short: disp. - order_number_desc: numéro de commande - order_number_short: n° - price_desc: Prix net - price_short: Prix - unit_quantity_desc: Unités par lot - unit_quantity_short: U/L form: title_edit: title_new: Ajouter un nouvel article @@ -418,17 +397,11 @@ fr: edit: title: Modifier le réapprovisionnement form: - actions: Options - article: Article - category: Catégorie create_from_blank: Ajouter un nouvel article quelconque create_stock_article: Ajouter un article au stock - price: Prix net - quantity: Quantité title_fill_quantities: 2. Définir la quantité à livrer title_finish_delivery: 3. Clore le réapprovisionnement title_select_stock_articles: 1. Choisir les articles en stock - unit: Unité index: confirm_delete: T'es sûrE de ton coup? new_delivery: Réapprovisionner le stock par %{supplier} @@ -438,16 +411,12 @@ fr: new: title: Réapprovisionner le stock par %{supplier} show: - amount: Quantité - article: Article - price: Prix net sum: Prix total sum_diff: montant brut - montant net sum_gross: prix total brut sum_net: prix total net title: Afficher le réapprovisionnement - title_articles: Article - unit: Unité + title_articles: Articles stock_article_for_adding: action_add_to_delivery: Commander action_edit: Modifier @@ -540,16 +509,10 @@ fr: edit_results_by_articles: add_article: Ajouter un article amount: Quantité - amount_per_unit: Poids d'un lot - article: Article gross: Brut net: Net - number: Numéro - refund: Consigne - tax: TVA group_order_articles: add_group: Créer un nouveau groupe - group: Groupe total: Prix total total_fc: Prix total (pour la boufcoop) units: Nombre d'unités @@ -636,18 +599,12 @@ fr: amount_change_for: Modification de la quantité de %{article} result_hint: index: - amount: Montant amount_fc: Montant(boufcoop) - clear: Décompter - date: Date end: Fin everything_cleared: Super, tout est a déjà été décompté! - group: Cellule last_transactions: Dernières transactions - note: Note open_transactions: à décompter show_all: tout afficher - supplier: FournisseusE_r title: Espace trésorerie unpaid_invoices: Factures à régler invoices: @@ -658,7 +615,6 @@ fr: title: Factures invoices: confirm_delete: T'es sûrE de ton coup? - delivery: Réapprovisionnement linked: Cette facture est associée à %{what_link}. linked_delivery: un réapprovisionnement linked_order: une commande @@ -680,10 +636,7 @@ fr: search_placeholder: Rechercher ... title: Crédits des cellules ordergroups: - account_balance: Crédit disponible account_statement: Relevé de compte - contact: - name: Nom new_transaction: Nouvelle transaction update: notice: La facture a été mise à jour. @@ -694,10 +647,6 @@ fr: only_active: Seulement les cellules en activité only_active_desc: (ayant commandé au moins une fois au cours des 3 derniers mois) title: Cellules - ordergroups: - last_ordered: dernière commande - name: Nom - user: Membres users: index: body: ! '

Cette page sert à envoyer des messages aux autres membres de la coop.

@@ -843,12 +792,8 @@ fr: last_update: La dernière mise à jour date du %{when} title: Ta cellule transactions: - amount: Montant - note: Note title: Dernière transactions view: Afficher un relevé de compte - when: Quand? - where: Qui? ordergroup: title: Niveau de participation de ta cellule tasks_move: @@ -1313,20 +1258,14 @@ fr: articles_by_groups: fc_price: Prix coop fc_price_desc: Prix avec TVA, consigne et part de la coop inclus. - name: Nom price: Prix total - unit: Unité unit_quantity: U/L unit_quantity_desc: Unités par lot group: access: Accès à activated: activé - address: Adresse apple_limit: Minimum de glands - contact: Contact deactivated: désactivé - description: Description - members: Membre no_weekly_job: aucun boulot hebdomadaire n'a été défini weekly_job: Boulot hebdomadaire group_form_fields: @@ -1566,6 +1505,7 @@ fr: title: Agenda de l'%{workgroup} title_all: Boulot prévu pour l'équipe ui: + actions: Actions close: Fermer delete: Supprimer edit: Modifier diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 0b5b2d08..3c0b0e34 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -15,6 +15,7 @@ nl: name: Naam note: Notitie order_number: Ordernummer + order_number_short: Nr. origin: Herkomst price: Netto prijs supplier: Leverancier @@ -81,6 +82,7 @@ nl: ordergroup: account_balance: Tegoed available_funds: Beschikbaar tegoed + contact: Contact contact_address: Adres contact_person: Contactpersoon contact_phone: Telefoon @@ -131,6 +133,7 @@ nl: user: email: Email first_name: Voornaam + last_login: Laatste login last_name: Achternaam name: Naam nick: Gebruikersnaam @@ -177,7 +180,6 @@ nl: workgroup: Werkgroep admin: access_to: toegang tot - actions: Acties base: index: all_ordergroups: Alle huishoudens @@ -215,11 +217,6 @@ nl: workgroup: werkgroep new: title: Huishouden toevoegen - ordergroups: - address: Adres - contact: Contact - members: Leden - name: Naam show: confirm: Weet je het zeker? edit: Groep/leden bewerken @@ -238,20 +235,11 @@ nl: title: Nieuwe gebruiker toevoegen show: confirm: Wil je %{user} daadwerkelijk verwijderen? - email: E-mail groupabos: Groepslidmaatschappen member_since: Lid sinds %{time} - name: Naam - nick: Gebruikersnaam person: Persoon - phone: Telefoon preference: Voorkeuren send_message: Bericht versturen - users: - email: e-mail - last_login: laatste login - login: login - name: naam workgroups: destroy: error: ! 'Werkgroep kon niet gewist worden: %{error}' @@ -339,15 +327,6 @@ nl: submit: Alle artikelen bijwerken title: Alle artikelen van %{supplier} bewerken warning: Let op, alle artikelen worden bijgewerkt! - edit_all_table: - available_desc: beschikbaar - available_short: besch. - order_number_desc: Bestelnummer - order_number_short: Best.nr. - price_desc: Netto prijs - price_short: Prijs - unit_quantity_desc: Groothandelsverpakkingsgrootte - unit_quantity_short: Gr.Eenh. form: title_edit: Artikel bewerken title_new: Nieuw artikel toevoegen @@ -414,17 +393,11 @@ nl: edit: title: Levering aanpassen form: - actions: Taken - article: Artikel - category: Categorie create_from_blank: Nieuw voorraadartikel invoeren create_stock_article: Voorraadartikel invoeren - price: Netto prijs - quantity: Aantal title_fill_quantities: 2. Hoeveel mag er geleverd worden title_finish_delivery: 3. Levering afmaken title_select_stock_articles: 1. Kies voorraadartikelen - unit: Eenheid index: confirm_delete: Zeker weten? new_delivery: Nieuwe levering maken voor %{supplier} @@ -434,16 +407,12 @@ nl: new: title: Nieuwe levering van %{supplier} show: - amount: Aantal - article: Artikel - price: Netto prijs sum: Som sum_diff: Bruto - aangepast factuurbedrag sum_gross: Brutosom sum_net: Nettosom title: Levering tonen - title_articles: Artikel - unit: Eenheid + title_articles: Artikelen stock_article_for_adding: action_add_to_delivery: Voeg toe aan levering action_edit: Bewerk @@ -530,16 +499,10 @@ nl: edit_results_by_articles: add_article: Artikel toevoegen amount: Aantal - amount_per_unit: Gr.Eenh. - article: Artikel gross: Bruto net: Netto - number: Nr. - refund: Statiegeld - tax: BTW group_order_articles: add_group: Huishouden toevoegen - group: Huishouden total: Totale prijs total_fc: Som (FC-prijs) units: Eenheden @@ -626,18 +589,12 @@ nl: amount_change_for: Hoeveelheid %{article} result_hint: ! 'Eenheid: %{unit}' index: - amount: Bedrag amount_fc: Bedrag(FC) - clear: Afrekenen - date: Datum end: Einde everything_cleared: Mooi zo, alles is verrekend... - group: Groep last_transactions: Recente transacties - note: Notitie open_transactions: Nog niet afgerekend show_all: alle tonen - supplier: Leverancier title: Financiën unpaid_invoices: Onbetaalde facturen invoices: @@ -648,7 +605,6 @@ nl: title: Facturen invoices: confirm_delete: Weet je het zeker? - delivery: Levering linked: Deze factuur is aan %{what_link} gekoppeld. linked_delivery: een levering linked_order: een bestelling @@ -670,10 +626,7 @@ nl: search_placeholder: Zoeken ... title: Tegoeden beheren ordergroups: - account_balance: Tegoed account_statement: Rekeningafschrift - contact: Contactpersoon - name: Naam new_transaction: Nieuwe transactie update: notice: Factuur is bijgewerkt @@ -684,10 +637,6 @@ nl: only_active: Alleen actieve only_active_desc: (minstens eenmaal in de laatste 3 maanden besteld) title: Huishoudens - ordergroups: - last_ordered: laatste besteld - name: Naam - user: Leden users: index: body:

Hier kun je leden van deze foodcoop een bericht sturen.

Om je eigen contactgegevens te laten zien, moet je die vrijgeven op %{profile_link}.

@@ -823,12 +772,8 @@ nl: last_update: Laatst gewijzigd %{when} geleden title: Mijn huishouden transactions: - amount: Bedrag - note: Notitie title: Laatste transacties view: Rekeningafschrift tonen - when: Wanneer - where: Wie ordergroup: title: Betrokkenheid van je huishouden tasks_move: @@ -1290,20 +1235,14 @@ nl: articles_by_groups: fc_price: FC-Prijs fc_price_desc: Prijs inclusief belasting, statiegeld en foodcoop marge - name: Naam price: Totaalprijs - unit: Eenheid unit_quantity: Gr.Eenh. unit_quantity_desc: Hoeveel eenheden per groothandelsverpakking group: access: Toegang tot activated: actief - address: Adres apple_limit: Appelpunten bestellingslimiet - contact: Contact deactivated: inactief - description: Beschrijving - members: Leden no_weekly_job: geen wekelijkse taak ingesteld weekly_job: wekelijkse taak group_form_fields: @@ -1533,6 +1472,7 @@ nl: title: Taken voor %{workgroup} title_all: Alle groepstaken ui: + actions: Acties close: Sluiten delete: Verwijder edit: Bewerk From 40e9e822951b7392f343a6cb6c50f99f042a2d92 Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 14 Dec 2013 10:03:32 +0100 Subject: [PATCH 53/68] Mark two i18n issues --- app/views/finance/group_order_articles/_form.html.haml | 2 +- app/views/finance/order_articles/_new.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/finance/group_order_articles/_form.html.haml b/app/views/finance/group_order_articles/_form.html.haml index 8b6d41a0..082a3fba 100644 --- a/app/views/finance/group_order_articles/_form.html.haml +++ b/app/views/finance/group_order_articles/_form.html.haml @@ -5,7 +5,7 @@ %h3= t('.amount_change_for', article: @order_article.article.name) .modal-body = form.input :ordergroup_id, as: :select, collection: Ordergroup.all.map { |g| [g.name, g.id] } - = form.input :result, hint: I18n.t('.result_hint', unit: @order_article.article.unit) + = form.input :result, hint: I18n.t('finance.group_order_articles.form.result_hint', unit: @order_article.article.unit) # Why do we need the full prefix? .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} = form.submit t('ui.save'), class: 'btn btn-primary' diff --git a/app/views/finance/order_articles/_new.html.haml b/app/views/finance/order_articles/_new.html.haml index 3cf6136e..41619e6e 100644 --- a/app/views/finance/order_articles/_new.html.haml +++ b/app/views/finance/order_articles/_new.html.haml @@ -3,7 +3,7 @@ = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'} %h3= t '.title' .modal-body - = form.input :article_id, as: :select, collection: new_order_articles_collection + = form.input :article_id, as: :select, collection: new_order_articles_collection, :label => Article.model_name.human # Why do we need the label? .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} = form.submit class: 'btn btn-primary' From d67a0083f1371b866344dcb18fb79e01ac8c851e Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 14 Dec 2013 13:15:16 +0100 Subject: [PATCH 54/68] fix price hint escaping (thanks @JuliusR) --- app/views/deliveries/_stock_article_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/deliveries/_stock_article_form.html.haml b/app/views/deliveries/_stock_article_form.html.haml index 21c5b216..5fdce8de 100644 --- a/app/views/deliveries/_stock_article_form.html.haml +++ b/app/views/deliveries/_stock_article_form.html.haml @@ -16,7 +16,7 @@ %span.add-on % = f.input :deposit - else - = f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article) + = f.input :price, :input_html => {:disabled => 'disabled'}, :hint => stock_article_price_hint(stock_article).html_safe = f.association :article_category .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} From 46ab4dcc013997251a620de6ca0961b24cc3a149 Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 14 Dec 2013 13:15:47 +0100 Subject: [PATCH 55/68] proper i18n of last ordergroup order (thanks @JuliusR) --- app/models/ordergroup.rb | 5 +++++ app/views/foodcoop/ordergroups/_ordergroups.html.haml | 4 ++-- config/locales/en.yml | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/models/ordergroup.rb b/app/models/ordergroup.rb index bf82afc4..745b6e3e 100644 --- a/app/models/ordergroup.rb +++ b/app/models/ordergroup.rb @@ -26,6 +26,11 @@ class Ordergroup < Group User.natural_order.all.reject { |u| (users.include?(u) || u.ordergroup) } end + # the most recent order this ordergroup was participating in + def last_order + orders.order('orders.starts DESC').first + end + def value_of_open_orders(exclude = nil) group_orders.in_open_orders.reject{|go| go == exclude}.collect(&:price).sum end diff --git a/app/views/foodcoop/ordergroups/_ordergroups.html.haml b/app/views/foodcoop/ordergroups/_ordergroups.html.haml index b8b34084..a2beb812 100644 --- a/app/views/foodcoop/ordergroups/_ordergroups.html.haml +++ b/app/views/foodcoop/ordergroups/_ordergroups.html.haml @@ -7,13 +7,13 @@ %tr %th= heading_helper Ordergroup, :name %th= heading_helper Ordergroup, :user_tokens - %th= heading_helper Ordergroup, :last_ordered + %th= heading_helper Ordergroup, :last_order %tbody - for ordergroup in @ordergroups %tr %td= ordergroup.name %td=h ordergroup.users.collect { |u| show_user(u) }.join(", ") - %td= format_date ordergroup.orders.order('orders.starts DESC').first.try(:starts) + %td= format_date ordergroup.last_order.try(:starts) %td= link_to_new_message(message_params: {group_id: ordergroup.id}) diff --git a/config/locales/en.yml b/config/locales/en.yml index a2c87178..496b29c3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -88,6 +88,7 @@ en: contact_phone: Phone description: Description ignore_apple_restriction: Ignore order stop by apple points restriction + last_order: Last order name: Name user_tokens: Members page: From 142e8a04733a1d4f0487ee9a667b3ab70703c590 Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 14 Dec 2013 13:34:58 +0100 Subject: [PATCH 56/68] i18n fixes --- app/views/deliveries/_form.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/deliveries/_form.html.haml b/app/views/deliveries/_form.html.haml index 9b4549fe..3b500942 100644 --- a/app/views/deliveries/_form.html.haml +++ b/app/views/deliveries/_form.html.haml @@ -107,10 +107,10 @@ %table.table#stock_changes.stupidtable %thead %tr - %th.default-sort{:data => {:sort => 'string'}}= t '.article' + %th.default-sort{:data => {:sort => 'string'}}= Article.model_name.human %th= heading_helper StockArticle, :price %th= heading_helper StockArticle, :unit - %th= heading_helper StockChange, :quantity + %th= heading_helper GroupOrderArticle, :quantity # quantity to order, although technically this will be a StockChange %th= t 'ui.actions' %tbody = f.simple_fields_for :stock_changes do |stock_change_form| From 11a2b865aa32309d55582c63670f9b9dbdf1fb11 Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 14 Dec 2013 13:35:52 +0100 Subject: [PATCH 57/68] localeapp roundtrip --- config/locales/de.yml | 1 + config/locales/fr.yml | 1 + config/locales/nl.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/config/locales/de.yml b/config/locales/de.yml index e9313cd1..bef827b9 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -88,6 +88,7 @@ de: contact_phone: Telefon description: Beschreibung ignore_apple_restriction: Bestellstop bei zu wenig Äpfeln ignorieren + last_order: Zuletst bestellt name: Name user_tokens: Mitglieder page: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index e824f8e7..b47f7928 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -88,6 +88,7 @@ fr: contact_phone: Téléphone description: Description ignore_apple_restriction: Pour cette cellule, ne pas bloquer les commandes en cas de manque de glands + last_order: dernière commande name: Nom user_tokens: Membres page: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 3c0b0e34..d4016230 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -88,6 +88,7 @@ nl: contact_phone: Telefoon description: Omschrijving ignore_apple_restriction: Bestelstop vanwege appelpunten negeren + last_order: Laatste bestelling name: Naam user_tokens: Leden page: From 9b92d6ff10f9e1010120cfe09a967a5d71f1cda6 Mon Sep 17 00:00:00 2001 From: Julius Date: Sat, 14 Dec 2013 10:03:32 +0100 Subject: [PATCH 58/68] Mark two i18n issues --- app/views/finance/group_order_articles/_form.html.haml | 2 +- app/views/finance/order_articles/_new.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/finance/group_order_articles/_form.html.haml b/app/views/finance/group_order_articles/_form.html.haml index 8b6d41a0..082a3fba 100644 --- a/app/views/finance/group_order_articles/_form.html.haml +++ b/app/views/finance/group_order_articles/_form.html.haml @@ -5,7 +5,7 @@ %h3= t('.amount_change_for', article: @order_article.article.name) .modal-body = form.input :ordergroup_id, as: :select, collection: Ordergroup.all.map { |g| [g.name, g.id] } - = form.input :result, hint: I18n.t('.result_hint', unit: @order_article.article.unit) + = form.input :result, hint: I18n.t('finance.group_order_articles.form.result_hint', unit: @order_article.article.unit) # Why do we need the full prefix? .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} = form.submit t('ui.save'), class: 'btn btn-primary' diff --git a/app/views/finance/order_articles/_new.html.haml b/app/views/finance/order_articles/_new.html.haml index 3cf6136e..41619e6e 100644 --- a/app/views/finance/order_articles/_new.html.haml +++ b/app/views/finance/order_articles/_new.html.haml @@ -3,7 +3,7 @@ = link_to t('ui.marks.close').html_safe, '#', class: 'close', data: {dismiss: 'modal'} %h3= t '.title' .modal-body - = form.input :article_id, as: :select, collection: new_order_articles_collection + = form.input :article_id, as: :select, collection: new_order_articles_collection, :label => Article.model_name.human # Why do we need the label? .modal-footer = link_to t('ui.close'), '#', class: 'btn', data: {dismiss: 'modal'} = form.submit class: 'btn btn-primary' From 452db61af81ff7a68cf509f536b12ca5a3236b8b Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 14 Dec 2013 23:52:59 +0100 Subject: [PATCH 59/68] i18n fix (thanks @JuliusR) --- app/views/deliveries/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/deliveries/show.html.haml b/app/views/deliveries/show.html.haml index 8f2cdeee..43f157bc 100644 --- a/app/views/deliveries/show.html.haml +++ b/app/views/deliveries/show.html.haml @@ -19,7 +19,7 @@ %tr %th= Article.model_name.human %th= heading_helper StockArticle, :unit - %th.numeric= heading_helper StockChange, :quantity + %th.numeric= heading_helper GroupOrderArticle, :quantity # quantity to order, although technically this will be a StockChange %th.numeric= heading_helper Article, :price %th.numeric= t '.sum' %tbody From a91c97526e5ee48b7ad5d4f21cd6d07384f67ab0 Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 16 Dec 2013 10:55:32 +0100 Subject: [PATCH 60/68] complete German translations (thanks @fsmanuel) [ci skip] --- config/locales/de.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 0d1466a3..531e5c1e 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -35,7 +35,7 @@ de: created_on: Datum note: Notiz ordergroup: Bestellgruppe - user: + user: Eingetragen von group_order: price: Bestellsumme updated_by: Zuletzt bestellt @@ -70,10 +70,10 @@ de: name: Lieferant note: Notiz starts: Läuft vom - status: + status: Status order_article: missing_units: Fehlende Einheiten - missing_units_short: + missing_units_short: Fehlende units_to_order: Menge update_current_price: Globalen Preis aktualisieren order_comment: @@ -124,7 +124,7 @@ de: done: Erledigt? due_date: Wann erledigen? duration: Dauer - name: + name: Aufgabe required_users: Anzahl user_list: Verantwortlichen workgroup: Arbeitsgruppe @@ -280,7 +280,7 @@ de: application: controller: error_authn: Anmeldung erforderlich! - error_denied: + error_denied: Kein Zugriff! error_members_only: Diese Aktion ist nur für Mitglieder der Gruppe erlaubt! article_categories: create: @@ -758,7 +758,7 @@ de: ordered: Bestellt ordered_title: Menge + Toleranz show_hide: Zeige/Verstecke nicht bestellte Artikel - show_note: + show_note: Notiz zeigen title: Artikelübersicht unit_price: Einzelpreis comment: Kommentare lesen/schreiben @@ -1297,9 +1297,9 @@ de: shared: articles: ordered: Bestellt - ordered_desc: + ordered_desc: Anzahl der Artikel die durch das Mitglied bestellt wurden (Menge + Toleranz) received: Bekommen - received_desc: + received_desc: Anzahl der Artikel die ein Mitglied erhält articles_by_articles: ordergroup: Bestellgruppe price: Gesamtpreis From c72ed20c90f09ec7af5c8f78500d38aa1589c2f0 Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 16 Dec 2013 11:29:23 +0100 Subject: [PATCH 61/68] add CHANGELOG [ci skip] --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..2d5fb822 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Foodsoft 3.2.0 +(16 December 2013) + +It's been a year since the previous release. Much has changed. Big changes have been: +* Translations to English, Dutch and French. +* Improved usability of delivery creation. +* The possibility to extend foodsoft with plugins (the wiki is now optional). +* Article search in the ordering screen. +* Foodcoops can choose to use full names and emails instead of nicknames. +* Foodcoops that don't use prepaid can set their minimum ordergroup balance below zero. +* Group and article PDFs now show articles ordered but not received in grey. +* Upgrade to Rails 3. + +When you upgrade, be sure to review `config/app_config.yml.SAMPLE`. When you're running multiple foodcoops from a single installation, check your rake invocations as the syntax is now: `rake multicoops:run TASK=db:migrate`. + +# Foodsoft 3.1.1 +(20 July 2012) From 1e7b1a43c8171959e52b7b7488263df2a59fc35a Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 16 Dec 2013 11:30:54 +0100 Subject: [PATCH 62/68] Bumped new version: 3.2.0 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 94ff29cc..944880fa 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.1 +3.2.0 From 18c946eab12cc425ed08fd44b5caf41bfc90b0d4 Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 16 Dec 2013 18:13:30 +0100 Subject: [PATCH 63/68] add note about release version to setup documentation --- doc/SETUP_DEVELOPMENT.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/SETUP_DEVELOPMENT.md b/doc/SETUP_DEVELOPMENT.md index 9941c262..d2d51931 100644 --- a/doc/SETUP_DEVELOPMENT.md +++ b/doc/SETUP_DEVELOPMENT.md @@ -17,6 +17,9 @@ Getting started ``` git clone https://github.com/foodcoops/foodsoft.git ``` + This brings up the bleeding-edge development version, which might contain some + unfinished parts. If you want to be safe, choose the last release: + `git checkout $(git tag -l | grep ^v | sort -rn | head -n1)` 1. Install RVM and Ruby 1.9.3 (if you have not done so before): ``` From 147365cba1aad4bbbfed60c3e7ebc5bbc1ffaaa1 Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 16 Dec 2013 23:11:39 +0100 Subject: [PATCH 64/68] update coverage and use coveralls.io --- .travis.yml | 1 + Gemfile | 4 +++- Gemfile.lock | 12 ++++++++++++ spec/support/coverage.rb | 24 ++++++++++++++++++------ 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 383dac1c..003c0985 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ rvm: - 1.9.3 services: - redis-server +env: COVERALLS=1 before_install: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" diff --git a/Gemfile b/Gemfile index ffb4ff0e..20469350 100644 --- a/Gemfile +++ b/Gemfile @@ -84,10 +84,12 @@ group :test do # webkit and poltergeist don't seem to work yet gem 'selenium-webdriver' gem 'database_cleaner' - gem 'simplecov', require: false # need to include rspec components before i18n-spec or rake fails in test environment gem 'rspec-core' gem 'rspec-expectations' gem 'rspec-rerun' gem 'i18n-spec' + # code coverage + gem 'simplecov', require: false + gem 'coveralls', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index 66644fe2..ffb7da3e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -102,6 +102,12 @@ GEM execjs coffee-script-source (1.6.3) commonjs (0.2.7) + coveralls (0.7.0) + multi_json (~> 1.3) + rest-client + simplecov (>= 0.7) + term-ansicolor + thor daemons (1.1.9) database_cleaner (1.2.0) debug_inspector (0.0.2) @@ -248,6 +254,8 @@ GEM redis-namespace (~> 1.2) sinatra (>= 0.9.2) vegas (~> 0.1.2) + rest-client (1.6.7) + mime-types (>= 1.16) rspec (2.14.1) rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) @@ -306,6 +314,8 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.8) + term-ansicolor (1.2.2) + tins (~> 0.8) therubyracer (0.12.0) libv8 (~> 3.16.14.0) ref @@ -315,6 +325,7 @@ GEM rack (>= 1.0.0) thor (0.18.1) tilt (1.4.1) + tins (0.13.1) treetop (1.4.15) polyglot polyglot (>= 0.3.1) @@ -357,6 +368,7 @@ DEPENDENCIES client_side_validations client_side_validations-simple_form coffee-rails (~> 3.2.1) + coveralls daemons database_cleaner exception_notification diff --git a/spec/support/coverage.rb b/spec/support/coverage.rb index c67e3172..20bbdcf3 100644 --- a/spec/support/coverage.rb +++ b/spec/support/coverage.rb @@ -1,14 +1,26 @@ # optional test coverage # needs to be loaded first, e.g. add a require at top of spec_helper -if ENV['COVERAGE'] +if ENV['COVERAGE'] or ENV['COVERALLS'] require 'simplecov' + + # update coveralls.io on Travis CI + if ENV['COVERALLS'] + require 'coveralls' + SimpleCov.formatter = Coveralls::SimpleCov::Formatter + end + + # slightly tweaked coverage reporting + def cov_no_plugins(source_file, path) + source_file.filename =~ /#{path}/ and not source_file.filename =~ /\/lib\/foodsoft_.*\// + end SimpleCov.start do add_filter '/spec/' add_filter '/test/' - add_group 'Models', '/app/models/' - add_group 'Controllers', '/app/controllers/' - add_group 'Helpers', '/app/helpers/' - add_group 'Documents', '/app/documents/' - add_group 'Libraries', '/lib/' + add_group 'Models' do |s| cov_no_plugins s, '/app/models/' end + add_group 'Controllers' do |s| cov_no_plugins s, '/app/controllers/' end + add_group 'Helpers' do |s| cov_no_plugins s, '/app/helpers/' end + add_group 'Documents' do |s| cov_no_plugins s, '/app/documents/' end + add_group 'Libraries' do |s| cov_no_plugins s, '/lib/' end + add_group 'Plugins' do |s| s.filename =~ /\/lib\/foodsoft_.*\// end end end From a02ca1b9c069b0b20fda99cd07ad99a7350a81bf Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 17 Dec 2013 18:53:59 +0100 Subject: [PATCH 65/68] localeapp roundtrip [ci skip] --- config/locales/de.yml | 2 ++ config/locales/en.yml | 2 +- config/locales/fr.yml | 9 ++++++--- config/locales/nl.yml | 9 ++++++--- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 6209b266..146a827f 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1388,6 +1388,8 @@ de: new_quantity: Neuer Bestand reason: Ereignis stock_changes: Verlauf des Lagerbestands + stock_article: + confirm_delete: update: notice: Lagerartikel »%{name}« aktualisiert. suppliers: diff --git a/config/locales/en.yml b/config/locales/en.yml index 3caea104..9d6005bc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1363,7 +1363,7 @@ en: copy: title: Copy stock article create: - notice: New stock article %{name} was created. + notice: New stock article "%{name}" was created. destroy: notice: Article %{name} was deleted. edit: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 65d23d2b..eb40b75b 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -396,6 +396,7 @@ fr: edit: title: Modifier le réapprovisionnement form: + confirm_foreign_supplier_reedit: create_from_blank: Ajouter un nouvel article quelconque create_stock_article: Ajouter un article au stock title_fill_quantities: 2. Définir la quantité à livrer @@ -1365,15 +1366,15 @@ fr: check: not_empty: ! '%{name} ne peut pas être supprimé, car il y en a encore en stock.' copy: - title: + title: Copier l'article create: - notice: L'article "%{name}" a été ajouté au stock. + notice: destroy: notice: L'article %{name} a bien été supprimé du stock. edit: title: Modifier l'article form: - copy_stock_article: Copier l'article + copy_stock_article: copier l'article price_hint: Pour éviter que ça soit le bazar, les prix des articles en stock ne peuvent plus être modifiés. index: confirm_delete: T'es sûrE de ton coup? @@ -1396,6 +1397,8 @@ fr: new_quantity: Nouveau stock reason: Raison stock_changes: Afficher l'historique + stock_article: + confirm_delete: update: notice: Les données de l'article "%{name}" ont été mises à jour. suppliers: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index edab0401..65c63213 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -392,6 +392,7 @@ nl: edit: title: Levering aanpassen form: + confirm_foreign_supplier_reedit: create_from_blank: Nieuw voorraadartikel invoeren create_stock_article: Voorraadartikel invoeren title_fill_quantities: 2. Hoeveel mag er geleverd worden @@ -1340,15 +1341,15 @@ nl: check: not_empty: ! '%{name} kon niet worden verwijderd, de inventaris is niet leeg.' copy: - title: + title: kopieer het voorraadartikel create: - notice: Nieuw voorraadsartikel "%{name}" gemaakt. + notice: Voorraadartikel "%{name}" is aangemaakt. destroy: notice: Artikel %{name} is verwijdered. edit: title: Voorraadartikelen bewerken form: - copy_stock_article: kopieer het voorraadartikel + copy_stock_article: vooraadartikel kopiëren price_hint: Om chaos te voorkomen, kun je de prijs van bestaande voorraadartikelen niet aanpassen. index: confirm_delete: Weet je zeker dat je dit wilt verwijderen? @@ -1371,6 +1372,8 @@ nl: new_quantity: Nieuw aantal reason: Reden stock_changes: Verloop + stock_article: + confirm_delete: update: notice: Voorraadartikel "%{name}" is bijgewerkt. suppliers: From 64040d6bb9bc5fd4db157e37d4727d7cc5ea3d79 Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 17 Dec 2013 23:03:48 +0100 Subject: [PATCH 66/68] make some dependencies optional to decrease startup-time --- Gemfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 20469350..71ba7eeb 100644 --- a/Gemfile +++ b/Gemfile @@ -65,15 +65,15 @@ group :development do gem 'quiet_assets' # Deploy with Capistrano - gem 'capistrano', '2.13.5' - gem 'capistrano-ext' + gem 'capistrano', '2.13.5', require: false + gem 'capistrano-ext', require: false #gem 'common_deploy', require: false, path: '../../common_deploy' # pending foodcoops/foodsoft#34, git: 'git://github.com/fsmanuel/common_deploy.git' # Avoid having content-length warnings gem 'thin' end group :development, :test do - gem 'ruby-prof' + gem 'ruby-prof', require: false end group :test do From b4dfa504095d6474bf84fc0bb7b8c10062415135 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 18 Dec 2013 11:10:00 +0100 Subject: [PATCH 67/68] bundle update --- Gemfile.lock | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ffb7da3e..291014eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,7 +57,7 @@ GEM activesupport (3.2.16) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) - acts_as_tree (1.4.0) + acts_as_tree (1.5.0) activerecord (>= 3.0.0) afm (0.2.0) arel (3.0.3) @@ -192,7 +192,7 @@ GEM net-ssh (2.7.0) net-ssh-gateway (1.2.0) net-ssh (>= 2.6.5) - nokogiri (1.6.0) + nokogiri (1.6.1) mini_portile (~> 0.5.0) pdf-reader (1.3.3) Ascii85 (~> 1.0.0) @@ -203,9 +203,11 @@ GEM polyamorous (0.5.0) activerecord (~> 3.0) polyglot (0.3.3) - prawn (0.12.0) - pdf-reader (>= 0.9.0) - ttfunk (~> 1.0.2) + prawn (0.13.0) + afm + pdf-reader (~> 1.2) + ruby-rc4 + ttfunk (~> 1.0.3) quiet_assets (1.0.2) railties (>= 3.1, < 5.0) rack (1.4.5) @@ -273,9 +275,9 @@ GEM rspec-mocks (~> 2.14.0) rspec-rerun (0.1.3) rspec (>= 2.11.0) - ruby-prof (0.13.0) + ruby-prof (0.13.1) ruby-rc4 (0.1.5) - rubyzip (1.0.0) + rubyzip (1.1.0) sass (3.2.12) sass-rails (3.2.6) railties (~> 3.2.0) @@ -283,10 +285,10 @@ GEM tilt (~> 1.3) select2-rails (3.5.2) thor (~> 0.14) - selenium-webdriver (2.37.0) + selenium-webdriver (2.39.0) childprocess (>= 0.2.5) multi_json (~> 1.0) - rubyzip (~> 1.0.0) + rubyzip (~> 1.0) websocket (~> 1.0.4) simple-navigation (3.11.0) activesupport (>= 2.3.2) @@ -336,14 +338,14 @@ GEM rails (>= 3.1) railties (>= 3.1) tzinfo (0.3.38) - uglifier (2.3.2) + uglifier (2.3.3) execjs (>= 0.3.0) json (>= 1.8.0) uniform_notifier (1.4.0) vegas (0.1.11) rack (>= 1.0.0) websocket (1.0.7) - whenever (0.8.4) + whenever (0.9.0) activesupport (>= 2.3.4) chronic (>= 0.6.3) wikicloth (0.8.0) From a0c6cf8afe39bf72bb3d9669f5d62aa33ed3a4e4 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 18 Dec 2013 16:04:30 +0100 Subject: [PATCH 68/68] fix warning without text --- app/views/orders/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/orders/show.html.haml b/app/views/orders/show.html.haml index 075706fe..62e24ae1 100644 --- a/app/views/orders/show.html.haml +++ b/app/views/orders/show.html.haml @@ -2,7 +2,7 @@ - if @order.finished? and !@order.closed? .alert.alert-warning - = t '.warn_not_closed' + = t '.warn_not_closed' // Order summary .well