Update
This commit is contained in:
@@ -1,26 +1,40 @@
|
||||
|
||||
export let communities = [
|
||||
{
|
||||
location: ["Estonia, Kohtla-Järve",[59.409521829709504, 27.288415912535914]],
|
||||
status: "forming",
|
||||
location: [{
|
||||
en: "Estonia, Kohtla-Järve",
|
||||
ru: "Эстония, Кохтла-Ярве"
|
||||
},
|
||||
[59.409521829709504, 27.288415912535914]],
|
||||
status: {
|
||||
en: "forming",
|
||||
ru: "формируется"
|
||||
},
|
||||
members: 2,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsApp invite link"]
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh",
|
||||
{
|
||||
en: "WhatsApp invite link",
|
||||
ru: "WhatsApp ссылка"
|
||||
}]
|
||||
}
|
||||
]
|
||||
|
||||
export function addMarkersCommunities(map) {
|
||||
export function addMarkersCommunities(map,content,locale) {
|
||||
for (let g of communities) {
|
||||
let coordinates
|
||||
let text = ""
|
||||
for (let field in g) {
|
||||
let fieldText = field[0].toUpperCase() + field.slice(1) + ": "
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact[0] + "' target='_blank' rel=noreferrer>" + g.contact[1] + "</a>"
|
||||
text += fieldText + "<a href='" + g.contact[0] + "' target='_blank' rel=noreferrer>" + g.contact[1][locale[0]] + "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
text += fieldText + g[field][0] + "<br>"
|
||||
text += fieldText + g[field][0][locale[0]] + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else if (field=="status") {
|
||||
text += fieldText + g[field][locale[0]] + "<br>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
|
@@ -2,46 +2,88 @@ export let coops = [
|
||||
{
|
||||
logo: "chiron_logo",
|
||||
name: "Chiron Health",
|
||||
location: ["Estonia, Kohtla-Järve",[59.40338782864918, 27.286240058760324]],
|
||||
market: "wellness and health",
|
||||
location: [
|
||||
{
|
||||
en: "Estonia, Kohtla-Järve",
|
||||
ru: "Эстония, Кохтла-Ярве"
|
||||
},
|
||||
[59.40338782864918, 27.286240058760324]],
|
||||
market: {
|
||||
en: "wellness and health",
|
||||
ru: "благополучие и здоровье"
|
||||
},
|
||||
workers: 2,
|
||||
status: "launch in 2 months",
|
||||
status: {
|
||||
en: "launch in 2 months",
|
||||
ru: "запуск через 2 месяца"
|
||||
},
|
||||
website: "chrn.health",
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsApp invite link"],
|
||||
description: "Chiron Health is a health platform providing courses and services on the topics of nutrition, exercise, sleep and mental wellbeing.",
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh",
|
||||
{
|
||||
en: "WhatsApp invite link",
|
||||
ru: "WhatsApp ссылка"
|
||||
}],
|
||||
description: {
|
||||
en: "Chiron Health is a health platform providing courses and services on the topics of nutrition, exercise, sleep and mental wellbeing.",
|
||||
ru: "Chiron Health — это платформа о здоровье, предлагающая курсы и услуги по вопросам питания, физических упражнений, сна и психического благополучия"
|
||||
}
|
||||
},
|
||||
{
|
||||
logo: "kuusk_logo",
|
||||
name: "Kuusk",
|
||||
location: ["Estonia, Kohtla-Järve",[59.405466538976185, 27.289104862336302]],
|
||||
market: "herbal teas",
|
||||
location: [
|
||||
{
|
||||
en: "Estonia, Kohtla-Järve",
|
||||
ru: "Эстония, Кохтла-Ярве"
|
||||
},
|
||||
[59.405466538976185, 27.289104862336302]],
|
||||
market: {
|
||||
en: "herbal teas",
|
||||
ru: "травяные чаи"
|
||||
},
|
||||
workers: 1,
|
||||
status: "launch in TBD months",
|
||||
status: {
|
||||
en: "launch in TBD months",
|
||||
ru: "запуск через X месяцев"
|
||||
},
|
||||
website: "-",
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsApp invite link"],
|
||||
description: "Kuusk is an online store that sells herbal teas from exclusively local wild plants, as well as an online gathering course.",
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh",
|
||||
{
|
||||
en: "WhatsApp invite link",
|
||||
ru: "WhatsApp ссылка"
|
||||
}],
|
||||
description: {
|
||||
en: "Kuusk is an online store that sells herbal teas from exclusively local wild plants, as well as an online gathering course.",
|
||||
ru: "Kuusk — интернет-магазин, в котором продаются травяные чаи исключительно из местных дикорастущих растений, а также онлайн-курс по собирательству."
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
export function addMarkersCoops(map) {
|
||||
export function addMarkersCoops(map,content,locale) {
|
||||
for (let g of coops) {
|
||||
let coordinates
|
||||
let text = ""
|
||||
for (let field in g) {
|
||||
let fieldText = "<b>" + field[0].toUpperCase() + field.slice(1) + ": " + "</b>"
|
||||
let fieldText
|
||||
if (field!="logo") {
|
||||
fieldText = content[field] + ": "
|
||||
}
|
||||
if (field=="logo") {
|
||||
text += "<picture><source srcset=" + "/img/coops/" + g.logo + ".webp><source srcset='/img/coops/" + g.logo + ".png'><img alt='logo' style='position: relative; max-height: 5rem; max-width: 100%; margin: auto;'></picture>" + "<br>"
|
||||
}
|
||||
else if (field=="contact") {
|
||||
text += fieldText + "<a href='https://www." + g.contact[0] + "' target='_blank' rel=noreferrer>" + g.contact[1] + "</a>" + "<br>"
|
||||
text += fieldText + "<a href='https://www." + g.contact[0] + "' target='_blank' rel=noreferrer>" + g.contact[1][locale[0]] + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="website") {
|
||||
text += fieldText + "<a href='" + g.website + "' target='_blank' rel=noreferrer>" + g.website + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
text += fieldText + g[field][0] + "<br>"
|
||||
text += fieldText + g[field][0][locale[0]] + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else if (field=="market" || field=="status" || field=="description") {
|
||||
text += fieldText + g[field][locale[0]] + "<br>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
|
@@ -1,37 +1,73 @@
|
||||
export let groups = [
|
||||
{
|
||||
location: ["Denmark, Copenhagen",[55.6840661150132, 12.557133959514688]],
|
||||
location: [
|
||||
{
|
||||
en: "Denmark, Copenhagen",
|
||||
ru: "Дания, Копенгаген"
|
||||
},
|
||||
[55.6840661150132, 12.557133959514688]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/xAPZmyr8B6","Discord invite link"]
|
||||
contact: ["https://discord.gg/xAPZmyr8B6",
|
||||
{
|
||||
en: "WhatsApp invite link",
|
||||
ru: "Discord ссылка"
|
||||
}]
|
||||
},
|
||||
{
|
||||
location: ["Estonia, Kohtla-Järve",[59.40629447076191, 27.280605339416322]],
|
||||
location: [
|
||||
{
|
||||
en: "Estonia, Kohtla-Järve",
|
||||
ru: "Эстония, Кохтла-Ярве"
|
||||
},
|
||||
[59.40629447076191, 27.280605339416322]],
|
||||
members: 3,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsApp invite link"]
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh",
|
||||
{
|
||||
en: "WhatsApp invite link",
|
||||
ru: "WhatsApp ссылка"
|
||||
}]
|
||||
},
|
||||
{
|
||||
location: ["Greece, Athens",[37.94877252621736, 23.677622972996158]],
|
||||
location: [
|
||||
{
|
||||
en: "Greece, Athens",
|
||||
ru: "Греция, Афины"
|
||||
},
|
||||
[37.94877252621736, 23.677622972996158]],
|
||||
members: 1,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsApp invite link"]
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh",
|
||||
{
|
||||
en: "WhatsApp invite link",
|
||||
ru: "WhatsApp ссылка"
|
||||
}]
|
||||
},
|
||||
{
|
||||
location: ["Latvia, Riga",[56.94748425529816, 24.003027136431925]],
|
||||
location: [
|
||||
{
|
||||
en: "Latvia, Riga",
|
||||
ru: "Латвия, Рига"
|
||||
},
|
||||
[56.94748425529816, 24.003027136431925]],
|
||||
members: 2,
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh","WhatsApp invite link"]
|
||||
contact: ["https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh",
|
||||
{
|
||||
en: "WhatsApp invite link",
|
||||
ru: "WhatsApp ссылка"
|
||||
}]
|
||||
},
|
||||
]
|
||||
|
||||
export function addMarkersGroups(map) {
|
||||
export function addMarkersGroups(map,content,locale) {
|
||||
for (let g of groups) {
|
||||
let coordinates
|
||||
let text = ""
|
||||
for (let field in g) {
|
||||
let fieldText = field[0].toUpperCase() + field.slice(1) + ": "
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact[0] + "' target='_blank' rel=noreferrer>" + g.contact[1] + "</a>"
|
||||
text += fieldText + "<a href='" + g.contact[0] + "' target='_blank' rel=noreferrer>" + g.contact[1][locale[0]] + "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
text += fieldText + g[field][0] + "<br>"
|
||||
text += fieldText + g[field][0][locale[0]] + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else {
|
||||
|
@@ -62,3 +62,47 @@ export function sendText(route,data,callback) {
|
||||
xhr.send(data)
|
||||
}
|
||||
|
||||
function onlyUnique(value, index, array) {
|
||||
return array.indexOf(value) === index;
|
||||
}
|
||||
|
||||
export function loadLocaleContent(content,componentName,loaded,callback) {
|
||||
let langs
|
||||
let localesAvailable
|
||||
let locale = localStorage.getItem("locale")
|
||||
if (locale==null) {
|
||||
langs = navigator.languages.map(x => x.split("-")[0]).filter(onlyUnique)
|
||||
}
|
||||
getData("/locales/available.json",function(response) {
|
||||
if (locale!=null) {
|
||||
getData("/locales/" + locale + "/" + componentName + ".json" ,function(response) {
|
||||
let parsed = JSON.parse(response)
|
||||
content.set(parsed)
|
||||
if (callback!=undefined) {
|
||||
callback(locale)
|
||||
}
|
||||
loaded = 1
|
||||
})
|
||||
}
|
||||
else {
|
||||
localesAvailable = JSON.parse(response)
|
||||
for (let lang of langs) {
|
||||
if (localesAvailable.includes(lang)) {
|
||||
getData("/locales/" + lang + "/" + componentName + ".json" ,function(response) {
|
||||
let parsed = JSON.parse(response)
|
||||
content.set(parsed)
|
||||
if (callback!=undefined) {
|
||||
callback(locale)
|
||||
}
|
||||
loaded = 1
|
||||
})
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function getLocale(locale,lang) {
|
||||
locale[0] = lang
|
||||
}
|
Reference in New Issue
Block a user