Update
This commit is contained in:
@@ -4,16 +4,17 @@
|
||||
// Import statements
|
||||
import { onMount } from 'svelte'
|
||||
import { writable } from 'svelte/store';
|
||||
import { coops, addMarkersCoops } from '/js/coops.js'
|
||||
import { coopsByCountry, addMarkersCoops } from '/js/coops.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({})
|
||||
|
||||
loadLocaleContent(content,"countries",loaded)
|
||||
let locale = loadLocaleContent(content,"cooperatives-component",loaded)
|
||||
|
||||
function mapCallbackCoops(createMap,content) {
|
||||
@@ -26,35 +27,39 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
{#key loaded}
|
||||
{#if Object.keys($content).length!=0}
|
||||
{#key $loaded}
|
||||
{#if $loaded==2}
|
||||
<div id="container">
|
||||
<div id="text-container">
|
||||
<h1>{$content.heading}</h1>
|
||||
<img id="coops-img" src="/img/common/coops.svg" alt="coops">
|
||||
<p>{$content.p1}</p>
|
||||
<p>{$content.p2}</p>
|
||||
<h3>{$content.subheading1}</h3>
|
||||
<map-component id="map" callback={(createMap) => mapCallbackCoops(createMap,$content,locale)}></map-component>
|
||||
{#each coops as coop}
|
||||
<div class="location-info">
|
||||
<div class="img-general-info">
|
||||
<div>
|
||||
<p><b>{$content.name}: </b>{coop.name}</p>
|
||||
<p><b>{$content.location}: </b>{$content[coop.location[0]]}</p>
|
||||
<p><b>{$content.market}: </b>{$content[coop.market]}</p>
|
||||
<p><b>{$content.workers}: </b>{coop.workers}</p>
|
||||
<p><b>{$content.status}: </b>{$content[coop.status]}</p>
|
||||
<p><b>{$content.website}: </b><a href={"https://www."+coop.website} target="_blank" rel=noreferrer>{coop.website}</a></p>
|
||||
<p><b>{$content.contact}: </b><a href={coop.contact[0]} target=;_blank; rel=noreferrer>{$content[coop.contact[1]]}</a></p>
|
||||
{#each Object.entries(coopsByCountry) as [name,coops]}
|
||||
<h4 class="country-name">{$content[name]}</h4>
|
||||
<div class="country-block">
|
||||
{#each coops as coop}
|
||||
<div class="location-info">
|
||||
<div class="img-general-info">
|
||||
<div>
|
||||
<p><b>{$content.name}: </b>{coop.name}</p>
|
||||
<p><b>{$content.location}: </b>{$content[coop.location[0][0]] + (coop.location[0][1]=="" ? "" : ", " + $content[coop.location[0][1]])}</p>
|
||||
<p><b>{$content.market}: </b>{$content[coop.market]}</p>
|
||||
<p><b>{$content.workers}: </b>{coop.workers}</p>
|
||||
<p><b>{$content.status}: </b>{$content[coop.status]}</p>
|
||||
<p><b>{$content.website}: </b><a href={"https://www."+coop.website} target="_blank" rel=noreferrer>{coop.website}</a></p>
|
||||
<p><b>{$content.contact}: </b><a href={coop.contact[0]} target=;_blank; rel=noreferrer>{$content[coop.contact[1]]}</a></p>
|
||||
</div>
|
||||
<picture>
|
||||
<source srcset={"/img/coops/"+coop.logo+".webp"}>
|
||||
<source srcset={"/img/coops/"+coop.logo+".png"}>
|
||||
<img class="coop-logo" alt="logo">
|
||||
</picture>
|
||||
</div>
|
||||
<p><b>{$content.description}: </b>{$content[coop.description]}</p>
|
||||
</div>
|
||||
<picture>
|
||||
<source srcset={"/img/coops/"+coop.logo+".webp"}>
|
||||
<source srcset={"/img/coops/"+coop.logo+".png"}>
|
||||
<img class="coop-logo" alt="logo">
|
||||
</picture>
|
||||
</div>
|
||||
<p><b>{$content.description}: </b>{$content[coop.description]}</p>
|
||||
{/each}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -98,13 +103,17 @@
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
h4 {
|
||||
.country-name {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.country-block {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.location-info {
|
||||
position: relative;
|
||||
margin-bottom: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.location-info p {
|
||||
|
Reference in New Issue
Block a user