Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-10772: Add events list to Helsinki near you #792

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,22 @@ public function content(Request $request) : array|RedirectResponse {
return [
'#attached' => [
'drupalSettings' => [
'helsinki_near_you' => [
'events_api_url' => $this->linkedEvents->getEventsRequest([
'dwithin_origin' => $addressData['coordinates'],
'dwithin_distance' => 1000,
]),
'helfi_events' => [
'baseUrl' => LinkedEvents::BASE_URL,
'data' => [
'helfi-coordinates-based-event-list' => [
'events_api_url' => $this->linkedEvents->getEventsRequest([
'dwithin_origin' => implode(',', $addressData['coordinates']),
'dwithin_metres' => 2000,
]),
'field_event_count' => 3,
],
],
'seeAllButtonOverride' => $this->t('See all events', [], ['context' => 'Helsinki near you']),
'useExperimentalGhosts' => TRUE,
],
],
'library' => ['hdbt/event-list'],
],
'#back_link_label' => $this->t('Edit address', [], ['context' => 'Helsinki near you']),
'#back_link_url' => $return_url,
Expand Down
12 changes: 12 additions & 0 deletions public/modules/custom/helfi_etusivu/translations/fi.po
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,15 @@ msgstr "Antamallasi osoitteella ei löytynyt tuloksia. Voit kokeilla muuttaa hak
msgctxt "Helsinki near you"
msgid "Search"
msgstr "Hae"

msgctxt "Helsinki near you"
msgid "See all events"
msgstr "Katso kaikki tapahtumat"

msgctxt "Helsinki near you"
msgid "Events near you"
msgstr "Tapahtumat lähelläsi"

msgctxt "Helsinki near you"
msgid "Browse events near you, sorted by their start time"
msgstr "Tutustu tapahtumiin tapahtumisajan mukaisessa järjestyksessä."
12 changes: 12 additions & 0 deletions public/modules/custom/helfi_etusivu/translations/sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,15 @@ msgstr "Adressen du angav gav inga resultat. Du kanske vill prova en annan adres
msgctxt "Helsinki near you"
msgid "Search"
msgstr "Söka"

msgctxt "Helsinki near you"
msgid "See all events"
msgstr "Se alla evenemang"

msgctxt "Helsinki near you"
msgid "Events near you"
msgstr "Evenemang nära dig"

msgctxt "Helsinki near you"
msgid "Browse events near you, sorted by their start time"
msgstr "Utforska evenemang i ordning efter deras starttid."
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,33 @@
} %}
{% endblock component_content %}
{% endembed %}
{% embed "@hdbt/misc/component.twig" with
{
component_classes: [
'component--full-width',
'component--react-search',
'component--event-list',
'component--coordinates-based-event-list',
],
component_title: 'Events near you'|trans({}, {'context': 'Helsinki near you'}),
component_description: 'Browse events near you, sorted by their start time'|trans({}, {'context': 'Helsinki near you'}),
component_content_class: 'event-list',
}
%}
{% block component_content %}
{# Hook React app to this div #}
<div
id="helfi-events-search"
data-paragraph-id="helfi-coordinates-based-event-list"
>
</div>
{# Indicate JS not enabled #}
<noscript>
<div class="event-list__javascript-disabled">
{{ 'You must enable JavaScript in your browser for event list to work'|t }}
</div>
</noscript>
{% endblock %}
{% endembed %}
</div>
</article>
Loading