mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
show events' location
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
### [Unreleased]
|
### [Unreleased]
|
||||||
#### Added
|
#### Added
|
||||||
|
- Show events' location if set: `description` and `locality` fields
|
||||||
#### Changed
|
#### Changed
|
||||||
#### Deprecated
|
#### Deprecated
|
||||||
#### Removed
|
#### Removed
|
||||||
|
@ -29,6 +29,26 @@ function displayEvents(data, list) {
|
|||||||
const textnode = document.createTextNode(dateText)
|
const textnode = document.createTextNode(dateText)
|
||||||
li.appendChild(textnode)
|
li.appendChild(textnode)
|
||||||
|
|
||||||
|
if (events[i].physicalAddress) {
|
||||||
|
let location = ''
|
||||||
|
if (events[i].physicalAddress.description) {
|
||||||
|
location += events[i].physicalAddress.description
|
||||||
|
}
|
||||||
|
if (location && events[i].physicalAddress.locality) {
|
||||||
|
location += ', '
|
||||||
|
}
|
||||||
|
if (events[i].physicalAddress.locality) {
|
||||||
|
location += events[i].physicalAddress.locality
|
||||||
|
}
|
||||||
|
if (location) {
|
||||||
|
const brBeforeLocation = document.createElement('br')
|
||||||
|
li.appendChild(brBeforeLocation)
|
||||||
|
|
||||||
|
const textnodeLocation = document.createTextNode(location)
|
||||||
|
li.appendChild(textnodeLocation)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
list.appendChild(li)
|
list.appendChild(li)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,11 @@ export function getUpcomingEvents({ url, limit }) {
|
|||||||
title,
|
title,
|
||||||
url,
|
url,
|
||||||
beginsOn,
|
beginsOn,
|
||||||
endsOn
|
endsOn,
|
||||||
|
physicalAddress {
|
||||||
|
description,
|
||||||
|
locality
|
||||||
|
}
|
||||||
},
|
},
|
||||||
total
|
total
|
||||||
}
|
}
|
||||||
@ -37,7 +41,11 @@ export function getUpcomingEventsByGroupName({ url, limit, groupName }) {
|
|||||||
title,
|
title,
|
||||||
url,
|
url,
|
||||||
beginsOn,
|
beginsOn,
|
||||||
endsOn
|
endsOn,
|
||||||
|
physicalAddress {
|
||||||
|
description,
|
||||||
|
locality
|
||||||
|
}
|
||||||
},
|
},
|
||||||
total
|
total
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user