diff --git a/src/components/ChallengeTakePicturesCard.vue b/src/components/ChallengeTakePicturesCard.vue new file mode 100644 index 00000000000..4b05f2f6573 --- /dev/null +++ b/src/components/ChallengeTakePicturesCard.vue @@ -0,0 +1,42 @@ + + + + \ No newline at end of file diff --git a/src/components/ChallengeTimeline.vue b/src/components/ChallengeTimeline.vue new file mode 100644 index 00000000000..4260dc0e0a0 --- /dev/null +++ b/src/components/ChallengeTimeline.vue @@ -0,0 +1,58 @@ + + + + \ No newline at end of file diff --git a/src/components/ChallengeValidateCard.vue b/src/components/ChallengeValidateCard.vue new file mode 100644 index 00000000000..de1c251efd8 --- /dev/null +++ b/src/components/ChallengeValidateCard.vue @@ -0,0 +1,37 @@ + + \ No newline at end of file diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index feddf26b96b..561c5a8a470 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -134,6 +134,29 @@ "Submit": "Submit", "Title": "Type a barcode" }, + "Challenge": { + "Title": "The current challenge is ...", + "Subtitle": "Join other food price enthusiasts in gathering information about {challenge_title} {challenge_subtitle}.", + "StepTakePictures": { + "Title": "Take pictures of price tags in stores", + "line1": "Pictures can include one or more price tags. Barcodes should be readable. For example :", + "line2": "Once ready, find your shop and upload your pictures using the button below.", + "AddPictures": "Add pictures" + }, + "StepValidate": { + "Title": "Validate the detected prices", + "line1": "Price tags are automatically detected, but the robots still need your help to validate them.", + "line2": "Visit the price validation page using the button below, edit the barcode and price if needed, and validate !", + "line3": "If you're having trouble reading the label, mark it as unreable.", + "line4": "This is a collaborative effort, even if you didn't send many pictures, you can still help others by validating.", + "ValidatePrices": "Validate prices" + }, + "Stats": "Challenge stats", + "MyStats": "My stats", + "PicturesAddedByYou": "Pictures added by you", + "PricesAddedByYou": "Prices added by you", + "MostRecentContributions": "Most recent contributions" + }, "Common": { "About": "About", "AddPrice": "Add a price", @@ -168,6 +191,10 @@ "Category": "Category", "Categories": "Categories", "CategoryTotal": "{count} categories | {count} category | {count} categories", + "Challenge": "Challenge", + "Challenges": "Challenges", + "ChallengeCurrent": "Current challenge", + "ChallengeOngoing": "Ongoing challenge", "Chart": "Chart", "Clear": "Clear", "Contributors": "Contributors", @@ -252,12 +279,16 @@ "OrderUserCountDESC": "User count", "PersonalInfo": "Personal information", "Physical": "Physical", + "Picture": "Picture", + "Pictures": "Pictures", + "PicturesAdded": "Pictures added", "PRICE_TAG": "Price tag", "PriceCount": "{count} prices | {count} price | {count} prices", "PriceAddedCount": "{count} prices added | {count} price added | {count} prices added", "PriceToValidateCount": "{count} prices to validate | {count} price to validate | {count} prices to validate", "PriceCreated": "Price created!", "PricesMore": "More prices", + "PricesAdded": "Prices added", "PricesAddedToday": "Prices added today", "PricesToday": "Prices today", "Private": "Private", @@ -644,6 +675,12 @@ }, "PriceValidationAssistant": { "Title": "Price Validation Assistant" + }, + "Challenge": { + "Title": "Challenge" + }, + "CurrentChallenge": { + "Title": "Current Challenge" } }, "Search": { diff --git a/src/router.js b/src/router.js index 334f1f9324a..1deeac96f90 100644 --- a/src/router.js +++ b/src/router.js @@ -45,6 +45,7 @@ const routes = [ { path: '/stats', name: 'stats', component: () => import('./views/Stats.vue'), meta: { title: 'Stats', icon: 'mdi-chart-box-outline', drawerMenu: true, breadcrumbs: [{title: 'Stats', disabled: true }] }}, { path: '/settings', name: 'settings', component: () => import('./views/Settings.vue'), meta: { title: 'Settings', icon: 'mdi-cog-outline', drawerMenu: true, breadcrumbs: [{title: 'Settings', disabled: true }] }}, { path: '/about', name: 'about', component: () => import('./views/About.vue'), meta: { title: 'About', icon: 'mdi-information-outline', drawerMenu: true, breadcrumbs: [{title: 'About', disabled: true }] }}, + { path: '/experiments/challenge', name: 'challenge', component: () => import('./views/CurrentChallenge.vue'), meta: { title: 'Community Challenge', icon: 'mdi-medal-outline', breadcrumbs: [{title: 'Experiments', disabled: false, to: '/experiments' }, {title: 'Challenge', disabled: true }] }}, // Why this redirect? // The app used to be available at https://prices.openfoodfacts.org/app // It is now available at https://prices.openfoodfacts.org diff --git a/src/services/api.js b/src/services/api.js index 2af79fac1d6..390570ea92c 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -321,6 +321,15 @@ export default { .then((response) => response.json()) }, + getPriceStats(params = {}) { + const url = `${import.meta.env.VITE_OPEN_PRICES_API_URL}/prices/stats?${buildURLParams({...params})}` + return fetch(url, { + method: 'GET', + headers: OP_DEFAULT_HEADERS, + }) + .then((response) => response.json()) + }, + openfoodfactsProductSearch(code) { const url = `${constants.OFF_API_URL}/${code}.json` return fetch(url, { diff --git a/src/views/CurrentChallenge.vue b/src/views/CurrentChallenge.vue new file mode 100644 index 00000000000..d1f82fd8abf --- /dev/null +++ b/src/views/CurrentChallenge.vue @@ -0,0 +1,150 @@ + + + diff --git a/src/views/Experiments.vue b/src/views/Experiments.vue index 69ad7b5acf8..9f507b84cc8 100644 --- a/src/views/Experiments.vue +++ b/src/views/Experiments.vue @@ -21,6 +21,13 @@ to="/experiments/price-validation-assistant" /> + + +