show message when ignoring articles due to missing order number

This commit is contained in:
wvengen 2014-01-24 22:20:29 +01:00
parent 49e563af89
commit d08f120b27
3 changed files with 6 additions and 0 deletions

View file

@ -227,6 +227,7 @@ class ArticlesController < ApplicationController
if @updated_articles.empty? && @outlisted_articles.empty? if @updated_articles.empty? && @outlisted_articles.empty?
redirect_to supplier_articles_path(@supplier), :notice => I18n.t('articles.controller.sync.notice') redirect_to supplier_articles_path(@supplier), :notice => I18n.t('articles.controller.sync.notice')
end end
@ignored_article_count = @supplier.articles.where(order_number: [nil, '']).count
end end
# Updates, deletes articles when sync form is submitted # Updates, deletes articles when sync form is submitted

View file

@ -14,6 +14,8 @@
.alert= t '.alert_used', article: article.name .alert= t '.alert_used', article: article.name
- else - else
%i= t '.outlist.body_skip' %i= t '.outlist.body_skip'
- if @ignored_article_count > 0
%i= t '.outlist.body_ignored', count: @ignored_article_count
%hr/ %hr/
%h2= t '.update.title' %h2= t '.update.title'
%p %p

View file

@ -375,6 +375,9 @@ en:
outlist: outlist:
alert_used: Warning, %{article} is used in an open order. Please remove it from the order first. alert_used: Warning, %{article} is used in an open order. Please remove it from the order first.
body: ! 'The following articles were removed from the list and will be <b>deleted</b>:' body: ! 'The following articles were removed from the list and will be <b>deleted</b>:'
body_ignored:
one: One article without order number was skipped.
other: ! '%{count} articles without order number were skipped.'
body_skip: No articles to delete. body_skip: No articles to delete.
title: Remove from list ... title: Remove from list ...
price_short: Price price_short: Price