Skip to content
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
3 changes: 3 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

- TMS-1100: Show multiple locations for events if available

## [1.59.6] - 2025-02-18

- Add scripts to be ignored by Cookiebot


## [1.59.5] - 2025-01-22

- TMS-1091: Remove align-wide class from accordion block
Expand Down
Binary file modified lang/fi.mo
Binary file not shown.
30 changes: 17 additions & 13 deletions lang/fi.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: TMS Theme Base\n"
"POT-Creation-Date: 2024-11-13 20:00+0200\n"
"PO-Revision-Date: 2024-11-13 20:01+0200\n"
"POT-Creation-Date: 2025-01-30 19:55+0200\n"
"PO-Revision-Date: 2025-01-30 19:55+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fi\n"
Expand Down Expand Up @@ -284,7 +284,7 @@ msgstr "Edellinen"
msgid "Purchase tickets"
msgstr "Osta liput"

#: lib/Eventz.php:122 lib/Eventz.php:171
#: lib/Eventz.php:122 lib/Eventz.php:172
msgid "Sign up"
msgstr "Ilmoittaudu"

Expand All @@ -304,35 +304,39 @@ msgstr "Aika"
msgid "Location"
msgstr "Sijainti"

#: lib/Eventz.php:158
#: lib/Eventz.php:159
msgid "Price"
msgstr "Hinta"

#: lib/Eventz.php:160
#: lib/Eventz.php:161
msgid "Organizer"
msgstr "Järjestäjä"

#: lib/Eventz.php:161
#: lib/Eventz.php:162
msgid "Area"
msgstr ""

#: lib/Eventz.php:163
#: lib/Eventz.php:164
msgid "Target"
msgstr ""

#: lib/Eventz.php:165
#: lib/Eventz.php:166
msgid "Tags"
msgstr ""

#: lib/Eventz.php:169
#: lib/Eventz.php:170
msgid "Links"
msgstr "Linkit"

#: lib/Eventz.php:389
#: lib/Eventz.php:367
msgid "and other locations"
msgstr "ja muita tapahtumapaikkoja"

#: lib/Eventz.php:411
msgid "Additional information"
msgstr "Lisätiedot"

#: lib/Eventz.php:406
#: lib/Eventz.php:428
msgid "Free"
msgstr "Maksuton"

Expand Down Expand Up @@ -638,7 +642,7 @@ msgstr "Päättymispäivä"
msgid "No search term given"
msgstr "Hakusanaa ei annettu"

#: models/page-events-search.php:212 models/search.php:228
#: models/page-events-search.php:212 models/search.php:239
#, php-format
msgctxt "search results summary"
msgid "%1$1s result found for \"%2$2s\""
Expand Down Expand Up @@ -666,7 +670,7 @@ msgstr "Rajaa hakua"
msgid "Looking for events? Use the event search!"
msgstr "Etsitkö tapahtumia? Käytä tapahtumahakua!"

#: models/search.php:239
#: models/search.php:250
msgid "No search results"
msgstr "Ei hakutuloksia"

Expand Down
28 changes: 16 additions & 12 deletions lang/tms-theme-base.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: TMS Theme Base\n"
"POT-Creation-Date: 2024-11-13 20:00+0200\n"
"POT-Creation-Date: 2025-01-30 19:55+0200\n"
"PO-Revision-Date: 2022-01-12 10:08+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down Expand Up @@ -284,7 +284,7 @@ msgstr ""
msgid "Purchase tickets"
msgstr ""

#: lib/Eventz.php:122 lib/Eventz.php:171
#: lib/Eventz.php:122 lib/Eventz.php:172
msgid "Sign up"
msgstr ""

Expand All @@ -304,35 +304,39 @@ msgstr ""
msgid "Location"
msgstr ""

#: lib/Eventz.php:158
#: lib/Eventz.php:159
msgid "Price"
msgstr ""

#: lib/Eventz.php:160
#: lib/Eventz.php:161
msgid "Organizer"
msgstr ""

#: lib/Eventz.php:161
#: lib/Eventz.php:162
msgid "Area"
msgstr ""

#: lib/Eventz.php:163
#: lib/Eventz.php:164
msgid "Target"
msgstr ""

#: lib/Eventz.php:165
#: lib/Eventz.php:166
msgid "Tags"
msgstr ""

