mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
add facts support to maps
This commit is contained in:
parent
400efb8064
commit
dcb823a0a1
2 changed files with 33 additions and 5 deletions
|
@ -44,9 +44,24 @@ function renderPlaceCard(context, place) {
|
|||
cards[0].description += `\n\n${place.description}`
|
||||
}
|
||||
|
||||
if(place.facts?.length) {
|
||||
let fc = 1;
|
||||
cards[0].fields = place.facts.map((f)=>{
|
||||
let factField = {
|
||||
name: f.label,
|
||||
value: f.value,
|
||||
inline: true
|
||||
}
|
||||
|
||||
if(f.source){
|
||||
factField.value += citation(fc++, f.source.url, f.source.label)
|
||||
}
|
||||
|
||||
return factField;
|
||||
})
|
||||
}
|
||||
|
||||
if (place.photos?.length) {
|
||||
|
||||
cards[0].image = {
|
||||
url: place.photos.shift()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue