Skip to content

Commit

Permalink
Merge branch 'master' into foundation-scss
Browse files Browse the repository at this point in the history
  • Loading branch information
hangy committed Nov 18, 2017
2 parents f8eec58 + 11b81e8 commit e771134
Show file tree
Hide file tree
Showing 732 changed files with 6,367 additions and 2,411 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ perl:
- "system"
env: COVERAGE=1
cache:
yarn: true
directories:
- $HOME/.npm
- node_modules
- $HOME/.cache
- $HOME/perl5
addons:
Expand All @@ -22,17 +24,18 @@ sudo: false
before_install:
- nvm install 4
- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$PATH"
install:
- cpanm --quiet --installdeps --notest --skip-satisfied .
- npm install
- node_modules/.bin/bower install
- ./node_modules/.bin/gulp
- yarn install
- yarn run build
- ln -s $TRAVIS_BUILD_DIR/lib/ProductOpener/Config_off.pm $TRAVIS_BUILD_DIR/lib/ProductOpener/Config.pm
- cp $TRAVIS_BUILD_DIR/lib/ProductOpener/Config2_sample.pm $TRAVIS_BUILD_DIR/lib/ProductOpener/Config2.pm
- ln -s $TRAVIS_BUILD_DIR/lib/ProductOpener/SiteLang_off.pm $TRAVIS_BUILD_DIR/lib/ProductOpener/SiteLang.pm
- sed -i -e 's|\$server_domain = "openfoodfacts.org";|\$server_domain = "off.travis-ci.org";|g' $TRAVIS_BUILD_DIR/lib/ProductOpener/Config2.pm
- sed -i -e 's|\/home\/off|'$TRAVIS_BUILD_DIR'|g' $TRAVIS_BUILD_DIR/lib/ProductOpener/Config2.pm
script:
- npm test
- yarn test
notifications:
slack: openfoodfacts:Pre9ZXKFH1CYtix8DeJAaFi2
9 changes: 8 additions & 1 deletion cgi/ingredients.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
my $code = normalize_code(param('code'));
my $id = param('id');

my $ocr_engine = param('ocr_engine');

if (not defined $ocr_engine) {
$ocr_engine = "tesseract";
# $ocr_engine = "google_cloud_vision";
}

$debug and print STDERR "ingredients.pl - code: $code - id: $id\n";

if (not defined $code) {
Expand All @@ -40,7 +47,7 @@
my %results = ();

if (($id =~ /^ingredients/) and (param('process_image'))) {
$results{status} = extract_ingredients_from_image($product_ref, $id);
$results{status} = extract_ingredients_from_image($product_ref, $id, $ocr_engine);
if ($results{status} == 0) {
$results{ingredients_text_from_image} = $product_ref->{ingredients_text_from_image};
$results{ingredients_text_from_image} =~ s/\n/ /g;
Expand Down
6 changes: 3 additions & 3 deletions cgi/madenearyou.pl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ ($)
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css" />
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/ui-lightness/jquery-ui.css" />
<script type="text/javascript" src="/js/jquery.cookie.min.js"></script>
<script src="/js/jquery.iframe-transport.js"></script>
Expand Down Expand Up @@ -154,7 +154,7 @@ ($)
</script>
<link href='http://fonts.googleapis.com/css?family=Fredericka+the+Great' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Fredericka+the+Great' rel='stylesheet' type='text/css'>
</head>
Expand Down Expand Up @@ -203,7 +203,7 @@ ($)
<p>Retrouvez-nous aussi sur :</p>
<p>
&rarr; <a href="https://twitter.com/openfoodfactsfr">Twitter</a><br/>
&rarr; <a href="https://twitter.com/OpenFoodFactsFR">Twitter</a><br/>
&rarr; <a href="https://plus.google.com/u/0/b/102622509148794386660/">Google+</a><br />
&rarr; <a href="https://www.facebook.com/OpenFoodFacts.fr">Facebook</a> + <a href="https://www.facebook.com/groups/356858984359591/">groupe des contributeurs</a><br />
</p>
Expand Down
4 changes: 4 additions & 0 deletions cgi/product_jqm_multilingual.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use ProductOpener::Food qw/:all/;
use ProductOpener::Ingredients qw/:all/;
use ProductOpener::Images qw/:all/;
use ProductOpener::SiteQuality qw/:all/;


use Apache2::RequestRec ();
use Apache2::Const ();
Expand Down Expand Up @@ -282,6 +284,8 @@

compute_unknown_nutrients($product_ref);

ProductOpener::SiteQuality::check_quality($product_ref);


$debug and print STDERR "product_jqm.pl - code $code - saving\n";
#use Data::Dumper;
Expand Down
37 changes: 26 additions & 11 deletions cgi/product_multilingual.pl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use ProductOpener::Ingredients qw/:all/;
use ProductOpener::Images qw/:all/;
use ProductOpener::URL qw/:all/;
use ProductOpener::SiteQuality qw/:all/;

use Apache2::RequestRec ();
use Apache2::Const ();
Expand Down Expand Up @@ -522,6 +523,8 @@

compute_unknown_nutrients($product_ref);

ProductOpener::SiteQuality::check_quality($product_ref);


$admin and print STDERR "compute_serving_size_date -- done\n";

Expand Down Expand Up @@ -1890,9 +1893,11 @@ ($$$$$$)
$comment = $comment . remove_tags_and_quote(decode utf8=>param('comment'));
store_product($product_ref, $comment);

my $product_url = product_url($product_ref);

if (defined $product_ref->{server}) {
# product that was moved to OBF from OFF etc.
my $product_url = "https://" . $subdomain . "." . $options{other_servers}{$product_ref->{server}}{domain} . product_url($product_ref);;
$product_url = "https://" . $subdomain . "." . $options{other_servers}{$product_ref->{server}}{domain} . product_url($product_ref);;
$html .= "<p>" . lang("product_changes_saved") . "</p><p>&rarr; <a href=\"" . $product_url . "\">"
. lang("see_product_page") . "</a></p>";
}
Expand All @@ -1907,16 +1912,26 @@ ($$$$$$)
send_email_to_admin(lang("deleting_product"), $email);

} else {
my %request = (
'titleid'=>get_fileid(product_name_brand($product_ref)),
'query_string'=>$ENV{QUERY_STRING},
'referer'=>referer(),
'code'=>$code,
'product_changes_saved'=>1,
'sample_size'=>10
);

display_product(\%request);

# warning: this option is very slow
if ((defined $options{display_random_sample_of_products_after_edits}) and ($options{display_random_sample_of_products_after_edits})) {

my %request = (
'titleid'=>get_fileid(product_name_brand($product_ref)),
'query_string'=>$ENV{QUERY_STRING},
'referer'=>referer(),
'code'=>$code,
'product_changes_saved'=>1,
'sample_size'=>10
);

display_product(\%request);

}
else {
$html .= "<p>" . lang("product_changes_saved") . "</p><p>&rarr; <a href=\"" . $product_url . "\">"
. lang("see_product_page") . "</a></p>";
}
}

}
Expand Down
36 changes: 18 additions & 18 deletions html/images/misc/android/download.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/bin/sh
# Those URLs seem obsolete. Pierre. 19 Mars 2017
wget http://developer.android.com/images/brand/ar_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/de_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/en_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/es_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/pt_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/nl_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/zh_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/cn_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/ja_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/jp_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/it_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/ru_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/ro_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/fi_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/sv_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/pl_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/vn_app_rgb_wo_45.png
wget http://developer.android.com/images/brand/th_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/ar_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/de_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/en_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/es_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/pt_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/nl_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/zh_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/cn_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/ja_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/jp_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/it_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/ru_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/ro_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/fi_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/sv_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/pl_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/vn_app_rgb_wo_45.png
wget https://developer.android.com/images/brand/th_app_rgb_wo_45.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e771134

Please sign in to comment.