forked from MapComplete/MapComplete
UX: move some items behind login-toggles, add a 'login to add pictures' button again (fix #1698)
This commit is contained in:
parent
5168b42c8f
commit
4e1384c2df
4 changed files with 182 additions and 174 deletions
|
@ -12,6 +12,7 @@
|
||||||
import UploadingImageCounter from "./UploadingImageCounter.svelte"
|
import UploadingImageCounter from "./UploadingImageCounter.svelte"
|
||||||
import FileSelector from "../Base/FileSelector.svelte"
|
import FileSelector from "../Base/FileSelector.svelte"
|
||||||
import Camera_plus from "../../assets/svg/Camera_plus.svelte"
|
import Camera_plus from "../../assets/svg/Camera_plus.svelte"
|
||||||
|
import LoginButton from "../Base/LoginButton.svelte"
|
||||||
|
|
||||||
export let state: SpecialVisualizationState
|
export let state: SpecialVisualizationState
|
||||||
|
|
||||||
|
@ -44,7 +45,9 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<LoginToggle {state}>
|
<LoginToggle {state}>
|
||||||
<Tr slot="not-logged-in" t={t.pleaseLogin} />
|
<LoginButton slot="not-logged-in" clss="small w-full">
|
||||||
|
<Tr t={Translations.t.image.pleaseLogin} />
|
||||||
|
</LoginButton>
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<UploadingImageCounter {state} {tags} />
|
<UploadingImageCounter {state} {tags} />
|
||||||
<FileSelector
|
<FileSelector
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
theme: state?.layout?.id ?? "unknown",
|
theme: state?.layout?.id ?? "unknown",
|
||||||
specialMotivation: deleteReason,
|
specialMotivation: deleteReason,
|
||||||
},
|
},
|
||||||
canBeDeleted.data
|
canBeDeleted.data,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// no _delete_reason is given, which implies that this is _not_ a deletion but merely a retagging via a nonDeleteMapping
|
// no _delete_reason is given, which implies that this is _not_ a deletion but merely a retagging via a nonDeleteMapping
|
||||||
|
@ -82,6 +82,7 @@
|
||||||
currentState = "deleted"
|
currentState = "deleted"
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<LoginToggle ignoreLoading={true} {state}>
|
||||||
|
|
||||||
{#if $canBeDeleted === false && !hasSoftDeletion}
|
{#if $canBeDeleted === false && !hasSoftDeletion}
|
||||||
<div class="low-interaction flex flex-col">
|
<div class="low-interaction flex flex-col">
|
||||||
|
@ -89,7 +90,6 @@
|
||||||
<Tr cls="subtle" t={t.useSomethingElse} />
|
<Tr cls="subtle" t={t.useSomethingElse} />
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<LoginToggle ignoreLoading={true} {state}>
|
|
||||||
{#if currentState === "start"}
|
{#if currentState === "start"}
|
||||||
<button
|
<button
|
||||||
class="flex items-center"
|
class="flex items-center"
|
||||||
|
@ -158,5 +158,5 @@
|
||||||
<Tr t={t.isDeleted} />
|
<Tr t={t.isDeleted} />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</LoginToggle>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
</LoginToggle>
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
import AllImageProviders from "../../Logic/ImageProviders/AllImageProviders"
|
import AllImageProviders from "../../Logic/ImageProviders/AllImageProviders"
|
||||||
import Tr from "../Base/Tr.svelte"
|
import Tr from "../Base/Tr.svelte"
|
||||||
import Translations from "../i18n/Translations"
|
import Translations from "../i18n/Translations"
|
||||||
|
import LoginToggle from "../Base/LoginToggle.svelte"
|
||||||
|
|
||||||
export let tags: Store<OsmTags>
|
export let tags: Store<OsmTags>
|
||||||
export let state: SpecialVisualizationState
|
export let state: SpecialVisualizationState
|
||||||
|
@ -31,13 +32,13 @@
|
||||||
allowSpherical: new UIEventSource<boolean>(false),
|
allowSpherical: new UIEventSource<boolean>(false),
|
||||||
blacklist: AllImageProviders.LoadImagesFor(tags),
|
blacklist: AllImageProviders.LoadImagesFor(tags),
|
||||||
},
|
},
|
||||||
state.indexedFeatures
|
state.indexedFeatures,
|
||||||
)
|
)
|
||||||
|
|
||||||
let images: Store<P4CPicture[]> = imagesProvider.store.map((images) => images.slice(0, 20))
|
let images: Store<P4CPicture[]> = imagesProvider.store.map((images) => images.slice(0, 20))
|
||||||
let allDone = imagesProvider.allDone
|
let allDone = imagesProvider.allDone
|
||||||
</script>
|
</script>
|
||||||
|
<LoginToggle {state}>
|
||||||
<div class="interactive border-interactive rounded-2xl p-2">
|
<div class="interactive border-interactive rounded-2xl p-2">
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<h4>
|
<h4>
|
||||||
|
@ -59,3 +60,4 @@
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
</LoginToggle>
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
import { XCircleIcon } from "@babeard/svelte-heroicons/solid"
|
import { XCircleIcon } from "@babeard/svelte-heroicons/solid"
|
||||||
import exp from "constants"
|
import exp from "constants"
|
||||||
import Camera_plus from "../../assets/svg/Camera_plus.svelte"
|
import Camera_plus from "../../assets/svg/Camera_plus.svelte"
|
||||||
|
import LoginToggle from "../Base/LoginToggle.svelte"
|
||||||
|
|
||||||
export let tags: Store<OsmTags>
|
export let tags: Store<OsmTags>
|
||||||
export let state: SpecialVisualizationState
|
export let state: SpecialVisualizationState
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
|
|
||||||
let expanded = false
|
let expanded = false
|
||||||
</script>
|
</script>
|
||||||
|
<LoginToggle {state}>
|
||||||
|
|
||||||
{#if expanded}
|
{#if expanded}
|
||||||
<NearbyImages {tags} {state} {lon} {lat} {feature} {linkable}>
|
<NearbyImages {tags} {state} {lon} {lat} {feature} {linkable}>
|
||||||
|
@ -47,3 +49,4 @@
|
||||||
<Tr t={t.seeNearby} />
|
<Tr t={t.seeNearby} />
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
|
</LoginToggle>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue