Skip to content

Commit

Permalink
Merge branch 'master' into TMS-1034
Browse files Browse the repository at this point in the history
  • Loading branch information
eebbi authored May 13, 2024
2 parents 0a72a6e + 016da42 commit da50e18
Show file tree
Hide file tree
Showing 29 changed files with 642 additions and 104 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]

- TMS-1034: Add default text for articles related content title
- TMS-1032:
- Add seconds to countdown-timer block
- Change countdown update interval to a second if seconds are shown
- TMS-1028: Add social media link-list block, component & footer section

## [1.54.10] - 2024-05-07

Expand Down
6 changes: 6 additions & 0 deletions assets/icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,9 @@ import './veistospuisto.svg';
import './vkontakte.svg';
import './whatsapp.svg';
import './accessibility';
import './instagram.svg';
import './youtube.svg';
import './tiktok.svg';
import './snapchat.svg';
import './spotify.svg';
import './threads.svg';
3 changes: 3 additions & 0 deletions assets/icons/instagram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/snapchat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/spotify.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/threads.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/tiktok.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions assets/icons/twitter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/youtube.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions assets/scripts/countdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ export default class Countdown {
countdown.days_container = countdown.querySelector( '.countdown__time--days' );
countdown.hours_container = countdown.querySelector( '.countdown__time--hours' );
countdown.minutes_container = countdown.querySelector( '.countdown__time--minutes' );
countdown.seconds_container = countdown.querySelector( '.countdown__time--seconds' );
countdown.offset = countdown.dataset.offset ? countdown.dataset.offset : 0;

const target = parseInt( countdown.dataset.timestamp, 10 ) * 1000;

this.updateCountdownTime( countdown, target, null );

const MINUTE_IN_MS = 1000 * 60;
const SECONDS_IN_MS = 1000;

const interval = setInterval( () => {
this.updateCountdownTime( countdown, target, interval );
}, MINUTE_IN_MS );
}, countdown.seconds_container ? SECONDS_IN_MS : MINUTE_IN_MS );
}
}

Expand All @@ -61,11 +63,13 @@ export default class Countdown {
diff = targetTime - now,
days = Math.floor( diff / ( 1000 * 60 * 60 * 24 ) ),
hours = Math.floor( ( diff % ( 1000 * 60 * 60 * 24 ) ) / ( 1000 * 60 * 60 ) ),
minutes = Math.floor( ( diff % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) );
minutes = Math.floor( ( diff % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) ),
seconds = Math.floor( ( diff % ( 1000 * 60 ) ) / 1000 );

const isDaysExpired = days < 0;
const isHoursExpired = hours < 0;
const isMinutesExpired = minutes < 0;
const isSecondsExpired = seconds < 0;

if ( ! isDaysExpired && countdown.days_container ) {
countdown.days_container.querySelector( '.countdown__figure' ).innerHTML = days.toString();
Expand All @@ -79,7 +83,11 @@ export default class Countdown {
countdown.minutes_container.querySelector( '.countdown__figure' ).innerHTML = minutes.toString();
}

const isExpired = isDaysExpired && isHoursExpired && isMinutesExpired;
if ( ! isSecondsExpired && countdown.seconds_container ) {
countdown.seconds_container.querySelector( '.countdown__figure' ).innerHTML = seconds.toString();
}

const isExpired = isDaysExpired && isHoursExpired && isMinutesExpired && isSecondsExpired;

if ( isExpired ) {
countdown.classList.add( 'countdown--is-expired' );
Expand Down
7 changes: 7 additions & 0 deletions assets/styles/blocks/custom/_countdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
}
}
}

@include from($tablet) {
&--seconds {
width: 7.5rem;
text-align: center;
}
}
}

&__expired-text {
Expand Down
Binary file modified lang/fi.mo
Binary file not shown.
66 changes: 45 additions & 21 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-01-11 14:07+0200\n"
"PO-Revision-Date: 2024-01-11 14:08+0200\n"
"POT-Creation-Date: 2024-04-24 22:45+0300\n"
"PO-Revision-Date: 2024-04-24 22:46+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fi\n"
Expand All @@ -23,9 +23,28 @@ msgstr ""
"X-Poedit-SearchPathExcluded-1: vendor\n"
"X-Poedit-SearchPathExcluded-2: node_modules\n"

#: assets/dist/vendor.js:4630
msgctxt "text direction"
msgid "ltr"
#: assets/dist/vendor.js:1
msgid "entries"
msgstr ""

#: assets/dist/vendor.js:1
msgid "values"
msgstr ""

#: assets/dist/vendor.js:1
msgid "keys"
msgstr ""

#: assets/dist/vendor.js:1
msgid "Wrong index!"
msgstr ""

#: assets/dist/vendor.js:1
msgid "Wrong offset!"
msgstr ""

#: assets/dist/vendor.js:1
msgid "Wrong length!"
msgstr ""

#: comments.php:14
Expand Down Expand Up @@ -56,13 +75,13 @@ msgid "Open map"
msgstr "Avaa kartta"

#: lib/ACF/FrontPageGroup.php:38 lib/ACF/OnepagerGroup.php:73
#: lib/ACF/PageGroup.php:39
#: lib/ACF/PageGroup.php:41
msgctxt "theme ACF"
msgid "Page Components"
msgstr "Sivun komponentit"

#: lib/ACF/FrontPageGroup.php:90 lib/ACF/OnepagerGroup.php:126
#: lib/ACF/PageGroup.php:140 lib/ACF/PostGroup.php:173
#: lib/ACF/PageGroup.php:142 lib/ACF/PostGroup.php:173
msgctxt "theme ACF"
msgid "Components"
msgstr "Komponentit"
Expand Down Expand Up @@ -246,47 +265,47 @@ msgctxt "pagination"
msgid "Previous"
msgstr "Edellinen"

#: lib/Eventz.php:103
#: lib/Eventz.php:114
msgid "Dates"
msgstr "Päivät"

#: lib/Eventz.php:107
#: lib/Eventz.php:119
msgid "Time"
msgstr "Aika"

#: lib/Eventz.php:112
#: lib/Eventz.php:124
msgid "Location"
msgstr "Sijainti"

#: lib/Eventz.php:114
#: lib/Eventz.php:126
msgid "Price"
msgstr "Hinta"

#: lib/Eventz.php:116
#: lib/Eventz.php:128
msgid "Organizer"
msgstr "Järjestäjä"

#: lib/Eventz.php:117
#: lib/Eventz.php:129
msgid "Area"
msgstr ""

#: lib/Eventz.php:119
#: lib/Eventz.php:131
msgid "Target"
msgstr ""

#: lib/Eventz.php:121
#: lib/Eventz.php:133
msgid "Tags"
msgstr ""

#: lib/Eventz.php:125
#: lib/Eventz.php:137
msgid "Links"
msgstr "Linkit"

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

#: lib/Eventz.php:318
#: lib/Eventz.php:331
msgid "Free"
msgstr "Maksuton"

Expand All @@ -305,6 +324,11 @@ msgctxt "theme-frontend"
msgid "Minutes"
msgstr "Minuuttia"

#: lib/Formatters/CountdownFormatter.php:83 models/strings.php:232
msgctxt "theme-frontend"
msgid "Seconds"
msgstr "Sekuntia"

#: lib/Formatters/GridFormatter.php:151
msgid "Read more"
msgstr "Lue lisää"
Expand Down Expand Up @@ -659,7 +683,7 @@ msgid "Search from site"
msgstr "Hae sivustolta"

#: models/strings.php:55 models/strings.php:81 models/strings.php:143
#: models/strings.php:156 models/strings.php:165 models/strings.php:235
#: models/strings.php:156 models/strings.php:165 models/strings.php:236
msgctxt "theme-frontend"
msgid "Close"
msgstr "Sulje"
Expand Down Expand Up @@ -1103,12 +1127,12 @@ msgctxt "theme-frontend"
msgid "Dec"
msgstr "Jou"

#: models/strings.php:234
#: models/strings.php:235
msgctxt "theme-frontend"
msgid "Enlarged image"
msgstr "Suurennettu kuva"

#: models/strings.php:248
#: models/strings.php:249
msgid "Pagination"
msgstr "Sivutus"

Expand Down
Loading

0 comments on commit da50e18

Please sign in to comment.