<<

NAME

ProductOpener::Web - contains display functions for the website.

SYNOPSIS

ProductOpener::Web consists of functions used only in OpenFoodFacts website for different tasks.

DESCRIPTION

The module implements the functions that are being used by the OpenFoodFacts website. This module consists of different functions for displaying the different parts of home page, creating and saving products, etc

FUNCTIONS

display_field ( $product_ref, $field )

This function is used to display the one characteristic in the product's characteristics section on the product page.

display_data_quality_issues_and_improvement_opportunities( $product_ref )

Display on the product page a list of data quality issues, and of improvement opportunities. This is for the platform for producers.

display_data_quality_description( $product_ref, $tagid )

Display an explanation of the data quality warning or error, using specific product data related to the warning.

display_knowledge_panel( $product_ref, $panels_ref, $panel_id )

Generate HTML code corresponding to a specific panel.

The code is generated by the web/panels/panel.tt.html template.

get_languages_options_list( $target_lc )

Generates a data structure containing the list of languages and their translation in a target language. The data structured can be passed to HTML templates to construction a list of options for a select element.

get_countries_options_list( $target_lc )

Generates all the countries name in the $target_lc language suitable for an select option list

Arguments

$target_lc - language code for labels

$exclude_world - boolean to exclude 'World' from list

Return value

A reference to a list of hashes with every country code and their label in the $lc language [{value => "fr", label => "France"},…]

<<