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

fix: Accessibility [2.4.1]: Provide a skip links option Fixes #6575 #10168

Merged
merged 12 commits into from
May 16, 2024
1 change: 1 addition & 0 deletions env/env.obf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ COMPOSE_PROJECT_NAME=po_obf

PRODUCT_OPENER_FLAVOR=openbeautyfacts
PRODUCT_OPENER_FLAVOR_SHORT=obf
ROBOTOFF_URL=https://robotoff.openfoodfacts.org
82 changes: 3 additions & 79 deletions po/common/common.pot
Original file line number Diff line number Diff line change
Expand Up @@ -6822,82 +6822,6 @@ msgctxt "description"
msgid "Description"
msgstr "Description"

# Overrides by flavor (e.g. obf) or product type (e.g. beauty)

# OFF - food

msgctxt "site_description_off"
msgid "A collaborative, free and open database of ingredients, nutrition facts and information on food products from around the world"
msgstr "A collaborative, free and open database of ingredients, nutrition facts and information on food products from around the world"

msgctxt "tagline_off"
msgid "Open Food Facts gathers information and data on food products from around the world."
msgstr "Open Food Facts gathers information and data on food products from around the world."

msgctxt "footer_tagline_off"
msgid "A collaborative, free and open database of food products from around the world."
msgstr "A collaborative, free and open database of food products from around the world."

#. make sure the text file exists for your language, otherwise ask @teolemon
msgctxt "get_the_app_link_off"
msgid "/open-food-facts-mobile-app"
msgstr "/open-food-facts-mobile-app"

# OBF - beauty

msgctxt "site_description_obf"
msgid "A collaborative, free and open database of ingredients, and information on cosmetic products from around the world"
msgstr ""

msgctxt "tagline_obf"
msgid "Open Beauty Facts gathers information and data on cosmetic products from around the world."
msgstr ""

msgctxt "footer_tagline_obf"
msgid "A collaborative, free and open database of cosmetic products from around the world."
msgstr ""

#. make sure the text file exists for your language, otherwise ask @teolemon
msgctxt "get_the_app_link_obf"
msgid "/open-beauty-facts-mobile-app"
msgstr ""

msgctxt "footer_and_the_facebook_group_obf"
msgid "and the <a href=\"https://www.facebook.com/groups/OpenBeautyFacts/\">Facebook group for contributors</a>"
msgstr ""

msgctxt "search_description_opensearch_obf"
msgid "Open Beauty Facts product search"
msgstr ""

msgctxt "warning_not_complete_obf"
msgid "This product page is not complete. You can help to complete it by editing it and adding more data from the photos we have, or by taking more photos using the app for <a href=\"https://play.google.com/store/apps/details?id=org.openbeautyfacts.scanner&hl=en\">Android</a> or <a href=\"https://apps.apple.com/us/app/open-beauty-facts/id1122926380\">iPhone/iPad</a>. Thank you!"
msgstr ""

msgctxt "brands_example_beauty"
msgid "Nivea, Nivea Men"
msgstr ""

msgctxt "categories_example_beauty"
msgid "Anti-dandruff shampoo, Whitening toothpaste"
msgstr ""

msgctxt "emb_codes_example_beauty"
msgid "EMB 53062"
msgstr ""

msgctxt "generic_name_example_beauty"
msgid "Anti-dandruff shampoo"
msgstr ""

msgctxt "product_name_example_beauty"
msgid "Anti-Perspirant Stress Protect"
msgstr ""

msgctxt "ingredients_text_example_beauty"
msgid "AQUA/WATER, SODIUM LAURETH SULFATE, DISODIUM COCOAMPHODIACETATE, GLYCOL DISTEARATE, COCAMIDE MEA"
msgstr ""

msgctxt "report_problem_navigation"
msgid "Report a problem"
msgstr "Report a problem"
msgctxt "skip_to_content"
msgid "Skip to Content"
msgstr "Skip to Content"
4 changes: 4 additions & 0 deletions po/common/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -6840,6 +6840,10 @@ msgctxt "description"
msgid "Description"
msgstr "Description"

msgctxt "skip_to_content"
msgid "Skip to Content"
msgstr "Skip to Content"

# Overrides by flavor (e.g. obf) or product type (e.g. beauty)

# OFF
Expand Down
5 changes: 5 additions & 0 deletions po/common/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -6814,6 +6814,10 @@ msgctxt "sweetener"
msgid "sweetener"
msgstr "édulcorant"

