diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 96c719f5d98..c5fe7756243 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -31,7 +31,11 @@ }, "ProofDetails": { "ReceiptWarning": "Receipts may contain personal information, we recommend to hide them (redact, fold...) before taking the picture.", - "Title": "Proof details" + "PrivateWarning": "Otherwise, set the Proof Status to Private. Private proofs are only visible to you and the moderators.", + "Title": "Proof details", + "ProofStatus": "Proof status", + "Public": "Public", + "Private": "Private" }, "Title": "Add multiple prices" }, diff --git a/src/views/AddPriceMultiple.vue b/src/views/AddPriceMultiple.vue index 7fd2d3d36fe..6775aa5cee0 100644 --- a/src/views/AddPriceMultiple.vue +++ b/src/views/AddPriceMultiple.vue @@ -17,19 +17,19 @@ - + - {{ $t('AddPriceSingle.PriceDetails.Picture') }} - {{ $t('AddPriceSingle.PriceDetails.TakePicture') }} - + {{ $t('AddPriceSingle.PriceDetails.Picture') }} + {{ $t('AddPriceSingle.PriceDetails.TakePicture') }} + - {{ $t('AddPriceSingle.PriceDetails.Gallery') }} - {{ $t('AddPriceSingle.PriceDetails.SelectFromGallery') }} - + {{ $t('AddPriceSingle.PriceDetails.Gallery') }} + {{ $t('AddPriceSingle.PriceDetails.SelectFromGallery') }} + - {{ $t('AddPriceSingle.PriceDetails.RecentProof') }} - {{ $t('AddPriceSingle.PriceDetails.SelectRecentProof') }} - + {{ $t('AddPriceSingle.PriceDetails.RecentProof') }} + {{ $t('AddPriceSingle.PriceDetails.SelectRecentProof') }} +

- {{ $t('AddPriceSingle.PriceDetails.ProofUploaded') }} - {{ $t('AddPriceSingle.PriceDetails.ProofSelected') }} -

+ {{ $t('AddPriceSingle.PriceDetails.ProofUploaded') }} + {{ $t('AddPriceSingle.PriceDetails.ProofSelected') }} +

{{ $t('AddPriceSingle.PriceDetails.UploadProof') }}

-

- {{ $t('AddPriceMultiple.ProofDetails.ReceiptWarning') }} -

- +
+ + +

Privacy

+

+ {{ $t('AddPriceMultiple.ProofDetails.ReceiptWarning') }} + {{ $t('AddPriceMultiple.ProofDetails.PrivateWarning') }} +

+
+ + + +
+
+
@@ -390,7 +413,8 @@ export default { proofSuccessMessage: false, userRecentProofsDialog: false, proofSelectedSuccessMessage: false, - proofSelectedMessage: false, + proofisSelected: false, + proofIsPublic: true, // location data locationSelector: false, locationSelectedDisplayName: '', @@ -505,7 +529,8 @@ export default { this.addPriceMultipleForm.proof_id = selectedProof.id this.proofImagePreview = this.getProofUrl(selectedProof) this.proofSelectedSuccessMessage = true - this.proofSelectedMessage = true + this.proofisSelected = true + this.proofIsPublic = selectedProof.is_public }, getProofUrl(proof) { return `${import.meta.env.VITE_OPEN_PRICES_APP_URL}/img/${proof.file_path}` @@ -539,7 +564,10 @@ export default { .then((data) => { this.createProofLoading = false if (data['id']) { + const store = useAppStore() + store.addProof(data) this.addPriceMultipleForm.proof_id = data['id'] + this.proofIsPublic = data['is_public'] this.proofImagePreview = URL.createObjectURL(proofImageCompressed) this.proofSuccessMessage = true } else { @@ -561,6 +589,21 @@ export default { // console.log('Compress complete') // }) }, + updateIsPublicProof() { + const params = { + is_public: this.proofIsPublic + } + api + .updateProof(this.addPriceMultipleForm.proof_id, params) + .then((response) => { + // if response.status == 204 + const store = useAppStore() + store.updateProof(this.addPriceMultipleForm.proof_id, params) + }) + .catch((error) => { + console.log(error) + }) + }, clearProof() { this.proofImage = null this.proofImagePreview = null