diff --git a/Server/app/svelte/src/groups-component.svelte b/Server/app/svelte/src/groups-component.svelte
index 514ecb8..c12847c 100644
--- a/Server/app/svelte/src/groups-component.svelte
+++ b/Server/app/svelte/src/groups-component.svelte
@@ -40,8 +40,6 @@
}
getData("/assets/groups.json",callback)
-
-
function mapCallbackGroups(createMap,content,locale) {
let map = createMap([22, 0],2)
addMarkersGroups(groups,groupsByCountry,map,content,locale)
diff --git a/Server/app/svelte/src/join-us-component.svelte b/Server/app/svelte/src/join-us-component.svelte
index 2c1ad23..72975c2 100644
--- a/Server/app/svelte/src/join-us-component.svelte
+++ b/Server/app/svelte/src/join-us-component.svelte
@@ -8,7 +8,7 @@
import { addMarkersCoops, coopsMarkersLayer } from '/js/coops.js'
import { addMarkersCommunes, communesMarkersLayer } from '/js/communes.js'
import { addMarkersParties, partiesMarkersLayer } from '/js/parties.js'
- import { loadLocaleContent } from "/js/libraries/serverTools.js"
+ import { loadLocaleContent, getData } from "/js/libraries/serverTools.js"
// Import components
import "/js/components/map-component.js"
@@ -16,6 +16,8 @@
// Main code
let loaded = writable(0)
let content = writable({})
+ let groups
+ let groupsByCountry
loadLocaleContent(content,"groups-component",loaded)
loadLocaleContent(content,"communes-component",loaded)
@@ -24,9 +26,31 @@
loadLocaleContent(content,"countries",loaded)
let locale = loadLocaleContent(content,"join-us-component",loaded)
+
+ let callback = (response) => {
+ groups = JSON.parse(response)
+ groupsByCountry = {}
+ for (let g of groups) {
+ let country = g.country
+ if (g.contact==null) {
+ g.contact = "https://discord.gg/Qk8KUk787z"
+ }
+ if (country in groupsByCountry) {
+ groupsByCountry[country].push(g)
+ }
+ else {
+ groupsByCountry[country] = [g]
+ }
+ }
+ loaded.update((val) => {
+ return val + 1
+ })
+ }
+ getData("/assets/groups.json",callback)
+
function mapCallback(createMap,content,locale) {
let map = createMap([22, 0],2)
- addMarkersGroups(map,content,locale)
+ addMarkersGroups(groups,groupsByCountry,map,content,locale)
addMarkersCommunes(map,content,locale)
addMarkersCoops(map,content,locale)
addMarkersParties(map,content,locale)
@@ -46,7 +70,7 @@
{#key $loaded}
- {#if $loaded==6}
+ {#if $loaded==7}
{$content.heading}
diff --git a/Server/public/js/components/join-us-component.js b/Server/public/js/components/join-us-component.js
index f8d57d8..51c41ce 100644
--- a/Server/public/js/components/join-us-component.js
+++ b/Server/public/js/components/join-us-component.js
@@ -1 +1 @@
-import{S as o,i as t,a as i,b as e,s as r,e as n,n as a,d as s,c as m,o as l,f as c,t as p,g,j as u,h as d,k as h,l as f,m as b}from"./index-4348483d.js";import{w as v}from"./index-71440b21.js";import{addMarkersGroups as j,groupsMarkersLayer as k}from"../../../../../../../../../js/groups.js";import{addMarkersCoops as w,coopsMarkersLayer as y}from"../../../../../../../../../js/coops.js";import{addMarkersCommunes as x,communesMarkersLayer as P}from"../../../../../../../../../js/communes.js";import{addMarkersParties as T,partiesMarkersLayer as N}from"../../../../../../../../../js/parties.js";import{loadLocaleContent as S}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function z(o){let t,i,r,n,a,m,l,v,j,k,w,y,x,P,T,N,S,z,A,D,H,L,O,U,C,G,M,E,K,R,W,Y,_,B,J,Q,q,F,I,V,X,Z,$,oo,to,io,eo,ro,no,ao,so,mo,lo,co,po,go,uo,ho,fo,bo,vo,jo,ko,wo,yo,xo,Po,To,No,So,zo,Ao,Do,Ho,Lo,Oo,Uo,Co,Go,Mo,Eo,Ko,Ro,Wo=o[1].heading+"",Yo=o[1].condition1+"",_o=o[1].condition2+"",Bo=o[1].condition3+"",Jo=o[1].conditionsOutcome+"",Qo=o[1].subheading1+"",qo=o[1].valueProposition1+"",Fo=o[1].valueProposition2+"",Io=o[1].valueProposition3+"",Vo=o[1].valueProposition4+"",Xo=o[1].valueProposition5+"",Zo=o[1].subheading2+"",$o=o[1].findOur+"",ot=o[1].group+"",tt=o[1].commune+"",it=o[1].cooperative+"",et=o[1].or+"",rt=o[1].party+"",nt=o[1].nearYou+"",at=o[1].noneNear+"",st=o[1].WhatsAppGroup+"",mt=o[1].or+"",lt=o[1].DiscordServer+"",ct=o[1].helpStart+"";return{c(){t=c("div"),i=c("div"),r=c("h1"),n=p(Wo),a=g(),m=c("img"),v=g(),j=c("ol"),k=c("li"),w=p(Yo),y=g(),x=c("li"),P=p(_o),T=g(),N=c("li"),S=p(Bo),z=g(),A=c("p"),D=g(),H=c("h2"),L=p(Qo),O=g(),U=c("ol"),C=c("li"),G=p(qo),M=g(),E=c("li"),K=p(Fo),R=g(),W=c("li"),Y=p(Io),_=g(),B=c("li"),J=p(Vo),Q=g(),q=c("p"),F=p(Xo),I=g(),V=c("h2"),X=p(Zo),Z=g(),$=c("div"),oo=c("p"),to=p($o),io=g(),eo=c("ol"),ro=c("li"),no=c("a"),ao=p(ot),so=p(","),mo=g(),lo=c("li"),co=c("a"),po=p(tt),go=g(),uo=c("li"),ho=c("a"),fo=p(it),bo=g(),vo=p(et),jo=g(),ko=c("li"),wo=c("a"),yo=p(rt),xo=g(),Po=c("p"),To=p(nt),No=g(),So=c("p"),zo=p(at),Ao=g(),Do=c("a"),Ho=p(st),Lo=g(),Oo=p(mt),Uo=g(),Co=c("a"),Go=p(lt),Mo=p(ct),Eo=g(),Ko=c("map-component"),u(m.src,l="/img/common/join-group.svg")||d(m,"src","/img/common/join-group.svg"),d(m,"id","join-group"),d(m,"alt","join group"),d(j,"id","condition-list"),d(U,"id","value-proposition-list"),d(no,"href","/"+o[4]+"/groups"),d(co,"href","/"+o[4]+"/communes"),d(ho,"href","/"+o[4]+"/cooperatives"),d(wo,"href","/"+o[4]+"/parties"),d(eo,"id","entities-list"),d($,"id","call-to-action-list"),d(Do,"href","https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh"),d(Do,"target","_blank"),d(Do,"rel","noreferrer"),d(Co,"href","https://discord.gg/Qk8KUk787z"),d(Co,"target","_blank"),d(Co,"rel","noreferrer"),h(Ko,"id","map"),h(Ko,"callback",Ro=o[6]),d(i,"id","text-container"),d(t,"id","container")},m(o,s){e(o,t,s),f(t,i),f(i,r),f(r,n),f(i,a),f(i,m),f(i,v),f(i,j),f(j,k),f(k,w),f(j,y),f(j,x),f(x,P),f(j,T),f(j,N),f(N,S),f(j,z),f(j,A),A.innerHTML=Jo,f(i,D),f(i,H),f(H,L),f(i,O),f(i,U),f(U,C),f(C,G),f(U,M),f(U,E),f(E,K),f(U,R),f(U,W),f(W,Y),f(U,_),f(U,B),f(B,J),f(U,Q),f(U,q),f(q,F),f(i,I),f(i,V),f(V,X),f(i,Z),f(i,$),f($,oo),f(oo,to),f($,io),f($,eo),f(eo,ro),f(ro,no),f(no,ao),f(ro,so),f(eo,mo),f(eo,lo),f(lo,co),f(co,po),f(eo,go),f(eo,uo),f(uo,ho),f(ho,fo),f(uo,bo),f(uo,vo),f(eo,jo),f(eo,ko),f(ko,wo),f(wo,yo),f($,xo),f($,Po),f(Po,To),f(i,No),f(i,So),f(So,zo),f(So,Ao),f(So,Do),f(Do,Ho),f(So,Lo),f(So,Oo),f(So,Uo),f(So,Co),f(Co,Go),f(So,Mo),f(i,Eo),f(i,Ko)},p(o,t){2&t&&Wo!==(Wo=o[1].heading+"")&&b(n,Wo),2&t&&Yo!==(Yo=o[1].condition1+"")&&b(w,Yo),2&t&&_o!==(_o=o[1].condition2+"")&&b(P,_o),2&t&&Bo!==(Bo=o[1].condition3+"")&&b(S,Bo),2&t&&Jo!==(Jo=o[1].conditionsOutcome+"")&&(A.innerHTML=Jo),2&t&&Qo!==(Qo=o[1].subheading1+"")&&b(L,Qo),2&t&&qo!==(qo=o[1].valueProposition1+"")&&b(G,qo),2&t&&Fo!==(Fo=o[1].valueProposition2+"")&&b(K,Fo),2&t&&Io!==(Io=o[1].valueProposition3+"")&&b(Y,Io),2&t&&Vo!==(Vo=o[1].valueProposition4+"")&&b(J,Vo),2&t&&Xo!==(Xo=o[1].valueProposition5+"")&&b(F,Xo),2&t&&Zo!==(Zo=o[1].subheading2+"")&&b(X,Zo),2&t&&$o!==($o=o[1].findOur+"")&&b(to,$o),2&t&&ot!==(ot=o[1].group+"")&&b(ao,ot),2&t&&tt!==(tt=o[1].commune+"")&&b(po,tt),2&t&&it!==(it=o[1].cooperative+"")&&b(fo,it),2&t&&et!==(et=o[1].or+"")&&b(vo,et),2&t&&rt!==(rt=o[1].party+"")&&b(yo,rt),2&t&&nt!==(nt=o[1].nearYou+"")&&b(To,nt),2&t&&at!==(at=o[1].noneNear+"")&&b(zo,at),2&t&&st!==(st=o[1].WhatsAppGroup+"")&&b(Ho,st),2&t&&mt!==(mt=o[1].or+"")&&b(Oo,mt),2&t&<!==(lt=o[1].DiscordServer+"")&&b(Go,lt),2&t&&ct!==(ct=o[1].helpStart+"")&&b(Mo,ct),2&t&&Ro!==(Ro=o[6])&&h(Ko,"callback",Ro)},d(o){o&&s(t)}}}function A(o){let t,i=6==o[0]&&z(o);return{c(){i&&i.c(),t=n()},m(o,r){i&&i.m(o,r),e(o,t,r)},p(o,e){6==o[0]?i?i.p(o,e):(i=z(o),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(o){i&&i.d(o),o&&s(t)}}}function D(o){let t,i=o[0],m=A(o);return{c(){m.c(),t=n(),this.c=a},m(o,i){m.m(o,i),e(o,t,i)},p(o,[e]){1&e&&r(i,i=o[0])?(m.d(1),m=A(o),m.c(),m.m(t.parentNode,t)):m.p(o,e)},i:a,o:a,d(o){o&&s(t),m.d(o)}}}function H(o,t,i){let e,r,n=v(0);m(o,n,(o=>i(0,e=o)));let a=v({});m(o,a,(o=>i(1,r=o))),S(a,"groups-component",n),S(a,"communes-component",n),S(a,"cooperatives-component",n),S(a,"parties-component",n),S(a,"countries",n);let s=S(a,"join-us-component",n);function c(o,t,i){let e=o([22,0],2);j(e,t,i),x(e,t,i),w(e,t,i),T(e,t,i);let r={Groups:k,Communes:P,Coops:y,Parties:N};L.control.layers(null,r).addTo(e)}l((()=>{}));return[e,r,n,a,s,c,o=>c(o,r,s)]}class O extends o{constructor(o){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},H,D,r,{},null),o&&o.target&&e(o.target,this,o.anchor)}}customElements.define("join-us-component",O);export{O as default};
+import{S as o,i as t,a as i,b as e,s as r,e as n,n as a,d as s,c as m,o as l,f as c,t as p,g as u,j as g,h as d,k as h,l as f,m as b}from"./index-4348483d.js";import{w as v}from"./index-71440b21.js";import{addMarkersGroups as j,groupsMarkersLayer as k}from"../../../../../../../../../js/groups.js";import{addMarkersCoops as w,coopsMarkersLayer as y}from"../../../../../../../../../js/coops.js";import{addMarkersCommunes as x,communesMarkersLayer as P}from"../../../../../../../../../js/communes.js";import{addMarkersParties as N,partiesMarkersLayer as S}from"../../../../../../../../../js/parties.js";import{loadLocaleContent as T,getData as z}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function O(o){let t,i,r,n,a,m,l,v,j,k,w,y,x,P,N,S,T,z,O,U,A,D,H,L,C,G,K,M,E,J,Q,R,W,Y,_,B,q,F,I,V,X,Z,$,oo,to,io,eo,ro,no,ao,so,mo,lo,co,po,uo,go,ho,fo,bo,vo,jo,ko,wo,yo,xo,Po,No,So,To,zo,Oo,Uo,Ao,Do,Ho,Lo,Co,Go,Ko,Mo,Eo,Jo,Qo=o[1].heading+"",Ro=o[1].condition1+"",Wo=o[1].condition2+"",Yo=o[1].condition3+"",_o=o[1].conditionsOutcome+"",Bo=o[1].subheading1+"",qo=o[1].valueProposition1+"",Fo=o[1].valueProposition2+"",Io=o[1].valueProposition3+"",Vo=o[1].valueProposition4+"",Xo=o[1].valueProposition5+"",Zo=o[1].subheading2+"",$o=o[1].findOur+"",ot=o[1].group+"",tt=o[1].commune+"",it=o[1].cooperative+"",et=o[1].or+"",rt=o[1].party+"",nt=o[1].nearYou+"",at=o[1].noneNear+"",st=o[1].WhatsAppGroup+"",mt=o[1].or+"",lt=o[1].DiscordServer+"",ct=o[1].helpStart+"";return{c(){t=c("div"),i=c("div"),r=c("h1"),n=p(Qo),a=u(),m=c("img"),v=u(),j=c("ol"),k=c("li"),w=p(Ro),y=u(),x=c("li"),P=p(Wo),N=u(),S=c("li"),T=p(Yo),z=u(),O=c("p"),U=u(),A=c("h2"),D=p(Bo),H=u(),L=c("ol"),C=c("li"),G=p(qo),K=u(),M=c("li"),E=p(Fo),J=u(),Q=c("li"),R=p(Io),W=u(),Y=c("li"),_=p(Vo),B=u(),q=c("p"),F=p(Xo),I=u(),V=c("h2"),X=p(Zo),Z=u(),$=c("div"),oo=c("p"),to=p($o),io=u(),eo=c("ol"),ro=c("li"),no=c("a"),ao=p(ot),so=p(","),mo=u(),lo=c("li"),co=c("a"),po=p(tt),uo=u(),go=c("li"),ho=c("a"),fo=p(it),bo=u(),vo=p(et),jo=u(),ko=c("li"),wo=c("a"),yo=p(rt),xo=u(),Po=c("p"),No=p(nt),So=u(),To=c("p"),zo=p(at),Oo=u(),Uo=c("a"),Ao=p(st),Do=u(),Ho=p(mt),Lo=u(),Co=c("a"),Go=p(lt),Ko=p(ct),Mo=u(),Eo=c("map-component"),g(m.src,l="/img/common/join-group.svg")||d(m,"src","/img/common/join-group.svg"),d(m,"id","join-group"),d(m,"alt","join group"),d(j,"id","condition-list"),d(L,"id","value-proposition-list"),d(no,"href","/"+o[4]+"/groups"),d(co,"href","/"+o[4]+"/communes"),d(ho,"href","/"+o[4]+"/cooperatives"),d(wo,"href","/"+o[4]+"/parties"),d(eo,"id","entities-list"),d($,"id","call-to-action-list"),d(Uo,"href","https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh"),d(Uo,"target","_blank"),d(Uo,"rel","noreferrer"),d(Co,"href","https://discord.gg/Qk8KUk787z"),d(Co,"target","_blank"),d(Co,"rel","noreferrer"),h(Eo,"id","map"),h(Eo,"callback",Jo=o[6]),d(i,"id","text-container"),d(t,"id","container")},m(o,s){e(o,t,s),f(t,i),f(i,r),f(r,n),f(i,a),f(i,m),f(i,v),f(i,j),f(j,k),f(k,w),f(j,y),f(j,x),f(x,P),f(j,N),f(j,S),f(S,T),f(j,z),f(j,O),O.innerHTML=_o,f(i,U),f(i,A),f(A,D),f(i,H),f(i,L),f(L,C),f(C,G),f(L,K),f(L,M),f(M,E),f(L,J),f(L,Q),f(Q,R),f(L,W),f(L,Y),f(Y,_),f(L,B),f(L,q),f(q,F),f(i,I),f(i,V),f(V,X),f(i,Z),f(i,$),f($,oo),f(oo,to),f($,io),f($,eo),f(eo,ro),f(ro,no),f(no,ao),f(ro,so),f(eo,mo),f(eo,lo),f(lo,co),f(co,po),f(eo,uo),f(eo,go),f(go,ho),f(ho,fo),f(go,bo),f(go,vo),f(eo,jo),f(eo,ko),f(ko,wo),f(wo,yo),f($,xo),f($,Po),f(Po,No),f(i,So),f(i,To),f(To,zo),f(To,Oo),f(To,Uo),f(Uo,Ao),f(To,Do),f(To,Ho),f(To,Lo),f(To,Co),f(Co,Go),f(To,Ko),f(i,Mo),f(i,Eo)},p(o,t){2&t&&Qo!==(Qo=o[1].heading+"")&&b(n,Qo),2&t&&Ro!==(Ro=o[1].condition1+"")&&b(w,Ro),2&t&&Wo!==(Wo=o[1].condition2+"")&&b(P,Wo),2&t&&Yo!==(Yo=o[1].condition3+"")&&b(T,Yo),2&t&&_o!==(_o=o[1].conditionsOutcome+"")&&(O.innerHTML=_o),2&t&&Bo!==(Bo=o[1].subheading1+"")&&b(D,Bo),2&t&&qo!==(qo=o[1].valueProposition1+"")&&b(G,qo),2&t&&Fo!==(Fo=o[1].valueProposition2+"")&&b(E,Fo),2&t&&Io!==(Io=o[1].valueProposition3+"")&&b(R,Io),2&t&&Vo!==(Vo=o[1].valueProposition4+"")&&b(_,Vo),2&t&&Xo!==(Xo=o[1].valueProposition5+"")&&b(F,Xo),2&t&&Zo!==(Zo=o[1].subheading2+"")&&b(X,Zo),2&t&&$o!==($o=o[1].findOur+"")&&b(to,$o),2&t&&ot!==(ot=o[1].group+"")&&b(ao,ot),2&t&&tt!==(tt=o[1].commune+"")&&b(po,tt),2&t&&it!==(it=o[1].cooperative+"")&&b(fo,it),2&t&&et!==(et=o[1].or+"")&&b(vo,et),2&t&&rt!==(rt=o[1].party+"")&&b(yo,rt),2&t&&nt!==(nt=o[1].nearYou+"")&&b(No,nt),2&t&&at!==(at=o[1].noneNear+"")&&b(zo,at),2&t&&st!==(st=o[1].WhatsAppGroup+"")&&b(Ao,st),2&t&&mt!==(mt=o[1].or+"")&&b(Ho,mt),2&t&<!==(lt=o[1].DiscordServer+"")&&b(Go,lt),2&t&&ct!==(ct=o[1].helpStart+"")&&b(Ko,ct),2&t&&Jo!==(Jo=o[6])&&h(Eo,"callback",Jo)},d(o){o&&s(t)}}}function U(o){let t,i=7==o[0]&&O(o);return{c(){i&&i.c(),t=n()},m(o,r){i&&i.m(o,r),e(o,t,r)},p(o,e){7==o[0]?i?i.p(o,e):(i=O(o),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(o){i&&i.d(o),o&&s(t)}}}function A(o){let t,i=o[0],m=U(o);return{c(){m.c(),t=n(),this.c=a},m(o,i){m.m(o,i),e(o,t,i)},p(o,[e]){1&e&&r(i,i=o[0])?(m.d(1),m=U(o),m.c(),m.m(t.parentNode,t)):m.p(o,e)},i:a,o:a,d(o){o&&s(t),m.d(o)}}}function D(o,t,i){let e,r,n=v(0);m(o,n,(o=>i(0,e=o)));let a,s,c=v({});m(o,c,(o=>i(1,r=o))),T(c,"groups-component",n),T(c,"communes-component",n),T(c,"cooperatives-component",n),T(c,"parties-component",n),T(c,"countries",n);let p=T(c,"join-us-component",n);function u(o,t,i){let e=o([22,0],2);j(a,s,e,t,i),x(e,t,i),w(e,t,i),N(e,t,i);let r={Groups:k,Communes:P,Coops:y,Parties:S};L.control.layers(null,r).addTo(e)}z("/assets/groups.json",(o=>{a=JSON.parse(o),s={};for(let o of a){let t=o.country;null==o.contact&&(o.contact="https://discord.gg/Qk8KUk787z"),t in s?s[t].push(o):s[t]=[o]}n.update((o=>o+1))})),l((()=>{}));return[e,r,n,c,p,u,o=>u(o,r,p)]}class H extends o{constructor(o){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},D,A,r,{},null),o&&o.target&&e(o.target,this,o.anchor)}}customElements.define("join-us-component",H);export{H as default};