From 6e9dfa3b3cab0dfb99e142badbf01cab7686cf70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20V=C3=A4nttinen?= <31741222+eebbi@users.noreply.github.com> Date: Mon, 13 May 2024 21:09:03 +0300 Subject: [PATCH 1/3] TMS-1029: Change contacts-blocks width (#30) --- CHANGELOG.MD | 2 ++ partials/blocks/block-contacts.dust | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index b7091af..b4fd2c8 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +- TMS-1029: Change contacts-blocks width + ## [1.3.3] - 2024-03-26 - TMS-1013: Add event weekly entry dates to event partial diff --git a/partials/blocks/block-contacts.dust b/partials/blocks/block-contacts.dust index 9027d6d..abfbc5a 100644 --- a/partials/blocks/block-contacts.dust +++ b/partials/blocks/block-contacts.dust @@ -1,14 +1,14 @@ -
+
{?title}

- {title|s} + {title|html}

{/title} {?description} - {description|s} + {description|kses} {/description}
From 3675e1cc0b1b24984d4147abcf595dc1279c39dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20V=C3=A4nttinen?= Date: Mon, 13 May 2024 21:20:52 +0300 Subject: [PATCH 2/3] 1.3.4 --- CHANGELOG.MD | 2 ++ style.css | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index b4fd2c8..25cb476 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [1.3.4] - 2024-05-14 + - TMS-1029: Change contacts-blocks width ## [1.3.3] - 2024-03-26 diff --git a/style.css b/style.css index f497754..a1caff0 100644 --- a/style.css +++ b/style.css @@ -1,7 +1,7 @@ /* * Theme Name: TMS Theme Vapriikki * Description: Tampere Multisite Vapriikki Theme - * Version: 1.3.3 + * Version: 1.3.4 * Author: Geniem * Author URI: https://geniem.fi * Template: tms-theme-base From 1cb6bec786abf9280c76b70a9a9d7ba023af2c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20V=C3=A4nttinen?= Date: Tue, 14 May 2024 14:35:03 +0300 Subject: [PATCH 3/3] TMS-1028: Add social-media link column to footer --- CHANGELOG.MD | 2 ++ models/shared/footer.php | 22 ++++++++++++++++++++++ partials/shared/footer-inner.dust | 24 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 25cb476..534c7b6 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +- TMS-1028: Add social-media link column to footer + ## [1.3.4] - 2024-05-14 - TMS-1029: Change contacts-blocks width diff --git a/models/shared/footer.php b/models/shared/footer.php index 0830ce9..74d1f62 100644 --- a/models/shared/footer.php +++ b/models/shared/footer.php @@ -42,9 +42,11 @@ public function column_class() : string { $contact_info = $this->contact_info(); $second_contact_info = $this->second_contact_info(); $columns = $this->link_columns(); + $some_column = $this->some_link_columns(); $count = empty( $columns ) ? 0 : count( $columns ); $count = empty( $contact_info ) ? $count : ++ $count; $count = empty( $second_contact_info ) ? $count : ++ $count; + $count = empty( $some_column ) ? $count : ++ $count; return $count <= 3 ? 'is-6 is-4-widescreen' @@ -113,6 +115,26 @@ public function link_columns() { return $columns; } + /** + * Get social media link column + * + * @return mixed|null + */ + public function some_link_columns() { + $columns = Settings::get_setting( 'some_link_columns' ) ?? null; + + if ( empty( $columns['some_link_column'] ) ) { + return null; + } + + // Filter out empty links + $columns['some_link_column'] = array_filter( $columns['some_link_column'], function ( $item ) { + return ! empty( $item['some_link']['title'] ); + } ); + + return $columns; + } + /** * Get privacy links * diff --git a/partials/shared/footer-inner.dust b/partials/shared/footer-inner.dust index b27dce1..45717dc 100644 --- a/partials/shared/footer-inner.dust +++ b/partials/shared/footer-inner.dust @@ -77,6 +77,30 @@ {#link_columns} {>"shared/footer-column" /} {/link_columns} + + {?some_link_columns} +
+ {?some_link_columns.column_title} +

+ {some_link_columns.column_title|html} +

+ {/some_link_columns.column_title} + + +
+ {/some_link_columns}