Update
This commit is contained in:
@@ -4,17 +4,18 @@
|
||||
// Import statements
|
||||
import { onMount } from 'svelte'
|
||||
import { writable } from 'svelte/store';
|
||||
import { groups, addMarkersGroups } from '/js/groups.js'
|
||||
import { groupsByCountry, addMarkersGroups } from '/js/groups.js'
|
||||
import { loadLocaleContent} from "/js/libraries/serverTools.js"
|
||||
|
||||
// Import components
|
||||
import "/js/components/map-component.js"
|
||||
|
||||
// Main code
|
||||
let loaded
|
||||
let loaded = writable(0)
|
||||
let content = writable({})
|
||||
|
||||
let locale = loadLocaleContent(content,"groups-component",loaded)
|
||||
loadLocaleContent(content,"groups-component",loaded)
|
||||
loadLocaleContent(content,"countries",loaded)
|
||||
|
||||
function mapCallbackGroups(createMap,content) {
|
||||
let map = createMap([22, 0],2)
|
||||
@@ -22,26 +23,30 @@
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
|
||||
// {console.log(loaded)}
|
||||
})
|
||||
</script>
|
||||
|
||||
{#key loaded}
|
||||
{#if Object.keys($content).length!=0}
|
||||
{#key $loaded}
|
||||
{#if $loaded==2}
|
||||
<div id="container">
|
||||
<!--<img src="img/crowd.png" id="crowd" alt="crowd">-->
|
||||
<div id="text-container">
|
||||
<h1>{$content.heading}</h1>
|
||||
<img id="groups-img" src="/img/common/groups.svg" alt="groups">
|
||||
<p>{$content.p1}</p>
|
||||
<p>{$content.p2}</p>
|
||||
<h3>{$content.subheading1}</h3>
|
||||
<map-component id="map" callback={(createMap) => mapCallbackGroups(createMap,$content,locale)}></map-component>
|
||||
{#each groups as group}
|
||||
<div class="location-info">
|
||||
<p><b>{$content.location}: </b>{$content[group.location[0]]}</p>
|
||||
<p><b>{$content.members}: </b>{group.members}</p>
|
||||
<p><b>{$content.contact}: </b><a href={group.contact[0]} target=;_blank; rel=noreferrer>{$content[group.contact[1]]}</a></p>
|
||||
<map-component id="map" callback={(createMap) => mapCallbackGroups(createMap,$content)}></map-component>
|
||||
{#each Object.entries(groupsByCountry) as [name,groups]}
|
||||
<h4 class="country-name">{$content[name]}</h4>
|
||||
<div class="country-block">
|
||||
{#each groups as group}
|
||||
<div class="location-info">
|
||||
<p><b>{$content.location}: </b>{$content[group.location[0][0]] + (group.location[0][1]=="" ? "" : ", " + $content[group.location[0][1]])}</p>
|
||||
<p><b>{$content.members}: </b>{group.members}</p>
|
||||
<p><b>{$content.contact}: </b><a href={group.contact[0]} target=;_blank; rel=noreferrer>{$content[group.contact[1]]}</a></p>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -65,12 +70,16 @@
|
||||
margin-top: 8rem;
|
||||
}
|
||||
|
||||
h4 {
|
||||
.country-name {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.country-block {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.location-info {
|
||||
margin-bottom: 2rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.location-info p {
|
||||
|
Reference in New Issue
Block a user