Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommendation panels (global + country specific) for health: alcohol and pulses #6272

Merged
merged 5 commits into from
Jan 12, 2022

Conversation

stephanegigandet
Copy link
Contributor

This is a first implementation of panels to make recommendations based on products (e.g. categories, ingredients, nutrients) and users (based on country, language, and maybe later on personal preferences).

The first recommendations are examples, to see how it looks on the web and in the app, experiment with ways to define them etc.
Those first recommendations are related to health and shown in the health card, below the Nutri-Score panel, but we could also have other kinds of recommendations, for instance related to the environment.

The first recommendation is for alcoholic beverages. By default, we show the WHO recommendation, and for users in France with the French language, we show instead the recommendation from the French health agency.

image

in France:

image

The second one is to suggest eating more pulses, and this one is specific to France.

image

Note: there should be an extra link in the panel to indicate the source of the recommendation, but the implementation is in another PR: #6270

@stephanegigandet stephanegigandet requested a review from a team as a code owner January 11, 2022 09:28
@github-actions github-actions bot added 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org labels Jan 11, 2022
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo a comment on a potential bug

},
[% END %]
]
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est normal qu'il soit là lui ?

@@ -149,6 +149,17 @@ <h4 class="panel_title">
<img src="[% image_element.url %]" alt="[% image_element.alt %]">
[% IF image_element.link_url.defined %]</a>[% END %]

[% IF image_element.source_url.defined %]
<div class="image_source" style="font-style:italic">[% lang("source") %][% sep %]:
<a href="[% text_element.source_url %]">[% image_element.source_text %]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it href="[% image_element.source_url %]" ? or is it the IF above ill defined ? I'm a bit confused…

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right, my mistake, thanks!

@sonarcloud
Copy link

sonarcloud bot commented Jan 11, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@stephanegigandet stephanegigandet merged commit 0dc5b1d into main Jan 12, 2022
@stephanegigandet stephanegigandet deleted the recommendations branch January 12, 2022 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels recommendations Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants