From d7957dc3e7529aa15f355ea404b0d82ebd03ebac Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Thu, 10 Oct 2024 23:39:59 +0100 Subject: [PATCH 1/6] Add remote icon block --- .../blocks/user-remote-attendance-mode/index.php | 12 ++++++++++++ themes/wporg-translate-events-2024/functions.php | 1 + 2 files changed, 13 insertions(+) create mode 100644 themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php diff --git a/themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php b/themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php new file mode 100644 index 00000000..57e270fc --- /dev/null +++ b/themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php @@ -0,0 +1,12 @@ + function () { + return ''; + }, + ) +); diff --git a/themes/wporg-translate-events-2024/functions.php b/themes/wporg-translate-events-2024/functions.php index 2afd5611..6a45b375 100644 --- a/themes/wporg-translate-events-2024/functions.php +++ b/themes/wporg-translate-events-2024/functions.php @@ -30,6 +30,7 @@ function register_blocks(): void { include_once __DIR__ . '/blocks/pages/events/event-create/index.php'; include_once __DIR__ . '/blocks/event-form/index.php'; include_once __DIR__ . '/blocks/pages/events/event-edit/index.php'; + include_once __DIR__ . '/blocks/user-remote-attendance-mode/index.php'; } function register_patterns(): void { From 9834b08590cd27eff6e8cd27beeda8b161be65f9 Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Thu, 10 Oct 2024 23:44:51 +0100 Subject: [PATCH 2/6] Use remote icon block in attendee and contributor list --- .../blocks/attendee-list/render-list.php | 3 +++ .../blocks/contributor-list/index.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php b/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php index 4f759d75..17b143b5 100644 --- a/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php +++ b/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php @@ -40,6 +40,9 @@ ); ?> /--> + is_remote() ) : ?> + +
diff --git a/themes/wporg-translate-events-2024/blocks/contributor-list/index.php b/themes/wporg-translate-events-2024/blocks/contributor-list/index.php index c407b0be..ddb5ea2e 100644 --- a/themes/wporg-translate-events-2024/blocks/contributor-list/index.php +++ b/themes/wporg-translate-events-2024/blocks/contributor-list/index.php @@ -61,6 +61,9 @@ function ( Attendee $attendee ) { ); ?> /--> + is_remote() ) : ?> + +
From a48b05e18f9665c7ae9dc7458b5f5961b97e710d Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Mon, 14 Oct 2024 15:45:05 +0100 Subject: [PATCH 3/6] Position the video icon --- .../blocks/user-remote-attendance-mode/index.php | 2 +- themes/wporg-translate-events-2024/style.css | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php b/themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php index 57e270fc..1a09a0d3 100644 --- a/themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php +++ b/themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php @@ -6,7 +6,7 @@ array( // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found 'render_callback' => function () { - return ''; + return ''; }, ) ); diff --git a/themes/wporg-translate-events-2024/style.css b/themes/wporg-translate-events-2024/style.css index 805d4754..04364c35 100644 --- a/themes/wporg-translate-events-2024/style.css +++ b/themes/wporg-translate-events-2024/style.css @@ -162,6 +162,12 @@ select.wp-block-form-input__input { background-color: #46b450; } +span.user-remote-icon.dashicons-video-alt2 { + margin-left: -8.8%; + margin-top: 32px; + color: var(--wp--preset--color--blueberry-1); +} + @media (min-width: 960px) { .wporg-marker-list__container .wporg-marker-list-item { From 3ca5fc07dfe389d8d0681783b0727429ee5d7265 Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Mon, 14 Oct 2024 17:08:07 +0100 Subject: [PATCH 4/6] Rename block to remote-attendance-block --- .../blocks/attendee-list/render-list.php | 2 +- .../blocks/contributor-list/index.php | 2 +- .../index.php | 2 +- themes/wporg-translate-events-2024/functions.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename themes/wporg-translate-events-2024/blocks/{user-remote-attendance-mode => remote-attendance-icon}/index.php (82%) diff --git a/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php b/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php index 17b143b5..4247da4f 100644 --- a/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php +++ b/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php @@ -41,7 +41,7 @@ ?> /--> is_remote() ) : ?> - +
diff --git a/themes/wporg-translate-events-2024/blocks/contributor-list/index.php b/themes/wporg-translate-events-2024/blocks/contributor-list/index.php index ddb5ea2e..5b37135b 100644 --- a/themes/wporg-translate-events-2024/blocks/contributor-list/index.php +++ b/themes/wporg-translate-events-2024/blocks/contributor-list/index.php @@ -62,7 +62,7 @@ function ( Attendee $attendee ) { ?> /--> is_remote() ) : ?> - +
diff --git a/themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php b/themes/wporg-translate-events-2024/blocks/remote-attendance-icon/index.php similarity index 82% rename from themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php rename to themes/wporg-translate-events-2024/blocks/remote-attendance-icon/index.php index 1a09a0d3..9cf842ea 100644 --- a/themes/wporg-translate-events-2024/blocks/user-remote-attendance-mode/index.php +++ b/themes/wporg-translate-events-2024/blocks/remote-attendance-icon/index.php @@ -2,7 +2,7 @@ namespace Wporg\TranslationEvents\Theme_2024; register_block_type( - 'wporg-translate-events-2024/user-remote-attendance-mode', + 'wporg-translate-events-2024/remote-attendance-icon', array( // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found 'render_callback' => function () { diff --git a/themes/wporg-translate-events-2024/functions.php b/themes/wporg-translate-events-2024/functions.php index 6a45b375..ac599d50 100644 --- a/themes/wporg-translate-events-2024/functions.php +++ b/themes/wporg-translate-events-2024/functions.php @@ -30,7 +30,7 @@ function register_blocks(): void { include_once __DIR__ . '/blocks/pages/events/event-create/index.php'; include_once __DIR__ . '/blocks/event-form/index.php'; include_once __DIR__ . '/blocks/pages/events/event-edit/index.php'; - include_once __DIR__ . '/blocks/user-remote-attendance-mode/index.php'; + include_once __DIR__ . '/blocks/remote-attendance-icon/index.php'; } function register_patterns(): void { From 98aad7efe205579733218d483cd070ab388f5704 Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Mon, 14 Oct 2024 17:10:38 +0100 Subject: [PATCH 5/6] Allow applying custom inline css --- .../blocks/attendee-list/render-list.php | 2 +- .../blocks/contributor-list/index.php | 2 +- .../blocks/remote-attendance-icon/index.php | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php b/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php index 4247da4f..cb2fe8ca 100644 --- a/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php +++ b/themes/wporg-translate-events-2024/blocks/attendee-list/render-list.php @@ -41,7 +41,7 @@ ?> /--> is_remote() ) : ?> - +
diff --git a/themes/wporg-translate-events-2024/blocks/contributor-list/index.php b/themes/wporg-translate-events-2024/blocks/contributor-list/index.php index 5b37135b..697a6c53 100644 --- a/themes/wporg-translate-events-2024/blocks/contributor-list/index.php +++ b/themes/wporg-translate-events-2024/blocks/contributor-list/index.php @@ -62,7 +62,7 @@ function ( Attendee $attendee ) { ?> /--> is_remote() ) : ?> - +
diff --git a/themes/wporg-translate-events-2024/blocks/remote-attendance-icon/index.php b/themes/wporg-translate-events-2024/blocks/remote-attendance-icon/index.php index 9cf842ea..816f00ff 100644 --- a/themes/wporg-translate-events-2024/blocks/remote-attendance-icon/index.php +++ b/themes/wporg-translate-events-2024/blocks/remote-attendance-icon/index.php @@ -5,8 +5,10 @@ 'wporg-translate-events-2024/remote-attendance-icon', array( // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found - 'render_callback' => function () { - return ''; + 'render_callback' => function ( $attributes ) { + $inline_css = isset( $attributes['inline_css'] ) ? esc_attr( $attributes['inline_css'] ) : ''; + + return sprintf( '', $inline_css ); }, ) ); From e01b7f1cdfaae895d8e8ba37792a09943183831e Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Mon, 14 Oct 2024 18:07:13 +0100 Subject: [PATCH 6/6] Remove unused css --- themes/wporg-translate-events-2024/style.css | 6 ------ 1 file changed, 6 deletions(-) diff --git a/themes/wporg-translate-events-2024/style.css b/themes/wporg-translate-events-2024/style.css index 04364c35..805d4754 100644 --- a/themes/wporg-translate-events-2024/style.css +++ b/themes/wporg-translate-events-2024/style.css @@ -162,12 +162,6 @@ select.wp-block-form-input__input { background-color: #46b450; } -span.user-remote-icon.dashicons-video-alt2 { - margin-left: -8.8%; - margin-top: 32px; - color: var(--wp--preset--color--blueberry-1); -} - @media (min-width: 960px) { .wporg-marker-list__container .wporg-marker-list-item {