msgctxt "skip_to_content"
msgid "Skip to Content"
msgstr "Aller au contenu"

#. make sure the text file exists for your language, otherwise ask @teolemon
msgctxt "get_the_app_link_off"
msgid "/open-food-facts-mobile-app"
Expand Down Expand Up @@ -6915,3 +6919,4 @@ msgstr "AQUA / EAU, LAURETH SULFATE DE SODIUM, COCOAMPHODIACETATE DISODIQUE, DIS
msgctxt "report_problem_navigation"
msgid "Signaler un problème"
msgstr "Signaler un problème"

21 changes: 21 additions & 0 deletions scss/_topbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,24 @@
}
}
}

//skip to content styling
.skip a {
background: #FFFFFF;
left: 0;
padding: 6px;
position: absolute;
top: -40px;
-webkit-transition: top 1s ease-out;
-o-transition: top 1s ease-out;
transition: top 1s ease-out;
z-index: 1;

&:focus {
top:20px;
color: #000000;
-webkit-text-decoration-style: solid;
text-decoration-style: solid;
z-index: 6;
}
}
1 change: 1 addition & 0 deletions templates/web/common/site_layout.tt.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
[% google_analytics %]
</head>
<body[% bodyabout %] class="[% page_type %]_page">
<div class="skip"><a href="#content" tabindex="0">[% lang('skip_to_content') %]</a></div>

<div id="page">
<div class="upper-nav contain-to-grid" id="upNav">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
</ul>

[% IF allow_submit %]

<label for="export_photos">
<input type="checkbox" id="export_photos" name="export_photos" [% export_photos_value %]>
[% lang('export_photos') %]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- start templates/[% template.name %] -->

<p>[% lang("import_products_categories_from_public_database_description") %]</p>

<form id = "import_products_categories_form" method="POST" enctype="multipart/form-data" action="/cgi/import_products_categories_from_public_database.pl">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- start templates/[% template.name %] -->

<p> job_id: [% job_id %]</p>
<a href="[% link %]">status</a>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- start templates/[% template.name %] -->

<label for="[% field %]">
[% fieldtype %]
[% IF language.defined %]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- start templates/[% template.name %] -->

[% IF type == "search_or_add" %]

[% IF code.defined %]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- start templates/[% template.name %] -->

<p>[% lang('packaging_parts') %]</p>

<div id="packagings_components_edit">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!-- start templates/[% template.name %] -->

[%# This template is called after editing a product %]
[% IF display_random_sample_of_products_after_edits_options.defined && display_random_sample_of_products_after_edits_options %]
[%# Nothing todo we already display a product %]
Expand Down
2 changes: 1 addition & 1 deletion templates/web/pages/products_map/map_of_products.tt.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="[% static_subdomain %]/js/dist/leaflet.markercluster.js"></script>
<script src="[% static_subdomain %]/js/dist/display-map.js"></script>

<p>[% title %]</p>
<p class="content">[% title %]</p>
<div id="container" style="height: 600px"></div>
<p>&nbsp;</p>

Expand Down
1 change: 0 additions & 1 deletion templates/web/pages/recipes/recipes.tt.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- start templates/[% template.name %] -->

<table>
<caption style="text-align:left">[% lang('recipes_ingredients_statistics') %]</caption>
<thead>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- start templates/[% template.name %] -->

[% IF action == 'display' %]

<p>[% lang("remove_products_from_producers_platform_description") %]</p>
Expand Down
7 changes: 3 additions & 4 deletions templates/web/pages/reset_password/reset_password.tt.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- start templates/[% template.name %] -->

[% IF action == 'display' %]
[% lang("reset_password_${type}_msg") %]
[% INCLUDE 'web/common/includes/error_list.tt.html' %]
Expand Down Expand Up @@ -32,13 +31,13 @@
[% IF status == 'email_sent' %]
[% lang('reset_password_send_email') %]
[% ELSE %]
[% lang('reset_password_error') %]
[% lang('reset_password_error') %]
[% END %]
[% ELSIF type == 'reset' %]
[% IF status == 'password_reset' %]
[% lang('reset_password_reset') %]
[% ELSE %]
[% lang('reset_password_error') %]
[% ELSE %]
[% lang('reset_password_error') %]
[% END %]
[% END %]
[% END %]
Expand Down
Loading
Loading