From 78d71ef494a74b35f4be9554342a63a2d2d3a7db Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Mon, 7 Oct 2024 20:41:53 +0100 Subject: [PATCH 01/14] Move notices out of attend button block --- .../blocks/event-attend-button/index.php | 34 +++++---------- .../pages/events/event-details/render.php | 41 +++++++++++++------ 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/event-attend-button/index.php b/themes/wporg-translate-events-2024/blocks/event-attend-button/index.php index 84e08009..a6992fd8 100644 --- a/themes/wporg-translate-events-2024/blocks/event-attend-button/index.php +++ b/themes/wporg-translate-events-2024/blocks/event-attend-button/index.php @@ -14,7 +14,6 @@ } $event_id = $attributes['id']; $user_is_attending = $attributes['user_is_attending']; - $user_is_contributor = $attributes['user_is_contributor']; $event = Translation_Events::get_event_repository()->get_event( $event_id ); if ( ! $event ) { return ''; @@ -24,31 +23,20 @@ if ( is_user_logged_in() ) : ?>
- end()->is_in_the_past() ) : ?> - -

- - - - -
+ end()->is_in_the_past() ) : ?> + - " /> - - is_remote() ) : ?> - - is_hybrid() ) : ?> -

- Note: This is an onsite-only event. Please only click attend if you are at the event. The host might otherwise remove you.', 'gp-translation-events' ) ); ?> -

- - - is_remote() || $event->is_hybrid() ) : ?> - - + " /> + + is_remote() ) : ?> + + + is_remote() || $event->is_hybrid() ) : ?> + -
+ +
diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index a83ab314..815802e5 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -21,19 +21,34 @@ /--> is_past() ) : - ?> - -
-
-
-

- -

-
-
- - +if ( is_user_logged_in() ) : + if ( $event->is_past() ) : + ?> + +
+
+
+

+ +

+
+
+ + +

+ + + is_hybrid() && ! $event->is_remote() ) : ?> +

+ Note: This is an onsite-only event. Please only click attend if you are at the event. The host might otherwise remove you.', 'wporg-translate-events-2024' ) ); ?> +

+ +

From d9dc228c0cf0dd518cd5c0a0766c1df934bfc375 Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Tue, 8 Oct 2024 16:30:29 +0100 Subject: [PATCH 02/14] Use wporg/notice block --- .../pages/events/event-details/render.php | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index 815802e5..ba47cedc 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -37,13 +37,29 @@ -

+ +
+
+
+

+ +

+
+
+ is_hybrid() && ! $event->is_remote() ) : ?> -

- Note: This is an onsite-only event. Please only click attend if you are at the event. The host might otherwise remove you.', 'wporg-translate-events-2024' ) ); ?> -

+ +
+
+
+

+ +

