Moved all entries to db
This commit is contained in:
@@ -1,99 +0,0 @@
|
||||
|
||||
export let communes = [
|
||||
{
|
||||
location: [["Canada","Montreal"],[45.55541047232767, -73.42859611607271]],
|
||||
status: "forming",
|
||||
members: 2,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Denmark"],[55.915625218626275, 9.673445220831253]],
|
||||
status: "forming",
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Estonia","Kohtla-Jarve"],[59.409521829709504, 27.288415912535914]],
|
||||
status: "forming",
|
||||
members: 2,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Latvia"],[56.934159375258055, 25.269099001330265]],
|
||||
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"]
|
||||
}
|
||||
]
|
||||
|
||||
export let communesByCountry = {}
|
||||
for (let c of communes) {
|
||||
let country = c.location[0][0]
|
||||
if (country in communesByCountry) {
|
||||
communesByCountry[country].push(c)
|
||||
}
|
||||
else {
|
||||
communesByCountry[country] = [c]
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
let text = "<b>"+content["Commune"]+"</b><br>"
|
||||
for (let field in g) {
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact[0] + "' target='_blank' rel=noreferrer>" + content[g.contact[1]]+ "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = g[field][0]
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location.map(x => x).join(", ")
|
||||
}
|
||||
else {
|
||||
locationString = location.map(x => translate(content, x)).join(", ")
|
||||
}
|
||||
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else if (field=="status") {
|
||||
text += fieldText + content[g[field]] + "<br>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
var markerIcon = new L.Icon({
|
||||
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-red.png',
|
||||
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
});
|
||||
let marker = L.marker(coordinates, {icon: markerIcon})
|
||||
marker.addTo(communesMarkersLayer).bindPopup(text)
|
||||
}
|
||||
communesMarkersLayer.addTo(map)
|
||||
}
|
@@ -1,79 +0,0 @@
|
||||
export let coops = [
|
||||
{
|
||||
logo: "chiron_logo",
|
||||
name: "Chiron Health",
|
||||
location: [["Estonia","Kohtla-Järve"],[59.41038769769602, 27.287802936242034]],
|
||||
market: "wellnessAndHealth",
|
||||
workers: 2,
|
||||
status: "inDevelopment",
|
||||
website: ["https://www.chrn.health/", "chrn.health"],
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"],
|
||||
description: "descriptionChironHealth"
|
||||
},
|
||||
{
|
||||
logo: "kuusk_logo",
|
||||
name: "Kuusk",
|
||||
location: [["Estonia","Kohtla-Järve"],[59.399947051803004, 27.277159931677055]],
|
||||
market: "herbalTeas",
|
||||
workers: 1,
|
||||
status: "inDevelopment",
|
||||
website: ["-","-"],
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"],
|
||||
description: "kuuskDescription"
|
||||
}
|
||||
]
|
||||
|
||||
export let coopsByCountry = {}
|
||||
for (let g of coops) {
|
||||
let country = g.location[0][0]
|
||||
if (country in coopsByCountry) {
|
||||
coopsByCountry[country].push(g)
|
||||
}
|
||||
else {
|
||||
coopsByCountry[country] = [g]
|
||||
}
|
||||
}
|
||||
|
||||
export let coopsMarkersLayer = L.layerGroup()
|
||||
|
||||
export function addMarkersCoops(map,content,locale) {
|
||||
for (let g of coops) {
|
||||
let coordinates
|
||||
let text = "<b>"+content["Cooperative"]+"</b><br>"
|
||||
for (let field in g) {
|
||||
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>" + content[g.contact[1]] + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="website") {
|
||||
text += fieldText + "<a href='" + g.website[0] + "' target='_blank' rel=noreferrer>" + g.website[1] + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = g[field][0]
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location.map(x => x).join(", ")
|
||||
}
|
||||
else {
|
||||
locationString = location.map(x => content[x]).join(", ")
|
||||
}
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else if (field=="market" || field=="status" || field=="description") {
|
||||
text += fieldText + content[g[field]] + "<br>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
L.marker(coordinates).addTo(coopsMarkersLayer).bindPopup(text)
|
||||
}
|
||||
coopsMarkersLayer.addTo(map)
|
||||
}
|
@@ -1,198 +0,0 @@
|
||||
/*
|
||||
export let groups = [
|
||||
{
|
||||
location: [["Bulgaria","Varna"],[43.21582161671174, 27.89896092161012]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Canada","Halifax"],[44.65166135030067, -63.59289968306866]],
|
||||
members: 2,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Canada","Toronto"], [43.6960589794647, -79.37396957644577]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Denmark","Copenhagen"],[55.6840661150132, 12.557133959514688]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Denmark","Kolding"], [55.49261908652738, 9.470268969851743]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Estonia","Kohtla-Järve"], [59.40629447076191, 27.280605339416322]],
|
||||
members: 3,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Estonia","Tallinn"], [59.39180354687856, 24.72304565687877]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Germany","Wiesbaden"], [50.07459620869791, 8.234984059337897]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Greece","Athens"], [37.94877252621736, 23.677622972996158]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Ireland"], [53.280192832733576, -7.688103518964818]],
|
||||
members: 6,
|
||||
contact: ["https://discord.gg/4BUau4AZre","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Latvia","Riga"], [56.94748425529816, 24.003027136431925]],
|
||||
members: 2,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["USA","Florida"], [26.945024427155868, -81.22162645059898]],
|
||||
members: 2,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["USA","Colorado","Louisville"], [39.965026323855334, -105.15948886693151]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["USA","Georgia"], [33.91813982808364, -84.38058579763135]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["USA","Ohio"], [40.18243610076637, -83.07800532738788]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Thailand","Chiang Mai"], [18.788343253574393, 98.99423221087719]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
},
|
||||
{
|
||||
location: [["Switzerland","Cham"], [47.18298143153399, 8.460076421717238]],
|
||||
members: 1,
|
||||
contact: ["https://discord.gg/Qk8KUk787z","DiscordInviteLink"]
|
||||
}
|
||||
]
|
||||
*/
|
||||
|
||||
export let groupsMarkersLayer = L.layerGroup()
|
||||
let groupsMarkersLayerOut = L.layerGroup()
|
||||
let groupsMarkersLayerIn = L.layerGroup()
|
||||
|
||||
let contactGeneral =["https://discord.gg/4BUau4AZre","DiscordInviteLink"]
|
||||
|
||||
export function translate(content, x) {
|
||||
let out = content[x]
|
||||
if (out==undefined) {
|
||||
return x
|
||||
}
|
||||
else {
|
||||
return out
|
||||
}
|
||||
}
|
||||
|
||||
function addMarkersToLayer(g,layer,content,locale) {
|
||||
let coordinates
|
||||
let text = "<b>"+content["Group"]+"</b><br>"
|
||||
for (let field of ["location","members","contact"]) {
|
||||
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact + "' target='_blank' rel=noreferrer>" + g.contact + "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined)
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location.map(x => x).join(", ")
|
||||
}
|
||||
else {
|
||||
locationString = location.map(x => translate(content, x)).join(", ")
|
||||
}
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = [g.latitude,g.longitude]
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
var markerIcon = new L.Icon({
|
||||
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-green.png',
|
||||
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
})
|
||||
//console.log(text)
|
||||
let marker = L.marker(coordinates, {icon: markerIcon})
|
||||
marker.addTo(layer).bindPopup(text)
|
||||
}
|
||||
|
||||
export function addMarkersGroups(groups,groupsByCountry,map,content,locale) {
|
||||
for (let g of groups) {
|
||||
addMarkersToLayer(g,groupsMarkersLayerIn,content,locale)
|
||||
}
|
||||
for (let gs of Object.values(groupsByCountry)) {
|
||||
if (gs.length==1) {
|
||||
let g = {...gs[0]}
|
||||
g.country = [g.country]
|
||||
addMarkersToLayer(g,groupsMarkersLayerOut,content,locale)
|
||||
}
|
||||
else {
|
||||
let locationName = gs[0].country
|
||||
let locationCoordinates = [0,0]
|
||||
let members = 0
|
||||
let contact = gs[0].contact
|
||||
for (let g of gs) {
|
||||
locationCoordinates[0] += g.latitude
|
||||
locationCoordinates[1] += g.longitude
|
||||
members += g.members
|
||||
if (g.contact[0]!=gs[0].contact[0]) {
|
||||
contact = contactGeneral
|
||||
}
|
||||
}
|
||||
locationCoordinates[0] = locationCoordinates[0]/gs.length
|
||||
locationCoordinates[1] = locationCoordinates[1]/gs.length
|
||||
let gNew = {
|
||||
country: locationName,
|
||||
latitude: locationCoordinates[0],
|
||||
longitude: locationCoordinates[1],
|
||||
members: members,
|
||||
contact: contact
|
||||
}
|
||||
addMarkersToLayer(gNew,groupsMarkersLayerOut,content,locale)
|
||||
}
|
||||
}
|
||||
|
||||
groupsMarkersLayerOut.addTo(groupsMarkersLayer)
|
||||
groupsMarkersLayer.addTo(map)
|
||||
map.on("zoomend", () => onZoomEnd(map))
|
||||
}
|
||||
|
||||
function onZoomEnd(map) {
|
||||
let zoomLevel = map.getZoom()
|
||||
if (zoomLevel==3) {
|
||||
groupsMarkersLayer.removeLayer(groupsMarkersLayerIn)
|
||||
groupsMarkersLayerOut.addTo(groupsMarkersLayer)
|
||||
}
|
||||
else if (zoomLevel==4) {
|
||||
groupsMarkersLayer.removeLayer(groupsMarkersLayerOut)
|
||||
groupsMarkersLayerIn.addTo(groupsMarkersLayer)
|
||||
}
|
||||
}
|
||||
|
||||
|
90
Server/app/svelte/public/js/libraries/mapTools.js
Normal file
90
Server/app/svelte/public/js/libraries/mapTools.js
Normal file
@@ -0,0 +1,90 @@
|
||||
let contactGeneral =["https://discord.gg/4BUau4AZre","DiscordInviteLink"]
|
||||
|
||||
export function translate(content, x) {
|
||||
let out = content[x]
|
||||
if (out==undefined) {
|
||||
return x
|
||||
}
|
||||
else {
|
||||
return out
|
||||
}
|
||||
}
|
||||
|
||||
function addMarkersToLayer(g,layer,content,locale,addPinContent,markerColor) {
|
||||
let {text,coordinates} = addPinContent(g,content,locale)
|
||||
var markerIcon = new L.Icon({
|
||||
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-' + markerColor + '.png',
|
||||
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
})
|
||||
let marker = L.marker(coordinates, {icon: markerIcon})
|
||||
marker.addTo(layer).bindPopup(text)
|
||||
}
|
||||
|
||||
export function addMarkersEntries(entries,entriesByCountry,map,content,locale,addPinContent,markerColor) {
|
||||
let entriesMarkersLayer = L.layerGroup()
|
||||
let entriesMarkersLayerOut = L.layerGroup()
|
||||
let entriesMarkersLayerIn = L.layerGroup()
|
||||
for (let g of entries) {
|
||||
if (g.country!="Online" && g.country!="Worldwide") {
|
||||
addMarkersToLayer(g,entriesMarkersLayerIn,content,locale,addPinContent,markerColor)
|
||||
}
|
||||
}
|
||||
for (let gs of Object.values(entriesByCountry)) {
|
||||
if (gs.length==1) {
|
||||
let g = {...gs[0]}
|
||||
g.country = [g.country]
|
||||
if (g.country!="Online" && g.country!="Worldwide") {
|
||||
addMarkersToLayer(g,entriesMarkersLayerOut,content,locale,addPinContent,markerColor)
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (gs[0].country!="Online" && gs[0].country!="Worldwide") {
|
||||
let locationName = gs[0].country
|
||||
let locationCoordinates = [0,0]
|
||||
let members = 0
|
||||
let contact = gs[0].contact
|
||||
for (let g of gs) {
|
||||
locationCoordinates[0] += g.latitude
|
||||
locationCoordinates[1] += g.longitude
|
||||
members += g.members
|
||||
if (g.contact[0]!=gs[0].contact[0]) {
|
||||
contact = contactGeneral
|
||||
}
|
||||
}
|
||||
locationCoordinates[0] = locationCoordinates[0]/gs.length
|
||||
locationCoordinates[1] = locationCoordinates[1]/gs.length
|
||||
let gNew = {
|
||||
country: locationName,
|
||||
latitude: locationCoordinates[0],
|
||||
longitude: locationCoordinates[1],
|
||||
members: members,
|
||||
contact: contact
|
||||
}
|
||||
addMarkersToLayer(gNew,entriesMarkersLayerOut,content,locale,addPinContent,markerColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
entriesMarkersLayerOut.addTo(entriesMarkersLayer)
|
||||
entriesMarkersLayer.addTo(map)
|
||||
map.on("zoomend", () => onZoomEnd(map,entriesMarkersLayer,entriesMarkersLayerOut,entriesMarkersLayerIn))
|
||||
return entriesMarkersLayer
|
||||
}
|
||||
|
||||
function onZoomEnd(map,entriesMarkersLayer,entriesMarkersLayerOut,entriesMarkersLayerIn) {
|
||||
let zoomLevel = map.getZoom()
|
||||
if (zoomLevel==3) {
|
||||
entriesMarkersLayer.removeLayer(entriesMarkersLayerIn)
|
||||
entriesMarkersLayerOut.addTo(entriesMarkersLayer)
|
||||
}
|
||||
else if (zoomLevel==4) {
|
||||
entriesMarkersLayer.removeLayer(entriesMarkersLayerOut)
|
||||
entriesMarkersLayerIn.addTo(entriesMarkersLayer)
|
||||
}
|
||||
}
|
||||
|
||||
|
178
Server/app/svelte/public/js/mapFuncs.js
Normal file
178
Server/app/svelte/public/js/mapFuncs.js
Normal file
@@ -0,0 +1,178 @@
|
||||
import { translate } from "/js/libraries/mapTools.js"
|
||||
|
||||
export function addGroupPinContent(g,content,locale) {
|
||||
let coordinates
|
||||
let text = "<b>"+content["Group"]+"</b><br>"
|
||||
for (let field of ["location","members","contact"]) {
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact + "' target='_blank' rel=noreferrer>" + g.contact + "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined)
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location.map(x => x).join(", ")
|
||||
}
|
||||
else {
|
||||
locationString = location.map(x => translate(content, x)).join(", ")
|
||||
}
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = [g.latitude,g.longitude]
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
return {text,coordinates}
|
||||
}
|
||||
|
||||
export function addCommunePinContent(g,content,locale) {
|
||||
let coordinates
|
||||
let text = "<b>"+content["Commune"]+"</b><br>"
|
||||
for (let field of ["location","status","members","contact"]) {
|
||||
let fieldText = content[field] + ": "
|
||||
if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact + "' target='_blank' rel=noreferrer>" + g.contact + "</a>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined)
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location.map(x => x).join(", ")
|
||||
}
|
||||
else {
|
||||
locationString = location.map(x => translate(content, x)).join(", ")
|
||||
}
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = [g.latitude,g.longitude]
|
||||
}
|
||||
else if (field=="status") {
|
||||
text += fieldText + content[g[field]] + "<br>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
return {text,coordinates}
|
||||
}
|
||||
|
||||
export function addCoopPinContent(g,content,locale) {
|
||||
let coordinates
|
||||
let text = "<b>"+content["Cooperative"]+"</b><br>"
|
||||
for (let field of ["logo","name","location","workers","status","website","contact","description"]) {
|
||||
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 + "' target='_blank' rel=noreferrer>" + g.contact + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="website") {
|
||||
text += fieldText + "<a href='" + g.website + "' target='_blank' rel=noreferrer>" + g.website + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined)
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location.map(x => x).join(", ")
|
||||
}
|
||||
else {
|
||||
locationString = location.map(x => translate(content, x)).join(", ")
|
||||
}
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = [g.latitude,g.longitude]
|
||||
}
|
||||
else if (field=="market" || field=="status" || field=="description") {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
return {text,coordinates}
|
||||
}
|
||||
|
||||
export function addPartyPinContent(g,content,locale) {
|
||||
let coordinates
|
||||
let text = "<b>"+content["Cooperative"]+"</b><br>"
|
||||
for (let field of ["logo","name","location","website","contact","description"]) {
|
||||
let fieldText
|
||||
if (field!="logo") {
|
||||
fieldText = content[field] + ": "
|
||||
}
|
||||
if (field=="logo") {
|
||||
text += "<picture><source srcset=" + "/img/parties/" + g.logo + ".webp><source srcset='/img/parties/" + g.logo + ".png'><img alt='logo' style='position: relative; max-height: 5rem; max-width: 100%; margin: auto;'></picture>" + "<br>"
|
||||
}
|
||||
else if (field=="link") {
|
||||
text += fieldText + "<a href='" + g.link + "' target='_blank' rel=noreferrer>" + g.link + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="website") {
|
||||
text += fieldText + "<a href='" + g.website + "' target='_blank' rel=noreferrer>" + g.website + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined)
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location.map(x => x).join(", ")
|
||||
}
|
||||
else {
|
||||
locationString = location.map(x => translate(content, x)).join(", ")
|
||||
}
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = [g.latitude,g.longitude]
|
||||
}
|
||||
else if (field=="description") {
|
||||
text += fieldText + content[g[field]] + "<br>"
|
||||
}
|
||||
else if (field=="contact") {
|
||||
text += fieldText + "<a href='" + g.contact + "' target='_blank' rel=noreferrer>" + g.contact + "</a>" + "<br>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
return {text,coordinates}
|
||||
}
|
||||
|
||||
export function addPartnersPinContent(g,content,locale) {
|
||||
let coordinates
|
||||
let text = "<b>"+content["Partner"]+"</b><br>"
|
||||
for (let field of ["logo","name","location","website","contact","description"]) {
|
||||
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 + "' target='_blank' rel=noreferrer>" + g.contact + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="website") {
|
||||
text += fieldText + "<a href='" + g.website + "' target='_blank' rel=noreferrer>" + g.website + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined)
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location.map(x => x).join(", ")
|
||||
}
|
||||
else {
|
||||
locationString = location.map(x => translate(content, x)).join(", ")
|
||||
}
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = [g.latitude,g.longitude]
|
||||
}
|
||||
else if (field=="description") {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
return {text,coordinates}
|
||||
}
|
@@ -1,74 +0,0 @@
|
||||
export let parties = [
|
||||
{
|
||||
logo: "roots",
|
||||
name: "Roots",
|
||||
location: ["Ireland",[52.98479517270413, -7.649233227534782]],
|
||||
//members: 6,
|
||||
link: "https://discord.gg/pSTMacJZsK",
|
||||
description: "descriptionRoots"
|
||||
}
|
||||
]
|
||||
|
||||
export let partiesByCountry = {}
|
||||
for (let g of parties) {
|
||||
let country = g.location[0]
|
||||
if (country in partiesByCountry) {
|
||||
partiesByCountry[country].push(g)
|
||||
}
|
||||
else {
|
||||
partiesByCountry[country] = [g]
|
||||
}
|
||||
}
|
||||
|
||||
export let partiesMarkersLayer = L.layerGroup()
|
||||
|
||||
export function addMarkersParties(map,content,locale) {
|
||||
for (let g of parties) {
|
||||
let coordinates
|
||||
let text = "<b>"+content["Party"]+"</b><br>"
|
||||
for (let field in g) {
|
||||
let fieldText
|
||||
if (field!="logo") {
|
||||
fieldText = content[field] + ": "
|
||||
}
|
||||
if (field=="logo") {
|
||||
text += "<picture><source srcset=" + "/img/parties/" + g.logo + ".webp><source srcset='/img/parties/" + g.logo + ".png'><img alt='logo' style='position: relative; max-height: 5rem; max-width: 100%; margin: auto;'></picture>" + "<br>"
|
||||
}
|
||||
else if (field=="link") {
|
||||
text += fieldText + "<a href='" + g.link + "' target='_blank' rel=noreferrer>" + g.link + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="website") {
|
||||
text += fieldText + "<a href='" + g.website + "' target='_blank' rel=noreferrer>" + g.website + "</a>" + "<br>"
|
||||
}
|
||||
else if (field=="location") {
|
||||
let location = g[field][0]
|
||||
let locationString
|
||||
if (locale=="en") {
|
||||
locationString = location
|
||||
}
|
||||
else {
|
||||
locationString = content[location]
|
||||
}
|
||||
text += fieldText + locationString + "<br>"
|
||||
coordinates = g[field][1]
|
||||
}
|
||||
else if (field=="description") {
|
||||
text += fieldText + content[g[field]] + "<br>"
|
||||
}
|
||||
else {
|
||||
text += fieldText + g[field] + "<br>"
|
||||
}
|
||||
}
|
||||
var markerIcon = new L.Icon({
|
||||
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-gold.png',
|
||||
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34],
|
||||
shadowSize: [41, 41]
|
||||
});
|
||||
let marker = L.marker(coordinates, {icon: markerIcon})
|
||||
marker.addTo(partiesMarkersLayer).bindPopup(text)
|
||||
}
|
||||
partiesMarkersLayer.addTo(map)
|
||||
}
|
@@ -1,21 +0,0 @@
|
||||
export let partners = [
|
||||
{
|
||||
name: "Gaia's Fall",
|
||||
type: "typeGaiasFall",
|
||||
location: [["Online"],[0,0]],
|
||||
link: "https://discord.libsoc.org/invite/",
|
||||
description: "descriptionGaiasFall",
|
||||
logo: "gaias_fall"
|
||||
}
|
||||
]
|
||||
|
||||
export let partnersByCountry = {}
|
||||
for (let g of partners) {
|
||||
let country = g.location[0][0]
|
||||
if (country in partnersByCountry) {
|
||||
partnersByCountry[country].push(g)
|
||||
}
|
||||
else {
|
||||
partnersByCountry[country] = [g]
|
||||
}
|
||||
}
|
@@ -10,5 +10,6 @@
|
||||
"forming": "forming",
|
||||
"WhatsAppInviteLink": "WhatsApp invite link",
|
||||
"DiscordInviteLink": "Discord invite link",
|
||||
"Commune": "Commune"
|
||||
"Commune": "Commune",
|
||||
"map-prompt": "Want to appear on our map? Contact us!"
|
||||
}
|
@@ -18,6 +18,7 @@
|
||||
"descriptionChironHealth": "Chiron Health is a health platform providing courses and services on the topics of nutrition, exercise, sleep and mental wellbeing.",
|
||||
"herbalTeas": "herbal teas",
|
||||
"kuuskDescription": "Kuusk is an online store that sells herbal teas from exclusively local wild plants, as well as an online gathering course.",
|
||||
"Cooperative": "Cooperative"
|
||||
"Cooperative": "Cooperative",
|
||||
"map-prompt": "Want to appear on our map? Contact us!"
|
||||
|
||||
}
|
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"map-prompt": "Want to appear on our map? Contact us!"
|
||||
|
||||
}
|
@@ -8,5 +8,6 @@
|
||||
"contact": "Contact",
|
||||
"DiscordInviteLink": "Discord invite link",
|
||||
"WhatsAppInviteLink": "WhatsApp invite link",
|
||||
"Group": "Group"
|
||||
"Group": "Group",
|
||||
"map-prompt": "Want to appear on our map? Contact us!"
|
||||
}
|
@@ -5,8 +5,10 @@
|
||||
"name": "Name",
|
||||
"location": "Location",
|
||||
"members": "Members",
|
||||
"link": "Link",
|
||||
"website": "Website",
|
||||
"contact": "Contact",
|
||||
"description": "Description",
|
||||
"descriptionRoots": "We are a left libertarian organization based in Ireland. We have a focus on rebuilding the country's infrastructure, sense of governance, housing, agricultural industries and youth affairs.",
|
||||
"Party": "Party"
|
||||
"Party": "Party",
|
||||
"map-prompt": "Want to appear on our map? Contact us!"
|
||||
}
|
@@ -5,10 +5,11 @@
|
||||
"subheading2": "Online",
|
||||
"name": "Name",
|
||||
"location": "Location",
|
||||
"type": "Type",
|
||||
"link": "Link",
|
||||
"website": "Website",
|
||||
"contact": "Contact",
|
||||
"description": "Description",
|
||||
"typeGaiasFall": "a place for discussions",
|
||||
"descriptionGaiasFall": "Gaia's Fall is a server that promotes Solarpunk ideals, environmentalism, anarchism, and anti-capitalism. We encourage civil debates, discussions of theories and possibilities, and the creation of communities focused on shaping a better world."
|
||||
"descriptionGaiasFall": "Gaia's Fall is a server that promotes Solarpunk ideals, environmentalism, anarchism, and anti-capitalism. We encourage civil debates, discussions of theories and possibilities, and the creation of communities focused on shaping a better world.",
|
||||
"map-prompt": "Want to appear on our map? Contact us!"
|
||||
|
||||
}
|
@@ -9,5 +9,6 @@
|
||||
"forming": "формируется",
|
||||
"WhatsAppInviteLink": "WhatsApp ссылка",
|
||||
"DiscordInviteLink": "Discord ссылка",
|
||||
"Commune": "Коммуна"
|
||||
"Commune": "Коммуна",
|
||||
"map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!"
|
||||
}
|
@@ -18,5 +18,6 @@
|
||||
"descriptionChironHealth": "Chiron Health — это платформа о здоровье, предлагающая курсы и услуги по вопросам питания, физических упражнений, сна и психического благополучия",
|
||||
"herbalTeas": "травяные чаи",
|
||||
"kuuskDescription": "Kuusk — интернет-магазин, в котором продаются травяные чаи исключительно из местных дикорастущих растений, а также онлайн-курс по собирательству.",
|
||||
"Cooperative": "Кооператив"
|
||||
"Cooperative": "Кооператив",
|
||||
"map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!"
|
||||
}
|
@@ -1,30 +1,3 @@
|
||||
{
|
||||
"map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!",
|
||||
"Online": "Онлайн",
|
||||
"Denmark": "Дания",
|
||||
"Estonia": "Эстония",
|
||||
"Greece": "Греция",
|
||||
"Latvia": "Латвия",
|
||||
"Canada": "Канада",
|
||||
"Ireland": "Ирландия",
|
||||
"Germany": "Германия",
|
||||
"USA": "CША",
|
||||
"Bulgaria": "Болгария",
|
||||
"Thailand": "Тайланд",
|
||||
"Colorado": "Колорадо",
|
||||
"Georgia": "Джорджия",
|
||||
"Ohio": "Огайо",
|
||||
"Copenhagen": "Копенгаген",
|
||||
"Kolding": "Колдинг",
|
||||
"Kohtla-Järve": "Кохтла-Ярве",
|
||||
"Athens": "Афины",
|
||||
"Riga": "Рига",
|
||||
"Halifax": "Галифакс",
|
||||
"Montreal": "Монреаль",
|
||||
"Wiesbaden": "Висбаден",
|
||||
"Florida": "Флорида",
|
||||
"Tallinn": "Таллинн",
|
||||
"Varna": "Варна",
|
||||
"Louisville": "Луисвилл",
|
||||
"Toronto": "Торонто"
|
||||
|
||||
}
|
@@ -7,5 +7,6 @@
|
||||
"contact": "Контакт",
|
||||
"DiscordInviteLink": "Discord ссылка",
|
||||
"WhatsAppInviteLink": "WhatsApp ссылка",
|
||||
"Group": "Группа"
|
||||
"Group": "Группа",
|
||||
"map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!"
|
||||
}
|
@@ -30,5 +30,6 @@
|
||||
"market": "Рынок",
|
||||
"workers": "Работники",
|
||||
"description": "Описание",
|
||||
"website": "Вебсайт"
|
||||
"website": "Вебсайт",
|
||||
"map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!"
|
||||
}
|
@@ -11,5 +11,6 @@
|
||||
"findUs": "Найди нас",
|
||||
"whatNow": "Что теперь?",
|
||||
"joinUs": "Присоединяйся",
|
||||
"talkWithUs": "Напиши нам"
|
||||
"talkWithUs": "Напиши нам",
|
||||
"map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!"
|
||||
}
|
@@ -5,9 +5,11 @@
|
||||
"name": "Имя",
|
||||
"location": "Локация",
|
||||
"members": "Участники",
|
||||
"link": "Ссылка",
|
||||
"website": "Вебсайт",
|
||||
"contact": "Контакт",
|
||||
"description": "Описание",
|
||||
"ireland": "Ирландия",
|
||||
"descriptionRoots": "Мы — левая либертарная организация, базирующаяся в Ирландии. Мы уделяем особое внимание восстановлению инфраструктуры страны, самоуправлению, жилищному строительству, сельскохозяйственной промышленности и делам молодежи.",
|
||||
"Party": "Партия"
|
||||
"Party": "Партия",
|
||||
"map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!"
|
||||
}
|
@@ -6,8 +6,10 @@
|
||||
"name": "Название",
|
||||
"location": "Локация",
|
||||
"type": "Тип",
|
||||
"link": "Ссылка",
|
||||
"website": "Вебсайт",
|
||||
"contact": "Контакт",
|
||||
"description": "Описание",
|
||||
"typeGaiasFall": "место для общения",
|
||||
"descriptionGaiasFall": "Gaia's Fall — это сервер, который продвигает идеалы соларпанка, защиту окружающей среды, анархизм и антикапитализм. Мы поощряем гражданские дебаты, обсуждение теорий и возможностей, а также создание сообществ, сосредоточенных на формировании лучшего мира."
|
||||
"descriptionGaiasFall": "Gaia's Fall — это сервер, который продвигает идеалы соларпанка, защиту окружающей среды, анархизм и антикапитализм. Мы поощряем гражданские дебаты, обсуждение теорий и возможностей, а также создание сообществ, сосредоточенных на формировании лучшего мира.",
|
||||
"map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!"
|
||||
}
|
Reference in New Issue
Block a user