Skip to content

Commit

Permalink
refactor(Proofs): show image_thumb instead of (full) file image (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Oct 4, 2024
1 parent 933a77e commit de4359e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/components/ProofActionMenuButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<v-list-item :slim="true" prepend-icon="mdi-eye-outline" :to="getProofDetailUrl">
{{ $t('Common.Details') }}
</v-list-item>
<v-list-item :slim="true" prepend-icon="mdi-open-in-new" :href="getProofFullUrl" target="_blank">
{{ $t('Common.ImageFull') }}
</v-list-item>
<v-list-item :slim="true" prepend-icon="mdi-pencil" :disabled="!userCanEditProof" @click="openEditDialog">
{{ $t('Common.Edit') }}
</v-list-item>
Expand Down Expand Up @@ -82,6 +85,11 @@ export default {
}
},
computed: {
getProofFullUrl() {
// return 'https://prices.openfoodfacts.org/img/0002/qU59gK8PQw.webp' // PRICE_TAG
// return 'https://prices.openfoodfacts.net/img/0001/lZGFga9ZOT.webp' // RECEIPT
return `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/img/${this.proof.file_path}`
},
getProofDetailUrl() {
return `/proofs/${this.proof.id}`
},
Expand Down
7 changes: 5 additions & 2 deletions src/components/ProofCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ export default {
}
},
getProofUrl(proof) {
// return 'https://prices.openfoodfacts.org/img/0002/qU59gK8PQw.webp' // PRICE_TAG
// return 'https://prices.openfoodfacts.net/img/0001/lZGFga9ZOT.webp' // RECEIPT
// return 'https://prices.openfoodfacts.org/img/0002/qU59gK8PQw.400.webp' // PRICE_TAG
// return 'https://prices.openfoodfacts.net/img/0001/lZGFga9ZOT.400.webp' // RECEIPT
if (proof.image_thumb_path) {
return `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/img/${proof.image_thumb_path}`
}
return `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/img/${proof.file_path}`
},
close() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProofChip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@click="openDialog"
>
<v-icon icon="mdi-image" />
<v-dialog v-model="dialog" scrollable max-height="80%" width="80%">
<v-dialog v-model="dialog" scrollable max-height="80%" width="auto">
<ProofCard :proof="proof" :hideProofActions="true" @close="closeDialog" />
</v-dialog>
</v-chip>
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
"Help": "Help",
"History": "History",
"Image": "Image",
"ImageFull": "Full-size image",
"LinkCopySuccess": "Link copied",
"LocationCount": "{count} locations",
"Map": "Map",
Expand Down

0 comments on commit de4359e

Please sign in to comment.