From 9387cdca7073d97839e597f02715ad13b4007903 Mon Sep 17 00:00:00 2001 From: a-ill Date: Fri, 21 Jul 2023 18:07:22 +0300 Subject: [PATCH] Update --- Server/app/svelte/public/js/communes.js | 18 +++++++++++++++++- Server/app/svelte/public/js/groups.js | 2 -- Server/public/js/communes.js | 18 +++++++++++++++++- Server/public/js/groups.js | 2 -- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/Server/app/svelte/public/js/communes.js b/Server/app/svelte/public/js/communes.js index b3165fa..d79cab5 100644 --- a/Server/app/svelte/public/js/communes.js +++ b/Server/app/svelte/public/js/communes.js @@ -23,6 +23,12 @@ export let communes = [ status: "forming", members: 1, contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"] + }, + { + location: [["Switzerland"],[46.97045202584917, 8.05130091516525]], + status: "forming", + members: 1, + contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"] } ] @@ -39,6 +45,16 @@ for (let c of communes) { export let communesMarkersLayer = L.layerGroup() +export function translate(content, x) { + let out = content[x] + if (out==undefined) { + return x + } + else { + return out + } +} + export function addMarkersCommunes(map,content,locale) { for (let g of communes) { let coordinates @@ -55,7 +71,7 @@ export function addMarkersCommunes(map,content,locale) { locationString = location.map(x => x).join(", ") } else { - locationString = location.map(x => content[x]).join(", ") + locationString = location.map(x => translate(content, x)).join(", ") } text += fieldText + locationString + "
" diff --git a/Server/app/svelte/public/js/groups.js b/Server/app/svelte/public/js/groups.js index eede38c..61c3611 100644 --- a/Server/app/svelte/public/js/groups.js +++ b/Server/app/svelte/public/js/groups.js @@ -113,8 +113,6 @@ export function translate(content, x) { } } - - function addMarkersToLayer(g,layer,content,locale) { let coordinates let text = ""+content["Group"]+"
" diff --git a/Server/public/js/communes.js b/Server/public/js/communes.js index b3165fa..d79cab5 100644 --- a/Server/public/js/communes.js +++ b/Server/public/js/communes.js @@ -23,6 +23,12 @@ export let communes = [ status: "forming", members: 1, contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"] + }, + { + location: [["Switzerland"],[46.97045202584917, 8.05130091516525]], + status: "forming", + members: 1, + contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"] } ] @@ -39,6 +45,16 @@ for (let c of communes) { export let communesMarkersLayer = L.layerGroup() +export function translate(content, x) { + let out = content[x] + if (out==undefined) { + return x + } + else { + return out + } +} + export function addMarkersCommunes(map,content,locale) { for (let g of communes) { let coordinates @@ -55,7 +71,7 @@ export function addMarkersCommunes(map,content,locale) { locationString = location.map(x => x).join(", ") } else { - locationString = location.map(x => content[x]).join(", ") + locationString = location.map(x => translate(content, x)).join(", ") } text += fieldText + locationString + "
" diff --git a/Server/public/js/groups.js b/Server/public/js/groups.js index eede38c..61c3611 100644 --- a/Server/public/js/groups.js +++ b/Server/public/js/groups.js @@ -113,8 +113,6 @@ export function translate(content, x) { } } - - function addMarkersToLayer(g,layer,content,locale) { let coordinates let text = ""+content["Group"]+"
"