Skip to content

Commit

Permalink
feat!: Open Food Facts website redesign (#7414)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanegigandet authored Oct 11, 2022
1 parent 33e7baf commit 7e52e7a
Show file tree
Hide file tree
Showing 116 changed files with 171,640 additions and 3,314 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ html/js/dist/
html/js/datatables.*.js
html/js/jquery*.js
html/js/sigma.*.js
html/js/hc-sticky.js
html/js/scrollNav.js
html/js/stikelem.js
5 changes: 3 additions & 2 deletions cgi/login.pl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
my $redirect = single_param('redirect');
$template_data_ref->{redirect} = $redirect;
if (defined $User_id) {
my $loc = $redirect || $formatted_subdomain;
my $loc = $redirect || $formatted_subdomain . "/cgi/session.pl";
$r->headers_out->set(Location => $loc);
$r->err_headers_out->add('Set-Cookie' => $request_ref->{cookie});
$r->status(302);
Expand Down Expand Up @@ -85,8 +85,9 @@

$template_data_ref->{errors} = \@errors;

# Display the sign in form
my $html;
process_template('web/pages/login_form/login.tt.html', $template_data_ref, \$html) or $html = '';
process_template('web/pages/session/sign_in_form.tt.html', $template_data_ref, \$html) or $html = '';
if ($tt->error()) {
$html .= '<p>' . $tt->error() . '</p>';
}
Expand Down
2 changes: 1 addition & 1 deletion cgi/product_image.pl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
$template_data_ref->{attribution} = $attribution;

my $html;
process_template('product_image.tt.html', $template_data_ref, \$html) or $html = '';
process_template('web/pages/product/includes/product_image.tt.html', $template_data_ref, \$html) or $html = '';
$html .= "<p>" . $tt->error() . "</p>";

$request_ref->{title} = $alt;
Expand Down
3 changes: 2 additions & 1 deletion cgi/product_multilingual.pl
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,6 @@ ($product_ref, $field, $language)
$header .= <<HTML
<link rel="stylesheet" type="text/css" href="/css/dist/cropper.css" />
<link rel="stylesheet" type="text/css" href="/css/dist/tagify.css" />
<link rel="stylesheet" type="text/css" href="/css/dist/product-multilingual.css?v=$file_timestamps{'css/dist/product-multilingual.css'}" />
HTML
;

Expand Down Expand Up @@ -1435,6 +1434,8 @@ ($product_ref, $field, $language)
or $html = "<p>" . $tt->error() . "</p>";
process_template('web/pages/product_edit/product_edit_form_display.tt.js', $template_data_ref_display, \$js);
$initjs .= $js;
$request_ref->{page_type} = "product_edit";
$request_ref->{page_format} = "banner";

}
elsif (($action eq 'display') and ($type eq 'delete') and ($User{moderator})) {
Expand Down
21 changes: 18 additions & 3 deletions cgi/session.pl
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@
}
}

process_template('web/pages/session/session.tt.html', $template_data_ref, \$html)
or $html = "<p>" . $tt->error() . "</p>";

if (single_param('jqm')) {

my %response;
Expand All @@ -101,6 +98,24 @@

}
else {
my $template;

if ((defined param('length')) and (param('length') eq 'logout')) {
# The user is signing out
$template = "signed_out";
}
elsif (defined $User_id) {
# The user is signed in
$template = "signed_in";
}
else {
# The user is signing in: display the login form
$template = "sign_in_form";
}

process_template("web/pages/session/$template.tt.html", $template_data_ref, \$html)
or $html = "<p>" . $tt->error() . "</p>";

$request_ref->{title} = lang('session_title');
$request_ref->{content_ref} = \$html;
display_page($request_ref);
Expand Down
6 changes: 4 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const svgmin = require("gulp-svgmin");
const jsSrc = [
'./html/js/display*.js',
'./html/js/product-multilingual.js',
'./html/js/search.js'
'./html/js/search.js',
'./html/js/hc-sticky.js',
'./html/js/stikelem.js',
'./html/js/scrollNav.js'
];

const sassSrc = "./scss/**/*.scss";
Expand Down Expand Up @@ -130,7 +133,6 @@ function copyCss() {
"./node_modules/leaflet.markercluster/dist/MarkerCluster.css",
"./node_modules/leaflet.markercluster/dist/MarkerCluster.Default.css",
"./node_modules/@yaireo/tagify/dist/tagify.css",
"./html/css/product-multilingual.css",
"./node_modules/cropperjs/dist/cropper.css",
"./node_modules/jvectormap-next/jquery-jvectormap.css",
"./node_modules/select2/dist/css/select2.min.css"
Expand Down
27 changes: 27 additions & 0 deletions html/images/illustrations/app-icon-in-the-clouds.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions html/images/illustrations/donate-heart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions html/images/illustrations/donut.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions html/images/illustrations/footer-orange.svg
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 7e52e7a

Please sign in to comment.