+
+
+ Date: Tue, 8 Oct 2024 17:07:32 +0100 Subject: [PATCH 03/14] Add edit link to details page --- .../blocks/pages/events/event-details/render.php | 8 ++++++++ themes/wporg-translate-events-2024/style.css | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index ba47cedc..eb967bc6 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -2,6 +2,7 @@ namespace Wporg\TranslationEvents\Theme_2024; use Wporg\TranslationEvents\Attendee\Attendee; +use Wporg\TranslationEvents\Urls; $event = $attributes['event']; $user_is_attending = $attributes['user_is_attending']; @@ -20,6 +21,13 @@ ?> /--> + +id() ) ) : ?> + + + + + is_past() ) : diff --git a/themes/wporg-translate-events-2024/style.css b/themes/wporg-translate-events-2024/style.css index fcfd2af3..205dfe4d 100644 --- a/themes/wporg-translate-events-2024/style.css +++ b/themes/wporg-translate-events-2024/style.css @@ -207,7 +207,21 @@ span.user-remote-icon.dashicons-video-alt2 { .event-nav-link:hover { text-decoration: underline; } - @media (min-width: 960px) { + +.event-details-join { + display: inline-block; +} + +a.details-edit-event span.dashicons-edit { + vertical-align: text-bottom; +} + +a.details-edit-event { + float: right; + text-decoration: none; +} + +@media (min-width: 960px) { .wporg-marker-list__container .wporg-marker-list-item { display: grid; From 8ce21d6712d8cd44564269ef165d8122c6fa3b15 Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Wed, 9 Oct 2024 10:04:17 +0100 Subject: [PATCH 04/14] Remove unused class --- .../blocks/pages/events/event-details/render.php | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index eb967bc6..e522f126 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -1,7 +1,6 @@ Date: Fri, 8 Nov 2024 17:21:48 +0100 Subject: [PATCH 05/14] Use block style for edit link --- .../blocks/pages/events/event-details/render.php | 8 ++++---- themes/wporg-translate-events-2024/style.css | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index e522f126..63500807 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -22,9 +22,9 @@ /--> id() ) ) : ?> - - - +
+ +
is_past() ) : ?> -
+

diff --git a/themes/wporg-translate-events-2024/style.css b/themes/wporg-translate-events-2024/style.css index 205dfe4d..c30b9a6a 100644 --- a/themes/wporg-translate-events-2024/style.css +++ b/themes/wporg-translate-events-2024/style.css @@ -212,11 +212,7 @@ span.user-remote-icon.dashicons-video-alt2 { display: inline-block; } -a.details-edit-event span.dashicons-edit { - vertical-align: text-bottom; -} - -a.details-edit-event { +div.details-edit-event { float: right; text-decoration: none; } From f8359ced7065b2e1438c89c6333a148c6260d4ff Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Thu, 21 Nov 2024 17:39:43 +0100 Subject: [PATCH 06/14] Render page title block only when title is set --- .../wporg-translate-events-2024/functions.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/themes/wporg-translate-events-2024/functions.php b/themes/wporg-translate-events-2024/functions.php index b761156c..2bfb8d6e 100644 --- a/themes/wporg-translate-events-2024/functions.php +++ b/themes/wporg-translate-events-2024/functions.php @@ -178,18 +178,23 @@ function render_page( string $template_path, string $title, array $attributes ): require $template_path; $rendered_template = ob_get_clean(); $page_title = esc_html( $title ); - $page_content = do_blocks( + $page_title_block = ! empty( $page_title ) ? do_blocks( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + << +

+

$page_title

+
+ + BLOCKS + ) : ''; + + $page_content = do_blocks( <<
- -
-

$page_title

-
- - + $page_title_block
$rendered_template
From 5f77bfce10d2fd900e91a97e5215e3c3a7082087 Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Thu, 21 Nov 2024 17:39:58 +0100 Subject: [PATCH 07/14] Set page title to empty string --- .../blocks/pages/events/event-details/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/index.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/index.php index 51f16422..0dec2808 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/index.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/index.php @@ -31,7 +31,7 @@ function ( $breadcrumbs ) use( $event ): array { render_page( __DIR__ . '/render.php', - esc_html( $event->title() ), + '', $attributes ); }, From 45e1d79eb88fa3d8ba78c3d4b416034f50da9899 Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Thu, 21 Nov 2024 17:54:14 +0100 Subject: [PATCH 08/14] Add custom page title for event details page --- .../pages/events/event-details/render.php | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index 63500807..bbe691a0 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -8,23 +8,36 @@ $user_is_contributor = $attributes['user_is_contributor']; ?> + +
+
+

title() ); ?>

+
+ id() ) ) : ?> +
+
+
+ +
+
+
+ + +
+ +is_past() ) : ?> - -id() ) ) : ?> -
- -
Date: Thu, 21 Nov 2024 17:59:46 +0100 Subject: [PATCH 09/14] Remove top margin for notice --- .../blocks/pages/events/event-details/render.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index bbe691a0..44600509 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -44,8 +44,8 @@ if ( is_user_logged_in() ) : if ( $event->is_past() ) : ?> - -
+ +

From 52d298fbaec32f81100916f2665abffd40300daf Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Thu, 21 Nov 2024 18:21:06 +0100 Subject: [PATCH 10/14] Use grid for details title heading --- .../blocks/pages/events/event-details/render.php | 15 ++++++++------- themes/wporg-translate-events-2024/style.css | 5 +++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index 44600509..0fd914d0 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -9,20 +9,21 @@ ?> -

