Themes: don't do face blurring for some layers (artwork, memorials, ghost_bikes)

This commit is contained in:
Pieter Vander Vennet 2024-10-12 13:36:10 +02:00
parent 7d83cb1a7f
commit 15176a1682
11 changed files with 370 additions and 342 deletions

View file

@ -4,8 +4,8 @@
*/
import type { SpecialVisualizationState } from "../SpecialVisualization"
import { ImmutableStore, UIEventSource } from "../../Logic/UIEventSource"
import type { OsmId, OsmTags } from "../../Models/OsmFeature"
import { UIEventSource } from "../../Logic/UIEventSource"
import type { OsmTags } from "../../Models/OsmFeature"
import LoginToggle from "../Base/LoginToggle.svelte"
import Translations from "../i18n/Translations"
import Tr from "../Base/Tr.svelte"
@ -22,6 +22,7 @@
export let tags: UIEventSource<OsmTags>
export let targetKey: string = undefined
export let layer: LayerConfig
export let noBlur: boolean = false
/**
* Image to show in the button
* NOT the image to upload!
@ -47,22 +48,22 @@
continue
}
if(layer?.id === "note"){
if (layer?.id === "note") {
const uploadResult = await state?.imageUploadManager.uploadImageWithLicense(tags.data.id,
state.osmConnection.userDetails.data?.name ?? "Anonymous",
file, "image")
if(!uploadResult){
file, "image", noBlur)
if (!uploadResult) {
return
}
const url = uploadResult.absoluteUrl
await state.osmConnection.addCommentToNote(tags.data.id, url)
NoteCommentElement.addCommentTo(url, <UIEventSource<any>>tags, {
osmConnection: state.osmConnection,
osmConnection: state.osmConnection
})
return
}
await state?.imageUploadManager.uploadImageAndApply(file, tags, targetKey)
await state?.imageUploadManager.uploadImageAndApply(file, tags, targetKey, noBlur)
} catch (e) {
console.error(e)
state.reportError(e, "Could not upload image")
@ -96,12 +97,21 @@
{#if labelText}
{labelText}
{:else}
<Tr t={t.addPicture} />
<div class="flex flex-col">
<Tr t={t.addPicture} />
{#if noBlur}
<span class="subtle text-sm">
Faces will not be blurred
</span>
{/if}
</div>
{/if}
</div>
</FileSelector>
<div class="text-xs subtle italic">
<Tr t={Translations.t.general.attribution.panoramaxLicenseCCBYSA}/>
<Tr t={Translations.t.general.attribution.panoramaxLicenseCCBYSA} />
<span class="mx-1"></span>
<Tr t={t.respectPrivacy} />
</div>

File diff suppressed because it is too large Load diff