Skip to content

Commit

Permalink
feat(Community): super quick /community page
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Nov 29, 2024
1 parent cd9d6e2 commit 9f4cb3f
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ export default {
APP_DUMP_PRICES_URL: `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/data/prices.jsonl.gz`,
APP_DUMP_PROOFS_URL: `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/data/proofs.jsonl.gz`,
APP_DUMP_LOCATIONS_URL: `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/data/locations.jsonl.gz`,
APP_GITHUB_BACKEND_URL: 'https://github.com/openfoodfacts/open-prices',
APP_GITHUB_FRONTEND_URL: 'https://github.com/openfoodfacts/open-prices-frontend',
APP_GITHUB_REUSE_DISCUSSION_URL: 'https://github.com/openfoodfacts/open-prices/discussions/562',
APP_HUGGING_FACE_URL: 'https://huggingface.co/datasets/openfoodfacts/open-prices',
APP_DATA_GOUV_URL: 'https://www.data.gouv.fr/fr/datasets/open-prices/',
THEME_LIGHT_ICON: 'mdi-white-balance-sunny',
THEME_DARK_ICON: 'mdi-moon-waning-crescent',
// OFF
OFF_NAME: OFF_NAME,
OFF_URL: 'https://world.openfoodfacts.org',
OFF_SLACK_URL: 'https://slack.openfoodfacts.org',
OFF_CONTACT_EMAIL: '[email protected]',
OFF_SIGN_UP_URL: 'https://world.openfoodfacts.org/cgi/user.pl',
OFF_ICON: OFF_ICON,
Expand Down
10 changes: 10 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
"Categories": "Categories",
"Chart": "Chart",
"Contributors": "Contributors",
"Community": "Community",
"Country": "Country",
"Currency": "Currency",
"CurrencyMissing": "Currency missing",
Expand Down Expand Up @@ -246,6 +247,8 @@
"ReceiptPriceCount": "Number of prices",
"ReceiptPriceTotal": "Total amount",
"Recent": "Recent",
"Reuses": "Reuses",
"ReusesKnown": "Known reuses",
"Search": "Search",
"Settings": "Settings",
"SignInOFFAccount": "Sign in with your {url} account",
Expand Down Expand Up @@ -287,6 +290,10 @@
"PetFood": "Pet food",
"Beauty": "Beauty"
},
"Community": {
"JoinUs": "Join us!",
"HowToUseTheData": "Use the data"
},
"ChangeCurrencyDialog": {
"Title": "Choose one of your favorite currencies",
"Currency": "Currency",
Expand Down Expand Up @@ -485,6 +492,9 @@
"AddProofMultiple": {
"Title": "Add multiple proofs"
},
"Community": {
"Title": "Community"
},
"Experiments": {
"Title": "Experiments"
},
Expand Down
3 changes: 2 additions & 1 deletion src/router.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 80 additions & 0 deletions src/views/Community.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<template>
<h2 class="text-h6 mb-1">
{{ $t('Community.JoinUs') }}
</h2>

<v-row>
<v-col>
<p><a :href="APP_GITHUB_BACKEND_URL" target="_blank">Github</a></p>
<p><a :href="APP_HUGGING_FACE_URL" target="_blank">Open Food Facts Slack (#prices)</a></p>
</v-col>
</v-row>

<br>

<h2 class="text-h6 mb-1">
{{ $t('Community.HowToUseTheData') }}
</h2>

<v-row>
<v-col>
<p><a :href="APP_API_URL" target="_blank">API</a></p>
<p><a :href="APP_HUGGING_FACE_URL" target="_blank">Hugging Face</a></p>
<p><a :href="APP_HUGGING_FACE_URL" target="_blank">data.gouv</a></p>
</v-col>
</v-row>

<br>

<h2 class="text-h6 mb-1">
{{ $t('Common.ReusesKnown') }}
</h2>
<v-row>
<v-col v-for="reuse in reusesList" :key="reuse.id" cols="12" sm="6" md="4" xl="3">
<ReuseCard :reuse="reuse" />
</v-col>
</v-row>

<v-row>
<v-col>
<v-alert
class="mb-2"
type="info"
variant="outlined"
>
<i18n-t keypath="Reuses.AlertNew" tag="span">
<template #url>
<a :href="APP_GITHUB_REUSE_DISCUSSION_URL" target="_blank">{{ $t('Reuses.Here') }}</a>
</template>
</i18n-t>
</v-alert>
</v-col>
</v-row>
</template>

<script>
import { defineAsyncComponent } from 'vue'
import Reuses from '../data/reuses.json'
import constants from '../constants'
export default {
components: {
ReuseCard: defineAsyncComponent(() => import('../components/ReuseCard.vue')),
},
data() {
return {
APP_GITHUB_BACKEND_URL: constants.APP_GITHUB_BACKEND_URL,
OFF_SLACK_URL: constants.OFF_SLACK_URL,
APP_API_URL: constants.APP_API_URL,
APP_HUGGING_FACE_URL: constants.APP_HUGGING_FACE_URL,
APP_DATA_GOUV_URL: constants.APP_DATA_GOUV_URL,
APP_GITHUB_REUSE_DISCUSSION_URL: constants.APP_GITHUB_REUSE_DISCUSSION_URL,
}
},
computed: {
reusesList() {
return Reuses.filter(r => r.display)
},
}
}
</script>

0 comments on commit 9f4cb3f

Please sign in to comment.