#: lib/Eventz.php:169
#: lib/Eventz.php:170
msgid "Links"
msgstr ""

#: lib/Eventz.php:389
#: lib/Eventz.php:367
msgid "and other locations"
msgstr ""

#: lib/Eventz.php:411
msgid "Additional information"
msgstr ""

#: lib/Eventz.php:406
#: lib/Eventz.php:428
msgid "Free"
msgstr ""

Expand Down Expand Up @@ -632,7 +636,7 @@ msgstr ""
msgid "No search term given"
msgstr ""

#: models/page-events-search.php:212 models/search.php:228
#: models/page-events-search.php:212 models/search.php:239
#, php-format
msgctxt "search results summary"
msgid "%1$1s result found for \"%2$2s\""
Expand Down Expand Up @@ -660,7 +664,7 @@ msgstr ""
msgid "Looking for events? Use the event search!"
msgstr ""

#: models/search.php:239
#: models/search.php:250
msgid "No search results"
msgstr ""

Expand Down
40 changes: 38 additions & 2 deletions lib/Eventz.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ public static function normalize_event( $event ) : array {
'end_date_raw' => static::get_as_datetime( $event->event->end ),
'location_title' => __( 'Location', 'tms-theme-base' ),
'location' => static::get_event_location( $event ),
'multiple_locations' => static::get_event_multiple_locations( $event ),
'location_count' => static::count_locations( $event ),
'price_title' => __( 'Price', 'tms-theme-base' ),
'price' => static::get_event_price_info( $event, $lang_key ),
'provider_title' => __( 'Organizer', 'tms-theme-base' ),
Expand Down Expand Up @@ -334,16 +336,50 @@ public static function get_event_time( $event ) {
/**
* Get event location.
*
* @param object $event Event object.
* @param object $event Event object.
*
* @return array
*/
public static function get_event_location( $event ) {

return [
'name' => $event->locations[0]->address ?? null,
];
}

/**
* Get all event locations if more than one exists.
*
* @param object $event Event object.
*
* @return array
*/
public static function get_event_multiple_locations( $event ) {
$event_locations = [];

if ( count( $event->locations ) <= 1 ) {
return $event_locations;
}

foreach ( $event->locations as $location ) {
$event_locations[] = [
'name' => $location->address ?? null
];
}

return $event_locations;
}

/**
* Get event location.
*
* @param object $event Event object.
*
* @return array
*/
public static function count_locations( $event ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kuvaavampi voisi olla ehkä joku get_locations_count_string tms., kun käännöksestä kyse, mutta ei tarvi muuttaa.

return [
'other_locations_string' => count( $event->locations ) > 1 ? \__( 'and other locations', 'tms-theme-base' ) : null,
];
}

/**
Expand Down
13 changes: 9 additions & 4 deletions partials/ui/event-highlight.dust
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
{>"ui/icon" icon="date" class="icon--large is-primary mr-4 {classes.event_item_icon|attr}" /}
</span>

{date|kses}
<p class="mt-0 mb-0">{date|kses}</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Olikohan Bulmassa my-0 joka laittaa y-akselin marginit nolliin 🤔 ei tarvi vaihtaa, aika pieni optimointi, jos tollasta edes oli olemassa

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taitaa löytyä my-0, mutta päätin tehdä näin kun copy-pastesin nää muutokset jokaiseen museoteemaankin, niin tää pitää ainakin varmana ettei häviä tyylejä jos jostain sattuu löytymään sivuttais-margineita 🤓

</div>

<div class="is-flex is-align-items-center mt-2 mb-2 {classes.event_item_text|attr}">
<span class="is-flex" aria-label="{Strings.s.event.time|attr}">
{>"ui/icon" icon="time" class="icon--large is-primary mr-4 {classes.event_item_icon|attr}" /}
</span>

{time|kses}
<p class="mt-0 mb-0">{time|kses}</p>
</div>

{?location.name}
Expand All @@ -39,7 +39,12 @@
{>"ui/icon" icon="location" class="icon--large is-primary mr-4 {classes.event_item_icon|attr}" /}
</span>

{location.name|html}
<p class="mt-0 mb-0">
{location.name|html}
{?location_count.other_locations_string}
{location_count.other_locations_string|html}
{/location_count.other_locations_string}
</p>
</div>
{/location.name}

Expand All @@ -50,7 +55,7 @@
{>"ui/icon" icon="euro" class="icon--large is-primary mr-2 {item_classes.grid.icon|attr}" /}
</span>

{price|html}
<p class="mt-0 mb-0">{price|html}</p>
</div>
{/is_free}
{/price}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
{>"ui/icon" icon="date" class="icon--large is-primary mr-2 {item_classes.grid.icon|attr}" /}
</span>

{date|html}
<p class="mt-0 mb-0">{date|html}</p>
</div>

<div class="is-flex is-align-items-center mt-2 mb-2">
<span class="is-flex" aria-label="{Strings.s.event.time|attr}">
{>"ui/icon" icon="time" class="icon--large is-primary mr-2 {item_classes.grid.icon|attr}" /}
</span>

{time|html}
<p class="mt-0 mb-0">{time|html}</p>
</div>

{?location.name}
Expand All @@ -47,7 +47,12 @@
{>"ui/icon" icon=location_icon class="icon--large is-primary mr-2 {item_classes.grid.icon|attr}" /}
</span>

{location.name|html}
<p class="mt-0 mb-0">
{location.name|html}
{?location_count.other_locations_string}
{location_count.other_locations_string|html}
{/location_count.other_locations_string}
</p>
</div>
{/location.name}

Expand All @@ -58,7 +63,7 @@
{>"ui/icon" icon="euro" class="icon--large is-primary mr-2 {item_classes.grid.icon|attr}" /}
</span>

{price|html}
<p class="mt-0 mb-0">{price|html}</p>
</div>
{/is_free}
{/price}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
{>"ui/icon" icon="date" class="icon--large is-primary mr-2 {item_classes.list.icon|attr}" /}
</span>

{date|html}
<p class="mt-0 mb-0">{date|html}</p>
</div>

<div class="is-flex is-align-items-center mt-2 mb-2 mr-4 {item_classes.list.meta_label|attr}">
<span class="is-flex" aria-label="{Strings.s.event.time|attr}">
{>"ui/icon" icon="time" class="icon--large is-primary mr-2 {item_classes.list.icon|attr}" /}
</span>

{time|html}
<p class="mt-0 mb-0">{time|html}</p>
</div>

{?location.name}
Expand All @@ -50,7 +50,12 @@
{>"ui/icon" icon=location_icon class="icon--large is-primary mr-2 {item_classes.list.icon|attr}" /}
</span>

{location.name|html}
<p class="mt-0 mb-0">
{location.name|html}
{?location_count.other_locations_string}
{location_count.other_locations_string|html}
{/location_count.other_locations_string}
</p>
</div>
{/location.name}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="is-flex is-flex-wrap-wrap is-justify-content-space-between">
{?event.normalized.date}
<div class="is-flex is-align-items-center has-width-100-until-desktop mb-3 mb-0-desktop">
{>"ui/icon" icon="date" class="icon--xlarge mr-4 mr-6-desktop {template_classes.hero_icon|s}" /}
{>"ui/icon" icon="date" class="icon--xlarge mr-4 mr-6-desktop {template_classes.hero_icon|attr}" /}
<p class="mt-0 mb-0">
{event.normalized.date|html}
</p>
Expand All @@ -10,7 +10,7 @@

{?event.normalized.time}
<div class="is-flex is-align-items-center has-width-100-until-desktop mb-3 mb-0-desktop">
{>"ui/icon" icon="time" class="icon--xlarge mr-4 mr-6-desktop {template_classes.hero_icon|s}" /}
{>"ui/icon" icon="time" class="icon--xlarge mr-4 mr-6-desktop {template_classes.hero_icon|attr}" /}
<p class="mt-0 mb-0">
{event.normalized.time|html}
</p>
Expand All @@ -19,9 +19,12 @@

{?event.normalized.location}
<div class="is-flex is-align-items-center has-width-100-until-desktop">
{>"ui/icon" icon="location" class="icon--xlarge mr-4 mr-6-desktop {template_classes.hero_icon|s}" /}
{>"ui/icon" icon="location" class="icon--xlarge mr-4 mr-6-desktop {template_classes.hero_icon|attr}" /}
<p class="mt-0 mb-0">
{event.normalized.location.name|html}
{?event.normalized.location_count.other_locations_string}
{event.normalized.location_count.other_locations_string|html}
{/event.normalized.location_count.other_locations_string}
</p>
</div>
{/event.normalized.location}
Expand Down
Loading
Loading