-
+
+

title() ); ?>

id() ) ) : ?> -
-
-
- +
+
+
-
is_past() ) : ?> diff --git a/themes/wporg-translate-events-2024/style.css b/themes/wporg-translate-events-2024/style.css index c30b9a6a..3905b316 100644 --- a/themes/wporg-translate-events-2024/style.css +++ b/themes/wporg-translate-events-2024/style.css @@ -217,6 +217,11 @@ div.details-edit-event { text-decoration: none; } +.details-page-title { + grid-template-columns: 85% 15%; + align-items: center; +} + @media (min-width: 960px) { .wporg-marker-list__container .wporg-marker-list-item { From efc017e35f8d999715159bc8619807f19d99de2d Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Thu, 21 Nov 2024 18:32:53 +0100 Subject: [PATCH 11/14] Add use_custom_page_title flag to choose which page title to use --- .../blocks/pages/events/event-details/index.php | 3 ++- themes/wporg-translate-events-2024/functions.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/index.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/index.php index 0dec2808..1a084784 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/index.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/index.php @@ -28,10 +28,11 @@ function ( $breadcrumbs ) use( $event ): array { return ''; } $attributes['event'] = $event; + $attributes['use_custom_page_title'] = true; render_page( __DIR__ . '/render.php', - '', + esc_html( $event->title() ), $attributes ); }, diff --git a/themes/wporg-translate-events-2024/functions.php b/themes/wporg-translate-events-2024/functions.php index 2bfb8d6e..77732530 100644 --- a/themes/wporg-translate-events-2024/functions.php +++ b/themes/wporg-translate-events-2024/functions.php @@ -178,7 +178,7 @@ function render_page( string $template_path, string $title, array $attributes ): require $template_path; $rendered_template = ob_get_clean(); $page_title = esc_html( $title ); - $page_title_block = ! empty( $page_title ) ? do_blocks( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + $page_title_block = ( empty( $attributes['use_custom_page_title'] ) ) ? do_blocks( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped <<
From 399896ac29712f4bea40d1ed7aa45aebe8cbffa6 Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Fri, 22 Nov 2024 14:08:26 +0100 Subject: [PATCH 12/14] Set bottom margin for heading --- themes/wporg-translate-events-2024/style.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/wporg-translate-events-2024/style.css b/themes/wporg-translate-events-2024/style.css index 3905b316..b2dad638 100644 --- a/themes/wporg-translate-events-2024/style.css +++ b/themes/wporg-translate-events-2024/style.css @@ -221,7 +221,9 @@ div.details-edit-event { grid-template-columns: 85% 15%; align-items: center; } - +.details-page-title h2.wp-block-heading { + margin-bottom: 10px; +} @media (min-width: 960px) { .wporg-marker-list__container .wporg-marker-list-item { From 137c979b50f6c5c6e0e947ff14eb4ce48698b022 Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Fri, 22 Nov 2024 14:16:39 +0100 Subject: [PATCH 13/14] Show notice for users not logged in --- .../pages/events/event-details/render.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index 0fd914d0..fe8995a1 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -26,7 +26,19 @@
-is_past() ) : ?> +is_past() ) : ?> + +
+
+
+

+ +

+
+
+ + + +/--> is_past() ) : - ?> - -
-
-
-

- -

-
-
- - From 4ee79d159cdec7341b3be7fe39970d3e37e5560b Mon Sep 17 00:00:00 2001 From: Tosin Oguntuyi Date: Fri, 22 Nov 2024 15:43:51 +0100 Subject: [PATCH 14/14] Align baseline --- .../blocks/pages/events/event-details/render.php | 2 +- themes/wporg-translate-events-2024/style.css | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php index fe8995a1..9b77fc75 100644 --- a/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php +++ b/themes/wporg-translate-events-2024/blocks/pages/events/event-details/render.php @@ -15,7 +15,7 @@
id() ) ) : ?>