mirror of
https://github.com/CIMEngine/map.git
synced 2024-11-05 20:13:58 +03:00
Update components.js
This commit is contained in:
parent
f3f59e0ce0
commit
61d60682a6
1 changed files with 11 additions and 3 deletions
|
@ -7,14 +7,14 @@ export function countryPopup(country, properties) {
|
|||
return `<div class="row" style="padding: 5px;">
|
||||
${img(country.img)}
|
||||
${title(country.name)}
|
||||
${tags(properties.tags)}
|
||||
<div class="col-12 glass p-2">
|
||||
${JSON.parse(properties.tags || "[]").join(", ")}
|
||||
${l("founded")}: ${new Date(country.date).toLocaleDateString()}
|
||||
${l("founded")}: ${new Date(country.date).toLocaleDateString()}<br/>
|
||||
${
|
||||
country.description
|
||||
? `<div>${converter.makeHtml(country.description)}</div>`
|
||||
: ""
|
||||
}
|
||||
}<br/>
|
||||
${l("area")}: ${properties.area} ${l("km")}²
|
||||
</div>
|
||||
<div class="col-12 text-center mt-2">
|
||||
|
@ -27,6 +27,14 @@ export function countryPopup(country, properties) {
|
|||
</div>`;
|
||||
}
|
||||
|
||||
function tags(tags) {
|
||||
let tagstxt = JSON.parse(tags || "[]").join(", ");
|
||||
|
||||
return tagstxt
|
||||
? `<div class="col-12 glass p-2 text-center mb-2"> ${tagstxt}</div>`
|
||||
: "";
|
||||
}
|
||||
|
||||
function img(url) {
|
||||
return `<div class="col-12 col-sm-12" style="padding: 0px;"><img class="w-100 about-img" src="${url}"></div>`;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue