forked from MapComplete/MapComplete
UX: put text next to QR-code, regenerate all translations
This commit is contained in:
parent
a90387c4f3
commit
e48fed8d34
21 changed files with 139 additions and 57 deletions
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"id": "ambulancestation",
|
||||
"name": {
|
||||
"en": "Map of ambulance stations",
|
||||
"en": "Ambulance stations",
|
||||
"ja": "救急ステーションの地図",
|
||||
"ru": "Карта станций скорой помощи",
|
||||
"fr": "Couche des ambulances",
|
||||
"de": "Rettungswachen",
|
||||
"it": "Carta delle stazioni delle ambulanze",
|
||||
"hu": "Mentőállomás-térkép",
|
||||
"nl": "Kaart van ambulancestations",
|
||||
"nl": "Ambulancestations",
|
||||
"zh_Hans": "救护车站地图",
|
||||
"id": "Peta stasiun ambulans",
|
||||
"es": "Mapa de estaciones de ambulancias",
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"id": "extinguisher",
|
||||
"name": {
|
||||
"en": "Map of fire extinguishers",
|
||||
"en": "Fire extinguishers",
|
||||
"ja": "消火器の地図です。",
|
||||
"nb_NO": "Kart over brannhydranter",
|
||||
"ru": "Карта огнетушителей.",
|
||||
"fr": "Couche des extincteurs",
|
||||
"de": "Feuerlöscher",
|
||||
"it": "Mappa degli estintori",
|
||||
"nl": "Kaart van brandblussers",
|
||||
"nl": "Brandblussers",
|
||||
"es": "Mapa de extintores",
|
||||
"ca": "Mapa d'extintors",
|
||||
"pl": "Mapa gaśnic",
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"id": "fire_station",
|
||||
"name": {
|
||||
"en": "Map of fire stations",
|
||||
"en": "Fire stations",
|
||||
"ja": "消防署の地図",
|
||||
"nb_NO": "Kart over brannstasjoner",
|
||||
"it": "Mappa delle caserme dei vigili del fuoco",
|
||||
"ru": "Карта пожарных частей",
|
||||
"fr": "Couche des stations de pompiers",
|
||||
"de": "Feuerwachen",
|
||||
"nl": "Kaart van de brandweerstations",
|
||||
"nl": "Brandweerstations",
|
||||
"es": "Mapa de estaciones de bomberos",
|
||||
"ca": "Mapa de parcs de bombers",
|
||||
"cs": "Mapa požárních stanic"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "hydrant",
|
||||
"name": {
|
||||
"en": "Map of hydrants",
|
||||
"en": "Hydrants",
|
||||
"ja": "消火栓の地図",
|
||||
"zh_Hant": "消防栓地圖",
|
||||
"nb_NO": "Kart over brannhydranter",
|
||||
|
@ -9,7 +9,7 @@
|
|||
"fr": "Carte des bornes incendie",
|
||||
"de": "Hydranten",
|
||||
"it": "Mappa degli idranti",
|
||||
"nl": "Kaart van brandkranen",
|
||||
"nl": "Brandkranen",
|
||||
"es": "Mapa de bocas de incendio",
|
||||
"ca": "Mapa d'hidrants",
|
||||
"cs": "Mapa hydrantů",
|
||||
|
|
|
@ -3084,9 +3084,8 @@
|
|||
"classes": "flex items-center gap-x-2",
|
||||
"render": {
|
||||
"special": {
|
||||
"type": "qr_code"
|
||||
},
|
||||
"after": {
|
||||
"type": "qr_code",
|
||||
"text": {
|
||||
"en": "Scan this code to open this location on another device",
|
||||
"nl": "Scan deze code om deze locatie op een ander apparaat te zien",
|
||||
"de": "QR Code scannen, um diesen Ort auf einem anderen Gerät zu öffnen",
|
||||
|
@ -3098,6 +3097,7 @@
|
|||
"cs": "Naskenováním tohoto kódu otevřete toto umístění na jiném zařízení",
|
||||
"ca": "Escaneja aquest codi per obrir aquesta ubicació en un altre dispositiu",
|
||||
"it": "Scansiona questo codice per aprire questa posizione su un altro dispositivo"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1549,7 +1549,7 @@
|
|||
"special": {
|
||||
"type": "group",
|
||||
"header": "share-login-group-title",
|
||||
"labels": "share-login-qr"
|
||||
"labels": "share-login-content"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1565,11 +1565,30 @@
|
|||
{
|
||||
"id": "share-login-qr",
|
||||
"labels": [
|
||||
"hidden"
|
||||
"hidden",
|
||||
"share-login-content"
|
||||
],
|
||||
"render": {
|
||||
"special": {
|
||||
"type": "qr_login"
|
||||
"type": "qr_login",
|
||||
"text": "Everyone with this QR-code can act as {_name}",
|
||||
"textClass": "alert h-fit"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "share-login-revoke",
|
||||
"labels": [
|
||||
"hidden",
|
||||
"share-login-content"
|
||||
],
|
||||
"render": {
|
||||
"special": {
|
||||
"type": "link",
|
||||
"href": "https://www.openstreetmap.org/oauth2/authorized_applications",
|
||||
"text": {
|
||||
"en": "You can revoke access here"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -10,6 +10,16 @@
|
|||
"ko": "MapComplete로 이루어진 변경 사항",
|
||||
"it": "Modifiche fatte con MapComplete"
|
||||
},
|
||||
"shortDescription": {
|
||||
"en": "Shows changes made by MapComplete",
|
||||
"de": "Zeigt die von MapComplete vorgenommenen Änderungen an",
|
||||
"cs": "Zobrazuje změny provedené nástrojem MapComplete",
|
||||
"es": "Muestra los cambios realizados por MapComplete",
|
||||
"fr": "Afficher les modifications faites avec MapComplete",
|
||||
"nl": "Toont wijzigingen gemaakt met MapComplete",
|
||||
"ko": "MapComplete를 통해 이루어진 변경 사항을 표시합니다",
|
||||
"it": "Mostra le modifiche fatte con MapComplete"
|
||||
},
|
||||
"description": {
|
||||
"en": "This maps shows all the changes made with MapComplete",
|
||||
"de": "Diese Karte zeigt alle mit MapComplete vorgenommenen Änderungen",
|
||||
|
@ -21,18 +31,11 @@
|
|||
"ko": "이 지도는 MapComplete를 사용하여 이루어진 모든 변경 사항을 표시합니다",
|
||||
"it": "Questa mappa mostra tutte le modifiche effettuate con MapComplete"
|
||||
},
|
||||
"shortDescription": {
|
||||
"en": "Shows changes made by MapComplete",
|
||||
"de": "Zeigt die von MapComplete vorgenommenen Änderungen an",
|
||||
"cs": "Zobrazuje změny provedené nástrojem MapComplete",
|
||||
"es": "Muestra los cambios realizados por MapComplete",
|
||||
"fr": "Afficher les modifications faites avec MapComplete",
|
||||
"nl": "Toont wijzigingen gemaakt met MapComplete",
|
||||
"ko": "MapComplete를 통해 이루어진 변경 사항을 표시합니다",
|
||||
"it": "Mostra le modifiche fatte con MapComplete"
|
||||
},
|
||||
"icon": "./assets/svg/logo.svg",
|
||||
"hideFromOverview": true,
|
||||
"startLat": 0,
|
||||
"startLon": 0,
|
||||
"startZoom": 1,
|
||||
"layers": [
|
||||
{
|
||||
"id": "mapcomplete-changes",
|
||||
|
@ -426,6 +429,14 @@
|
|||
"if": "theme=healthcare",
|
||||
"then": "./assets/layers/doctors/doctors.svg"
|
||||
},
|
||||
{
|
||||
"if": "theme=historic_aircraft",
|
||||
"then": "./assets/svg/airport.svg"
|
||||
},
|
||||
{
|
||||
"if": "theme=historic_rolling_stock",
|
||||
"then": "./assets/layers/historic_rolling_stock/steam_locomotive.svg"
|
||||
},
|
||||
{
|
||||
"if": "theme=hotels",
|
||||
"then": "./assets/layers/tourism_accomodation/hotel.svg"
|
||||
|
|
|
@ -9157,7 +9157,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Escaneja aquest codi per obrir aquesta ubicació en un altre dispositiu"
|
||||
"text": "Escaneja aquest codi per obrir aquesta ubicació en un altre dispositiu"
|
||||
}
|
||||
},
|
||||
"repeated": {
|
||||
|
|
|
@ -8406,7 +8406,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Naskenováním tohoto kódu otevřete toto umístění na jiném zařízení"
|
||||
"text": "Naskenováním tohoto kódu otevřete toto umístění na jiném zařízení"
|
||||
}
|
||||
},
|
||||
"repeated": {
|
||||
|
|
|
@ -1835,7 +1835,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Skan denne kode for at åbne dette sted på en anden enhed"
|
||||
"text": "Skan denne kode for at åbne dette sted på en anden enhed"
|
||||
}
|
||||
},
|
||||
"service:electricity": {
|
||||
|
|
|
@ -9121,7 +9121,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "QR Code scannen, um diesen Ort auf einem anderen Gerät zu öffnen"
|
||||
"text": "QR Code scannen, um diesen Ort auf einem anderen Gerät zu öffnen"
|
||||
}
|
||||
},
|
||||
"repeated": {
|
||||
|
|
|
@ -423,7 +423,7 @@
|
|||
},
|
||||
"ambulancestation": {
|
||||
"description": "An ambulance station is an area for storage of ambulance vehicles, medical equipment, personal protective equipment, and other medical supplies.",
|
||||
"name": "Ambulance stations",
|
||||
"name": "Ambulance stations",
|
||||
"presets": {
|
||||
"0": {
|
||||
"description": "Add an ambulance station to the map",
|
||||
|
@ -2401,6 +2401,20 @@
|
|||
"Name": {
|
||||
"question": "What is the name of this business?",
|
||||
"render": "This business is named {name}"
|
||||
},
|
||||
"pub_reusable_packaging": {
|
||||
"mappings": {
|
||||
"0": {
|
||||
"then": "Accepts reusable cups"
|
||||
},
|
||||
"1": {
|
||||
"then": "Does not accept reusable cups"
|
||||
},
|
||||
"2": {
|
||||
"then": "<b>Only</b> serves to people who bring reusable cups"
|
||||
}
|
||||
},
|
||||
"question": "Does {title()} accept bring-your-own reusable cups?"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
|
@ -5511,7 +5525,7 @@
|
|||
},
|
||||
"extinguisher": {
|
||||
"description": "Map layer to show fire extinguishers.",
|
||||
"name": "Fire extinguishers",
|
||||
"name": "Fire extinguishers",
|
||||
"presets": {
|
||||
"0": {
|
||||
"description": "A fire extinguisher is a small, portable device used to stop a fire",
|
||||
|
@ -5703,7 +5717,7 @@
|
|||
},
|
||||
"fire_station": {
|
||||
"description": "Map layer to show fire stations.",
|
||||
"name": "Fire stations",
|
||||
"name": "Fire stations",
|
||||
"presets": {
|
||||
"0": {
|
||||
"description": "A fire station is a place where the fire trucks and firefighters are located when not in operation.",
|
||||
|
@ -6828,6 +6842,10 @@
|
|||
}
|
||||
},
|
||||
"question": "Does this also serve as a memorial?"
|
||||
},
|
||||
"model": {
|
||||
"question": "What is the model of this rolling stock?",
|
||||
"render": "Model <b>{model}</b>"
|
||||
}
|
||||
},
|
||||
"title": {
|
||||
|
@ -6880,7 +6898,7 @@
|
|||
},
|
||||
"hydrant": {
|
||||
"description": "Map layer to show fire hydrants.",
|
||||
"name": "Hydrants",
|
||||
"name": "Hydrants",
|
||||
"presets": {
|
||||
"0": {
|
||||
"description": "A hydrant is a connection point where firefighters can tap water. It might be located underground.",
|
||||
|
@ -9692,7 +9710,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Scan this code to open this location on another device"
|
||||
"text": "Scan this code to open this location on another device"
|
||||
}
|
||||
},
|
||||
"ref": {
|
||||
|
@ -13833,6 +13851,15 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"share-login-explanation": {
|
||||
"render": "With the below QR-code, you can login on another device without having to share your password"
|
||||
},
|
||||
"share-login-group-title": {
|
||||
"render": "Allow to log in and act as <b>{_name}</b>"
|
||||
},
|
||||
"share-login-title": {
|
||||
"render": "<h3>Login via QR code</h3>"
|
||||
},
|
||||
"show_crosshair": {
|
||||
"mappings": {
|
||||
"0": {
|
||||
|
@ -14763,4 +14790,4 @@
|
|||
"render": "wind turbine"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8733,7 +8733,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Escanea este código para abrir esta ubicación en otro dispositivo"
|
||||
"text": "Escanea este código para abrir esta ubicación en otro dispositivo"
|
||||
}
|
||||
},
|
||||
"repeated": {
|
||||
|
|
|
@ -944,7 +944,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Szkenneld be ezt a kódot, hogy egy másik eszközön is meg tudd nyitni a helyet"
|
||||
"text": "Szkenneld be ezt a kódot, hogy egy másik eszközön is meg tudd nyitni a helyet"
|
||||
}
|
||||
},
|
||||
"service:electricity": {
|
||||
|
|
|
@ -9609,7 +9609,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Scansiona questo codice per aprire questa posizione su un altro dispositivo"
|
||||
"text": "Scansiona questo codice per aprire questa posizione su un altro dispositivo"
|
||||
}
|
||||
},
|
||||
"repeated": {
|
||||
|
|
|
@ -409,7 +409,7 @@
|
|||
},
|
||||
"ambulancestation": {
|
||||
"description": "Een ambulancestation is een plaats waar ambulances, medisch materiaal, persoonlijk beschermingsmateriaal en aanverwanten worden bewaard.",
|
||||
"name": "Ambulancestations",
|
||||
"name": "Ambulancestations",
|
||||
"presets": {
|
||||
"0": {
|
||||
"description": "Voeg een ambulancestation toe aan de kaart",
|
||||
|
@ -5140,7 +5140,7 @@
|
|||
},
|
||||
"extinguisher": {
|
||||
"description": "Kaartlaag met brandblussers.",
|
||||
"name": "Brandblussers",
|
||||
"name": "Brandblussers",
|
||||
"presets": {
|
||||
"0": {
|
||||
"description": "Een brandblusser is een klein, draagbaar apparaat om een brand te blussen",
|
||||
|
@ -5269,7 +5269,7 @@
|
|||
},
|
||||
"fire_station": {
|
||||
"description": "Kaartlaag die de brandweerstations toont.",
|
||||
"name": "Brandweerstations",
|
||||
"name": "Brandweerstations",
|
||||
"presets": {
|
||||
"0": {
|
||||
"description": "Een brandweerstation is een plaats waar brandweerwagens en brandweerlieden gebaseerd zijn.",
|
||||
|
@ -6010,7 +6010,7 @@
|
|||
},
|
||||
"hydrant": {
|
||||
"description": "Kaartlaag met brandkranen.",
|
||||
"name": "Brandkranen",
|
||||
"name": "Brandkranen",
|
||||
"presets": {
|
||||
"0": {
|
||||
"description": "Een brandkraan is een kraan waar brandweerlieden een brandslang kunnen aansluiten. Soms zit deze ondergronds.",
|
||||
|
@ -8183,7 +8183,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Scan deze code om deze locatie op een ander apparaat te zien"
|
||||
"text": "Scan deze code om deze locatie op een ander apparaat te zien"
|
||||
}
|
||||
},
|
||||
"repeated": {
|
||||
|
@ -11638,4 +11638,4 @@
|
|||
"render": "windturbine"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -239,7 +239,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Skenirajte to kodo, da odprete ta kraj na drugi napravi"
|
||||
"text": "Skenirajte to kodo, da odprete ta kraj na drugi napravi"
|
||||
}
|
||||
},
|
||||
"single_level": {
|
||||
|
|
|
@ -1919,7 +1919,7 @@
|
|||
},
|
||||
"qr_code": {
|
||||
"render": {
|
||||
"after": "Відскануйте цей код, щоб відкрити це місце на іншому пристрої"
|
||||
"text": "Відскануйте цей код, щоб відкрити це місце на іншому пристрої"
|
||||
}
|
||||
},
|
||||
"share": {
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
<script lang="ts">
|
||||
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
||||
import { ImmutableStore, Store, UIEventSource } from "../../Logic/UIEventSource"
|
||||
import type { SpecialVisualizationState } from "../SpecialVisualization"
|
||||
import type { Feature } from "geojson"
|
||||
import Loading from "../Base/Loading.svelte"
|
||||
import Qr from "../../Utils/Qr"
|
||||
import { GeoOperations } from "../../Logic/GeoOperations"
|
||||
|
||||
import { Utils } from "../../Utils"
|
||||
const smallSize = 100
|
||||
const bigSize = 200
|
||||
let size = new UIEventSource(smallSize)
|
||||
|
||||
export let state: SpecialVisualizationState
|
||||
export let tags: UIEventSource<Record<string, string>>
|
||||
export let feature: Feature
|
||||
export let extraUrlParams: Record<string, string> = {}
|
||||
export let sideText: string = undefined
|
||||
export let sideTextClass: string = undefined
|
||||
|
||||
const includeLayout = window.location.pathname.split("/").at(-1).startsWith("theme")
|
||||
let id: Store<string> = tags.mapD((tags) => tags.id)
|
||||
|
@ -26,9 +27,11 @@
|
|||
extraUrlParams["lon"] ??= "" + lon
|
||||
extraUrlParams["lat"] ??= "" + lat
|
||||
} else if (state?.mapProperties?.location?.data) {
|
||||
const l = state?.mapProperties?.location?.data
|
||||
extraUrlParams["lon"] ??= "" + l.lon
|
||||
extraUrlParams["lat"] ??= "" + l.lat
|
||||
const l: { lon: number; lat: number } = state?.mapProperties?.location?.data
|
||||
if (l.lon !== 0 && l.lat !== 0) {
|
||||
extraUrlParams["lon"] ??= "" + l.lon
|
||||
extraUrlParams["lat"] ??= "" + l.lat
|
||||
}
|
||||
}
|
||||
|
||||
const params = []
|
||||
|
@ -55,16 +58,22 @@
|
|||
}
|
||||
}
|
||||
|
||||
url.addCallbackAndRunD(url => console.log("URL IS", url))
|
||||
let sideTextSub = (tags ?? new ImmutableStore({})).map(tgs => Utils.SubstituteKeys(sideText, tgs))
|
||||
</script>
|
||||
|
||||
{#if $id?.startsWith("node/-")}
|
||||
<!-- Not yet uploaded, doesn't have a fixed ID -->
|
||||
<Loading />
|
||||
{:else}
|
||||
<img
|
||||
<div class="flex w-full items-center my-4">
|
||||
<img
|
||||
class="shrink-0"
|
||||
on:click={() => toggleSize()}
|
||||
src={new Qr($url).toImageElement($size)}
|
||||
style={`width: ${$size}px; height: ${$size}px`}
|
||||
/>
|
||||
{#if sideText}
|
||||
<div class={sideTextClass}>{ $sideTextSub}</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
|
|
@ -151,15 +151,23 @@ export class SettingsVisualisations {
|
|||
},
|
||||
{
|
||||
funcName: "qr_login",
|
||||
args: [],
|
||||
args: [{
|
||||
name: "text",
|
||||
doc: "Extra text on the side of the QR-code"
|
||||
}, {
|
||||
name: "textClass",
|
||||
doc: "CSS class of the the side text"
|
||||
}],
|
||||
docs: "A QR-code which shares the current URL and adds the login token. Anyone with this login token will have the same permissions as you currently have. Logging out from this session will also log them out",
|
||||
group: "settings",
|
||||
constr(state: SpecialVisualizationState, tags: UIEventSource<Record<string, string>>, argument: string[], feature: Feature, layer: LayerConfig): SvelteUIElement {
|
||||
const shared_oauth_cookie = state.osmConnection.getToken()
|
||||
const sideText = argument[0]
|
||||
const sideTextClass = argument[1] ?? ""
|
||||
return new SvelteUIElement(QrCode, {
|
||||
state,
|
||||
tags,
|
||||
feature,
|
||||
sideText, sideTextClass,
|
||||
extraUrlParams: { shared_oauth_cookie }
|
||||
})
|
||||
}
|
||||
|
|
|
@ -174,7 +174,13 @@ export class UISpecialVisualisations {
|
|||
},
|
||||
{
|
||||
funcName: "qr_code",
|
||||
args: [],
|
||||
args: [{
|
||||
name: "text",
|
||||
doc: "Extra text on the side of the QR-code"
|
||||
}, {
|
||||
name: "textClass",
|
||||
doc: "CSS class of the the side text"
|
||||
}],
|
||||
group: "default",
|
||||
docs: "Generates a QR-code to share the selected object",
|
||||
constr(
|
||||
|
@ -183,7 +189,9 @@ export class UISpecialVisualisations {
|
|||
argument: string[],
|
||||
feature: Feature
|
||||
): SvelteUIElement {
|
||||
return new SvelteUIElement(QrCode, { state, tags, feature })
|
||||
const sideText = argument[0]
|
||||
const sideTextClass = argument[1] ?? ""
|
||||
return new SvelteUIElement(QrCode, { state, tags, feature, sideText, sideTextClass })
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue