diff --git a/source/connector-mobilizon/changelog.txt b/source/connector-mobilizon/changelog.txt index 4a0e813..17d9b3f 100644 --- a/source/connector-mobilizon/changelog.txt +++ b/source/connector-mobilizon/changelog.txt @@ -1,5 +1,6 @@ ### [Unreleased] #### Added +- Show events' location if set: `description` and `locality` fields #### Changed #### Deprecated #### Removed diff --git a/source/connector-mobilizon/front/events-loader.js b/source/connector-mobilizon/front/events-loader.js index 0b31883..1f8e16a 100644 --- a/source/connector-mobilizon/front/events-loader.js +++ b/source/connector-mobilizon/front/events-loader.js @@ -29,6 +29,26 @@ function displayEvents(data, list) { const textnode = document.createTextNode(dateText) 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) } } diff --git a/source/connector-mobilizon/front/graphql-wrapper.js b/source/connector-mobilizon/front/graphql-wrapper.js index cbe9684..e206c54 100644 --- a/source/connector-mobilizon/front/graphql-wrapper.js +++ b/source/connector-mobilizon/front/graphql-wrapper.js @@ -11,7 +11,11 @@ export function getUpcomingEvents({ url, limit }) { title, url, beginsOn, - endsOn + endsOn, + physicalAddress { + description, + locality + } }, total } @@ -37,7 +41,11 @@ export function getUpcomingEventsByGroupName({ url, limit, groupName }) { title, url, beginsOn, - endsOn + endsOn, + physicalAddress { + description, + locality + } }, total }