Ajouté quelques widgets
This commit is contained in:
parent
e61c495cc4
commit
9c5c4181b2
8 changed files with 189 additions and 35 deletions
22
js/feature-widgets/capacite-dortoir.js
Normal file
22
js/feature-widgets/capacite-dortoir.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
export function capaciteDortoirWidget(feature){
|
||||
if(feature.properties["n couchage"]){
|
||||
let content = document.createElement("div")
|
||||
content.classList.add("widget")
|
||||
content.classList.add("table-widget")
|
||||
content.classList.add("capacite-dortoir-widget")
|
||||
|
||||
let fielName = document.createElement("h2");
|
||||
fielName.textContent = "Capacité :"
|
||||
content.append(fielName)
|
||||
|
||||
let value = document.createElement("p");
|
||||
if(feature.properties["n couchage"] > 1){
|
||||
value.textContent = `${feature.properties["n couchage"]} lits`
|
||||
} else {
|
||||
value.textContent = `${feature.properties["n couchage"]} lit`
|
||||
}
|
||||
content.append(value)
|
||||
|
||||
return content
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue